[Top][All Lists]

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

Re: How can I specify emacs to use a specified gdb with command paramet

From: David L
Subject: Re: How can I specify emacs to use a specified gdb with command parameters
Date: Fri, 20 Mar 2009 06:38:03 -0700

On Thu, Mar 19, 2009 at 11:23 PM, Lucius Fox wrote:
> Thanks.
> Another question I have is
> * how does emacs knows where to pulll the source code during debugging?

I think it learns it from gdb.  gdb learns if from the debugging symbols in
the executable.  I think there is some interaction with some emacs settings
because I've had situations where I've been unable to insert a breakpoint
in a file by clicking in the left margin, but emacs has been able to bring
me to the right line when gdb stops at a breakpoint inserted the old
fashion way.

> * after i open a file, how can I setup a break point at a particular line?
If gdb is active and emacs and gdb agree that the file you've opened
is a source file (usually, but not always true in my experience), you can
just left click in the left margin.

I'm responding on-list to this because other people might be able
to give better answers.

Good luck,


> On Thu, Mar 19, 2009 at 10:58 PM, David L wrote:
>> On Thu, Mar 19, 2009 at 10:47 PM, Lucius Fox  wrote:
>>> David,
>>> Thank you for your response.
>>> Is there a way to specify what my gdb command (like in your example,
>>> put '/tmp/mygdb --annotate=3 /tmp/myexec')  in .emacs file? So that it
>>> does not prompt me everytime I use M-x gdb?
>> I do something like this in my .emacs:
>> (defun my-gdb ()
>>  (interactive)
>>  (setq gdb-many-windows nil)
>>  (setq gdb-use-separate-io-buffer nil)
>>  (tool-bar-mode t)
>>  (set-fringe-mode 'default)
>>  (gdb "/tmp/mygdb --annotate=3"))
>> Then I assign a key to run my-gdb
>> (global-set-key [C-f7]  'my-gdb)
>> Cheers...
>>              Dave

reply via email to

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