Questions tagged [debugging]

Debugging is a methodical process of finding and reducing the number of bugs, or defects, in a computer program.

Debugging is a methodical process of finding and reducing the number of bugs, or defects, in a computer program or a piece of electronic hardware, thus making it behave as expected. Debugging tends to be harder when various subsystems are tightly coupled, as changes in one may cause bugs to emerge in another. Many books have been written about debugging, as it involves numerous aspects, including interactive debugging, control flow, integration testing, log files, monitoring (application, system), memory dumps, profiling, Statistical Process Control, and special design tactics to improve detection while simplifying changes.

Applications for Debugging:

  • WinDbg - A debugger for low-level debugging, mostly used for production debugging and difficult error solving.
    • WinDbg also contains extensions for .Net debugging like ".Sos", ".SosEx" and more...
  • OllyDbg - An assembly debugger mostly used for reverse engineering and cracking.
    • Note that as for February 2014 OllyDbg only support 32 Bit application debugging.

Learning Sources:

Books:

525 questions
64
votes
2 answers

What do I do when Emacs is frozen?

What should I do when Emacs stops responding? My current "emacs-is-frozen" protocol looks like this: Spam C-g (it sometimes works) Wait for a while. pkill -9 emacs What alternate steps could I try to avoid losing work that hasn't been autosaved…
Clément
  • 3,924
  • 1
  • 22
  • 37
62
votes
4 answers

Debugging a frozen Emacs

I am using mew for my e-mail. I need to use TLS with my email provider for SMTP. However, when I try to invoke that, Emacs freezes. I would like to take this opportunity to learn more about Emacs packages. How would I go about debugging this…
Svante
  • 721
  • 5
  • 7
56
votes
9 answers

Using Emacs as a full-featured C/C++ IDE

I have been trying off and on for over a year now to use Emacs as a C/C++ IDE. I have only been marginally successful thus far, but have run into a few brick walls along the way. Currently I am trying to use CEDET, but I am having a rough time…
nispio
  • 8,175
  • 2
  • 35
  • 73
25
votes
1 answer

How do I troubleshoot Emacs problems?

In a situation where Emacs is not behaving like I want, what can I do to troubleshoot the problem? What steps can I take to find and fix the problem myself? Or, failing that, how can I gather useful information that so that people here (or on the…
Tyler
  • 21,719
  • 1
  • 52
  • 92
22
votes
3 answers

How to cancel `edebug-defun`?

How do I undo the effects of edebug-defun? In other words, how do I rescind the directive that causes edebug to enter debugging mode when a particular function is invoked? Also, I'd really like to know where the answer to this question is in the…
kjo
  • 3,145
  • 14
  • 42
21
votes
3 answers

Show line number on error

Say that emacs throws some error that I don't understand. Or maybe the error says "Symbol's value as variable is void: modes", but there are many occurrences of the symbol modes in my code, so I need some context. Can Emacs be configured to mention…
Jackson
  • 1,218
  • 9
  • 19
21
votes
1 answer

How do I debug `Package cl is deprecated`?

While compiling an Elisp package from github, I get the Warning: Package cl is deprecated How do I find out what triggers it? The specific file that triggers this is tiny and has no CL code. I think there should be a way to turn the warning into…
sds
  • 5,928
  • 20
  • 39
19
votes
1 answer

How can I debug random Emacs server crashes?

I generally have a long-running instance of emacs --daemon, which I connect to with various emacsclients. Recently I have started experiencing random crashes. I say "random" because I haven't been able to figure out what causes the crashes. Often it…
Scott Weldon
  • 2,695
  • 1
  • 17
  • 31
18
votes
1 answer

Interrupt evaluation and observe current stack in the emacs-lisp debugger?

If some emacs-lisp function, such as a major mode hook, is taking longer than expected to execute, I would sometimes like to interrupt it and look at the current stack. Ideally, I'd also like to be able to look at variable values, and so on, in the…
Kirill
  • 1,019
  • 7
  • 19
18
votes
1 answer

How do I debug an emacs crash?

I am debugging why emacs crashes when using a function from a package1. The aim of this debug process is to get useful data to submit using M-x report-emacs-bug. To get help on how to debug emacs crashes, I have already looked at Emacs Manual -…
Kaushal Modi
  • 25,203
  • 3
  • 74
  • 179
15
votes
2 answers

debugging some elisp -- "end of file during parsing error" in init.el

After a long debugging of my init.el file, it looks like the first line of the following elisp-code, i.e (custom-set-variablesis provoking an 'End of file during parsing' error) which I absolutely don't understand. If I comment this line, all is…
loukios
  • 815
  • 1
  • 8
  • 19
14
votes
2 answers

How to kill a buffer when it causes Emacs to stop responding?

I use Emacs Dired to manage files. Accidentally, I hit Enter on an image file, Emacs tries to open the image and stop response. Is there a way to kill this process? (Since I am running other processes at the same time, I don't want to restart…
Nick
  • 4,423
  • 4
  • 24
  • 41
13
votes
1 answer

Find elisp origin of warning

I ran a command and received a warning in the minibuffer. The exact warning was comint-completion-at-point failed to return valid completion data, after I autocompleted a command in shell-mode. How can I determine the elisp origin of the warning?
Matthew Piziak
  • 5,958
  • 3
  • 29
  • 77
13
votes
1 answer

Get backtrace from error programmatically

If an error is signalled in Emacs Lisp code, and debug-on-error is t, I get a backtrace buffer that makes it easy to figure out where the error occurred. However, for errors that occur while processing a response from the network asynchronously, it…
legoscia
  • 6,012
  • 29
  • 54
12
votes
0 answers

Edebug orgmode source code blocks with input variables

What is the standard method to debug emacs-lisp orgmode source code blocks with input variables as header arguments? I found the hacky solution to insert the following snipped in front of a source code block. (when t ;; t: do debug, nil: do not…
Tobias
  • 32,569
  • 1
  • 34
  • 75
1
2 3
34 35