Questions tagged [debug]

49 questions
7
votes
3 answers

Is it possible to edebug a lambda returned by a function?

For example, (defun create-function (number) `(lambda () (* ,number ,number))) (defalias 'square-two (create-function 2) "adds two") (square-two)
Russ Kiselev
  • 464
  • 3
  • 10
5
votes
2 answers

What tools can help make the emacs debug output more readable?

I was expecting to find tools I can use to to e.g. prettify the stack trace, or e.g. show all variables that are bound at each level of the stack trace as you navigate, but haven't found anything. Do any tools to improve the debugging experience…
avv
  • 1,563
  • 10
  • 24
5
votes
1 answer

Debug pytests in emacs

I try to debug my pytest-cases like this: import pytest def test_something() ... ... pytest.set_trace() Then, i execute the tests by running elpy-test. The test starts to run and stops at pytest.set_trace() - unfortunately…
Markus
  • 471
  • 2
  • 12
4
votes
1 answer

Emacs elisp debugger: How do i make the debugger jump to source when i press s?

The builtin elisp debugger (i.e. the regular one, debug, not edebug) has a default binding of s to command backtrace-goto-source. When I try to use it, it says: Source code location not known You can see what I mean by doing this: Set contents of…
nate
  • 63
  • 5
4
votes
1 answer

Examine function arguments after debug-on-error

Here's a common debugging scenario: I am investigating a failure and for whatever reason I cannot instrument the relevant code with edebug. I can, however, in most cases get a backtrace via toggle-debug-on-error, or debug-on-entry. In the backtrace,…
4
votes
0 answers

Is there an ELISP decompiler?

I'm thinking of writing one so that when I get those horrible tracebacks from bytecode files, I can better see where I was at. Is there one already? Are there any other tools for showing an error traceback in more Elisp programmer terms rather…
rocky
  • 888
  • 7
  • 26
4
votes
2 answers

how to start daemon with `--debug-init` or equivalent debugger?

summary problem I'm trying to debug a problem that involves an Emacs config and daemon startup. But when I run emacs --daemon --debug-init from a console, the spew ends with Loading desktop from /home/me/.emacs.d/personal/ ... Entering…
TomRoche
  • 592
  • 3
  • 20
4
votes
1 answer

Stack reflection in Emacs Lisp?

Are there reflection methods available in elisp to examine the stack without invoking the debugger? For example: Get the calling/callee function Get the function call stack Get the (longer) nested statement stack Get arguments for any of the…
ebpa
  • 7,319
  • 26
  • 53
3
votes
2 answers

the Name of Function defined in C

I tried to use GDB to debug Emacs. More specifically, I want to observe the behavior of a function written in C. vertical-motion is a built-in function in ‘C source code’. However, the name of a C function cannot contain a - (i.e., minus sign). …
shynur
  • 4,065
  • 1
  • 3
  • 23
3
votes
1 answer

How to navigate stack frames in Emacs debugger?

I'm trying to debug the infamous Unrecognized entry in undo list undo-tree-canary, and after having Emacs debugger triggered on error, I want to move back and forth between stack frames and to examine state of variables. Sort of what frame 3 command…
Hi-Angel
  • 525
  • 6
  • 18
3
votes
1 answer

How to force `condition-case` to activate the debugger

Often times I need to debug code wrapped in the BODYFORM of condition-case; however, the debugger is suppressed even though I have debug-on-error set to t. The doc-string states that we can add debug to the list of handlers, but I didn't find a…
lawlist
  • 18,826
  • 5
  • 37
  • 118
3
votes
1 answer

Autocompletion of a variable name while Python debugging

Suppose I want to debug Python script in Emacs. M-x pdb run pdb like this pdb script name.py. Next I'd like to examine a variable. I type p and first letters of a variable name, then press Tab and instead of completion of the variable name cursor…
3
votes
0 answers

set breakpoint while in debugger?

Is it possible to set a breakpoint on an arbitrary line while already established in browser()? As a use-case: if I debug(myfunc) and while in Browse[2]> ... I realize that I need to jump forward to a point in the source file. My two current methods…
r2evans
  • 245
  • 1
  • 10
3
votes
1 answer

Signaling a breakpoint in Emacs Lisp

Many languages have a mechanism to signal an attached debugger to pause or break. For example in JavaScript this is done using the debugger keyword. In others like C# or Visual Basic the signal is generated by a built-in function. This…
ebpa
  • 7,319
  • 26
  • 53
2
votes
1 answer

how to load source file for debug?

BTW, you will get a more complete backtrace if you load the source file instead of the byte-compiled file, for the code that defines run-python. (https://emacs.stackexchange.com/a/20265/12031) How do I load the source file for debug…
eugene
  • 481
  • 1
  • 5
  • 11
1
2 3 4