unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* how automate these steps in STARTING debuggers??? (gdb, pdb, etc.)
@ 2003-09-08 20:25 Christian Seberino
  2003-09-08 21:17 ` Kevin Rodgers
  0 siblings, 1 reply; 3+ messages in thread
From: Christian Seberino @ 2003-09-08 20:25 UTC (permalink / raw)


I am trying to start to learn to use C and Python debuggers in Emacs.

This requires M-x followed by the name of the debugger..... gdb or pdb.

I noticed gdb/pdb then ask for filename you want to debug.  It seems this could
be automated or at least ASSUMED to be the same file currently in buffer.
Is this possible??

Also, can I do all this gdb/pdb stuff in a new frame/window so it doesn't
impact file I'm editing??

Lastly, I redefined C-x in .emacs and this causes an error with gdb and pdb.
Is there any hope to make them both not conflict???

Chris

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: how automate these steps in STARTING debuggers??? (gdb, pdb, etc.)
  2003-09-08 20:25 how automate these steps in STARTING debuggers??? (gdb, pdb, etc.) Christian Seberino
@ 2003-09-08 21:17 ` Kevin Rodgers
  2003-09-11  0:52   ` Christian Seberino
  0 siblings, 1 reply; 3+ messages in thread
From: Kevin Rodgers @ 2003-09-08 21:17 UTC (permalink / raw)


Christian Seberino wrote:

> I am trying to start to learn to use C and Python debuggers in Emacs.
> 
> This requires M-x followed by the name of the debugger..... gdb or pdb.
> 
> I noticed gdb/pdb then ask for filename you want to debug.  It seems this could
> be automated or at least ASSUMED to be the same file currently in buffer.
> Is this possible??


(defadvice gdb (before debug-visited-file activate)
   "When called interactively, provide the visited file name as a default argument."
   (interactive (list (gud-query-cmdline 'gdb
                                         (if buffer-file-name
                                             (file-name-nondirectory
                                              buffer-file-name))))))


> Also, can I do all this gdb/pdb stuff in a new frame/window so it doesn't
> impact file I'm editing??


(let ((gud-buffer-name-regexp "\\*gud-.*\\*\\(\\|<[0-9]+>\\)"))
  (setq special-display-buffer-regexps
        (cons gud-buffer-name-regexp special-display-buffer-regexps))
  (setq same-window-regexps
        (delete gud-buffer-name-regexp same-window-regexps)))

> Lastly, I redefined C-x in .emacs and this causes an error with gdb and pdb.


That's a bad idea, because C-x is a prefix character.

> Is there any hope to make them both not conflict???

Try customizing the gud-key-prefix variable.


-- 
Kevin Rodgers

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: how automate these steps in STARTING debuggers??? (gdb, pdb, etc.)
  2003-09-08 21:17 ` Kevin Rodgers
@ 2003-09-11  0:52   ` Christian Seberino
  0 siblings, 0 replies; 3+ messages in thread
From: Christian Seberino @ 2003-09-11  0:52 UTC (permalink / raw)


Kevin

Thanks for all your replies to my questions.  This is all great info.
I tried to set gud-key-prefix and was not able to do it.  Is there
some special way to set this variable that is unlike other variables???

Here is one attempt to set variable:

 (setq-default        gud-key-prefix           "C-x" )

Here is the error message when I start gdb:

 Key sequence C - x C-l uses invalid prefix characters

This is odd since I'm not even altering gud-key-prefix
from its original value!?!?

Chris


Kevin Rodgers <ihs_4664@yahoo.com> wrote in message news:<3F5CF204.2050708@yahoo.com>...
> Christian Seberino wrote:
> 
> > I am trying to start to learn to use C and Python debuggers in Emacs.
> > 
> > This requires M-x followed by the name of the debugger..... gdb or pdb.
> > 
> > I noticed gdb/pdb then ask for filename you want to debug.  It seems this could
> > be automated or at least ASSUMED to be the same file currently in buffer.
> > Is this possible??
> 
> 
> (defadvice gdb (before debug-visited-file activate)
>    "When called interactively, provide the visited file name as a default argument."
>    (interactive (list (gud-query-cmdline 'gdb
>                                          (if buffer-file-name
>                                              (file-name-nondirectory
>                                               buffer-file-name))))))
> 
> 
> > Also, can I do all this gdb/pdb stuff in a new frame/window so it doesn't
> > impact file I'm editing??
> 
> 
> (let ((gud-buffer-name-regexp "\\*gud-.*\\*\\(\\|<[0-9]+>\\)"))
>   (setq special-display-buffer-regexps
>         (cons gud-buffer-name-regexp special-display-buffer-regexps))
>   (setq same-window-regexps
>         (delete gud-buffer-name-regexp same-window-regexps)))
> 
> > Lastly, I redefined C-x in .emacs and this causes an error with gdb and pdb.
> 
> 
> That's a bad idea, because C-x is a prefix character.
> 
> > Is there any hope to make them both not conflict???
> 
> Try customizing the gud-key-prefix variable.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-09-11  0:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-09-08 20:25 how automate these steps in STARTING debuggers??? (gdb, pdb, etc.) Christian Seberino
2003-09-08 21:17 ` Kevin Rodgers
2003-09-11  0:52   ` Christian Seberino

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).