help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: highlight current source line during debugging


From: John Yates
Subject: Re: highlight current source line during debugging
Date: Tue, 5 Feb 2013 08:56:38 -0600

Hi Stephen,

Thanks for this suggestion.  To implement it seems to require that one
know the name of the elisp function which places the overlay arrow.  I
have been having a hard time figuring this out for gdb disassembly
buffers.

Performing cleanup based on an event in the buffer seems fragile.
Would it not be better to hook buffer destruction?

Finally, does this technique keep the line high lighted even when the
buffer is not selected?  In a normal debugging session it is the
buffer with the gdb prompt that is selected most of the time.

/john

On Tue, Feb 5, 2013 at 4:11 AM, Stephen Berman <address@hidden> wrote:
> On Mon, 4 Feb 2013 17:21:18 -0500 John Yates <address@hidden> wrote:
>
>> When debugging I get a small triangular arrow in the left fringe.
>> Especially when stepping through disassembled machine instructions it
>> would be a big help to have the entire current line high lighted in
>> some fashion.  Can anyone suggest a solution?
>
> A useful package for this is hl-line.  How you use it might depend on
> what kind of program you are debugging and what debugger you are using.
> As an example, here's how you could get it for Emacs Lisp code using Edebug:
>
> (defadvice edebug-overlay-arrow (around highlight-line activate)
>   "Highlight line currently being edebugged."
>   (require 'hl-line)
>   (hl-line-mode)
>   ad-do-it)
>
> (defun my-edebug-quit ()
>   "Stop edebugging and remove highlighting."
>   (interactive)
>   (hl-line-mode -1)
>   (top-level))
>
> (define-key edebug-mode-map [remap top-level] 'my-edebug-quit)
>
> HTH
>
> Steve Berman



reply via email to

[Prev in Thread] Current Thread [Next in Thread]