unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Run gdb-calling scripts with M-x gdb
@ 2010-12-26 20:50 Jordi Gutiérrez Hermoso
  2010-12-26 21:38 ` Jordi Gutiérrez Hermoso
  0 siblings, 1 reply; 3+ messages in thread
From: Jordi Gutiérrez Hermoso @ 2010-12-26 20:50 UTC (permalink / raw)
  To: Emacs development discussions

GNU Octave provides a run-octave script in its build directory which
is convenient for running Octave in-place without running make
install. One of the option that run-octave can take is -g which starts
Octave inside a gdb script.

I'd like to be able to debug Octave with gud-mode. If I do "M-x
gud-gdb" and provide ./run-octave -g, I seem to sort of get something
that works, but doesn't take me to Octave's source in a buffer when I
do "frame N" in a stack trace. Thinking it might be a limitation of
"M-x gud-gdb", I tried "M-x gdb" instead, again giving "run-octave -g"
as the parameter for how to run gdb. Unfortunately, this doesn't seem
to setup IO properly, as I'm unable to issue commands to gdb from the
Emacs buffer when invoked this way.

I think this could be a bug of M-x gdb (I don't really understand gud
or pre-gud debugging in Emacs, so forgive me if I'm using the wrong
terminology here). Shouldn't it be able to setup I/O properly even if
it's called by invoking a script that in turn invokes gdb?

Thanks,
- Jordi G. H.



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

* Re: Run gdb-calling scripts with M-x gdb
  2010-12-26 20:50 Run gdb-calling scripts with M-x gdb Jordi Gutiérrez Hermoso
@ 2010-12-26 21:38 ` Jordi Gutiérrez Hermoso
  2010-12-27  3:18   ` Stefan Monnier
  0 siblings, 1 reply; 3+ messages in thread
From: Jordi Gutiérrez Hermoso @ 2010-12-26 21:38 UTC (permalink / raw)
  To: Emacs development discussions

2010/12/26 Jordi Gutiérrez Hermoso <jordigh@gmail.com>:
> GNU Octave provides a run-octave script in its build directory which
> is convenient for running Octave in-place without running make
> install. One of the option that run-octave can take is -g which starts
> Octave inside a gdb script.
>
> I'd like to be able to debug Octave with gud-mode.

To answer my own question, the run-octave script needed to pass the
--annotate=3 option to gdb so it could work with GUD.

I'll see about providing a patch for Octave in order to give this
script said option.

Thanks,
- Jordi G. H.



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

* Re: Run gdb-calling scripts with M-x gdb
  2010-12-26 21:38 ` Jordi Gutiérrez Hermoso
@ 2010-12-27  3:18   ` Stefan Monnier
  0 siblings, 0 replies; 3+ messages in thread
From: Stefan Monnier @ 2010-12-27  3:18 UTC (permalink / raw)
  To: Jordi Gutiérrez Hermoso; +Cc: Emacs development discussions

>> GNU Octave provides a run-octave script in its build directory which
>> is convenient for running Octave in-place without running make
>> install. One of the option that run-octave can take is -g which starts
>> Octave inside a gdb script.
>> I'd like to be able to debug Octave with gud-mode.
> To answer my own question, the run-octave script needed to pass the
> --annotate=3 option to gdb so it could work with GUD.

Indeed, --annotate=3 is needed for M-x gdb.  For M-x gud-gdb, --fullname
is needed instead.


        Stefan



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

end of thread, other threads:[~2010-12-27  3:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-26 20:50 Run gdb-calling scripts with M-x gdb Jordi Gutiérrez Hermoso
2010-12-26 21:38 ` Jordi Gutiérrez Hermoso
2010-12-27  3:18   ` Stefan Monnier

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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).