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: Sebastien Vauban
Subject: Re: highlight current source line during debugging
Date: Tue, 05 Feb 2013 16:16:04 +0100
User-agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.2.92 (windows-nt)

Hi John and Stephen,

John Yates wrote:
> On Tue, Feb 5, 2013 at 4:11 AM, Stephen Berman <stephen.berman@gmx.net> wrote:
>> On Mon, 4 Feb 2013 17:21:18 -0500 John Yates <john@yates-sheets.org> 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)
>
> 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.

You could have a look at for another (?) solution (see last entry):

  http://www.emacswiki.org/emacs/DebuggingWithEmacs

BTW, I've the same wish for EDebug. Don't know whether that code can be
adapted to serve so.

Best regards,
  Seb

-- 
Sebastien Vauban


reply via email to

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