Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* emacs and gdb
@ 2008-11-06  7:07 Dave Milter
  2008-11-06  9:16 ` Andreas Schwab
  0 siblings, 1 reply; 16+ messages in thread
From: Dave Milter @ 2008-11-06  7:07 UTC (permalink / raw)
  To: gdb

I met strange problem with running gdb under emacs,
I run it like this:
arm-eabi-gdb --annotate=3 someprog.elf
target remote :3333
Remote debugging using :3333
0x00000004 in ?? ()
(gdb) monitor soft_reset_halt

/home/test/src/toolchains/gdb/gdb-6.8.50.20080706/gdb/findvar.c:298:
internal-error: value_of_register_lazy: Assertion `frame_id_p
(get_frame_id (frame))' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.


if I type the same commands in gdb running in terminal all ok:

arm-eabi-gdb -annotate 3 someprog.elf
pre-prompt
(gdb)
prompt


post-prompt

pre-prompt
(gdb)
prompt
target remote :3333

post-prompt
Remote debugging using :3333

frame-begin 0 0x4
0x00000004 in ?? ()

stopped

pre-prompt
(gdb)
prompt
monitor soft_reset_halt

post-prompt

any idea what is going on, and how to fix this?


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

* Re: emacs and gdb
  2008-11-06  7:07 emacs and gdb Dave Milter
@ 2008-11-06  9:16 ` Andreas Schwab
  2008-11-06  9:40   ` Dave Milter
  0 siblings, 1 reply; 16+ messages in thread
From: Andreas Schwab @ 2008-11-06  9:16 UTC (permalink / raw)
  To: Dave Milter; +Cc: gdb

"Dave Milter" <davemilter@gmail.com> writes:

> I met strange problem with running gdb under emacs,
> I run it like this:
> arm-eabi-gdb --annotate=3 someprog.elf
> target remote :3333
> Remote debugging using :3333
> 0x00000004 in ?? ()
> (gdb) monitor soft_reset_halt
>
> /home/test/src/toolchains/gdb/gdb-6.8.50.20080706/gdb/findvar.c:298:
> internal-error: value_of_register_lazy: Assertion `frame_id_p
> (get_frame_id (frame))' failed.
> A problem internal to GDB has been detected,
> further debugging may prove unreliable.
>
>
> if I type the same commands in gdb running in terminal all ok:

The Emacs frontend does a few things behind your back.  Those commands
are issued with the server prefix so that they don't show up in the
history.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


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

* Re: emacs and gdb
  2008-11-06  9:16 ` Andreas Schwab
@ 2008-11-06  9:40   ` Dave Milter
  2008-11-06  9:44     ` Andreas Schwab
  0 siblings, 1 reply; 16+ messages in thread
From: Dave Milter @ 2008-11-06  9:40 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: gdb

On Thu, Nov 6, 2008 at 12:15 PM, Andreas Schwab <schwab@suse.de> wrote:
> "Dave Milter" <davemilter@gmail.com> writes:
>
>> I met strange problem with running gdb under emacs,
>> I run it like this:
>> arm-eabi-gdb --annotate=3 someprog.elf
>> target remote :3333
>> Remote debugging using :3333
>> 0x00000004 in ?? ()
>> (gdb) monitor soft_reset_halt
>>
>> /home/test/src/toolchains/gdb/gdb-6.8.50.20080706/gdb/findvar.c:298:
>> internal-error: value_of_register_lazy: Assertion `frame_id_p
>> (get_frame_id (frame))' failed.
>> A problem internal to GDB has been detected,
>> further debugging may prove unreliable.
>>
>>
>> if I type the same commands in gdb running in terminal all ok:
>
> The Emacs frontend does a few things behind your back.  Those commands
> are issued with the server prefix so that they don't show up in the
> history.
>

But how can I find out what is going on? Is it possible to catch such commands,
for example force gdb to save them to file, without need to rebuild gdb?

I find out that
arm-eabi-gdb 6.6.50.20070821-cvs works fine under emacs 22.3.1
arm-eabi-gdb 6.8.50.20080706 give internal error above under emacs 22.3.1

so I almost sure that this is not emacs problem.


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

* Re: emacs and gdb
  2008-11-06  9:40   ` Dave Milter
@ 2008-11-06  9:44     ` Andreas Schwab
  2008-11-06 10:31       ` Dave Milter
  0 siblings, 1 reply; 16+ messages in thread
From: Andreas Schwab @ 2008-11-06  9:44 UTC (permalink / raw)
  To: Dave Milter; +Cc: gdb

"Dave Milter" <davemilter@gmail.com> writes:

> But how can I find out what is going on? Is it possible to catch such commands,

Try to set gdb-server-prefix to "".

> for example force gdb to save them to file, without need to rebuild gdb?

Try "set logging on".

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


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

* Re: emacs and gdb
  2008-11-06  9:44     ` Andreas Schwab
@ 2008-11-06 10:31       ` Dave Milter
  2009-01-25  1:17         ` Nick Roberts
  0 siblings, 1 reply; 16+ messages in thread
From: Dave Milter @ 2008-11-06 10:31 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: gdb

On Thu, Nov 6, 2008 at 12:44 PM, Andreas Schwab <schwab@suse.de> wrote:
> "Dave Milter" <davemilter@gmail.com> writes:
>
>> But how can I find out what is going on? Is it possible to catch such commands,
>
> Try to set gdb-server-prefix to "".
>
>> for example force gdb to save them to file, without need to rebuild gdb?
>
> Try "set logging on".
>

Thanks a lot, I got this, at now gdb running in terminal:

(gdb) target remote :3333
Remote debugging using :3333
0x00000004 in ?? ()
(gdb) info frame
Cannot access memory at address 0xffe7fdff
Stack level 0, frame at 0x0:
 pc = 0x4; saved pc
/home/test/src/toolchains/gdb/gdb-6.8.50.20080706/gdb/findvar.c:298:
internal-error: value_of_register_lazy: Assertion `frame_id_p
(get_frame_id (frame))' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.

emacs call info frame, and this cause gdb failure,
is this gdb bug?


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

* Re: emacs and gdb
  2008-11-06 10:31       ` Dave Milter
@ 2009-01-25  1:17         ` Nick Roberts
  0 siblings, 0 replies; 16+ messages in thread
From: Nick Roberts @ 2009-01-25  1:17 UTC (permalink / raw)
  To: Dave Milter; +Cc: Andreas Schwab, gdb

 > (gdb) target remote :3333
 > Remote debugging using :3333
 > 0x00000004 in ?? ()
 > (gdb) info frame
 > Cannot access memory at address 0xffe7fdff
 > Stack level 0, frame at 0x0:
 >  pc = 0x4; saved pc
 > /home/test/src/toolchains/gdb/gdb-6.8.50.20080706/gdb/findvar.c:298:
 > internal-error: value_of_register_lazy: Assertion `frame_id_p
 > (get_frame_id (frame))' failed.
 > A problem internal to GDB has been detected,
 > further debugging may prove unreliable.
 > 
 > emacs call info frame, and this cause gdb failure,
 > is this gdb bug?

Yes, I think this is a gdb bug and I have filed a bug report here:

http://sourceware.org/bugzilla/show_bug.cgi?id=9786

-- 
Nick                                           http://www.inet.net.nz/~nickrob


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

* Re: Emacs and GDB
  2002-12-09  9:40       ` a2782
@ 2002-12-09 10:12         ` Keith Seitz
  0 siblings, 0 replies; 16+ messages in thread
From: Keith Seitz @ 2002-12-09 10:12 UTC (permalink / raw)
  To: a2782; +Cc: gdb

On Mon, 9 Dec 2002 a2782@dis.ulpgc.es wrote:

> I\'m very interested in MI interface. But I don\'t know what\'s the way to
> make it works with GDB. I mean, does it work with normal GDB? Is it a
> library? How do I interact with it? Is there any restriction with GDB
> versions?

MI is an alternative command interface that is built into recent versions 
of gdb (>5.2-ish). Just invoke gdb with the "--i=mi" (or 
"--interpreter=mi") option, and gdb will run using the mi interface.

For more details, see the MI chapter in the GDB User Manual (available 
online).

Keith




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

* Re: Emacs and GDB
  2002-12-05 16:56     ` Fernando Nasser
@ 2002-12-09  9:40       ` a2782
  2002-12-09 10:12         ` Keith Seitz
  0 siblings, 1 reply; 16+ messages in thread
From: a2782 @ 2002-12-09  9:40 UTC (permalink / raw)
  To: Fernando Nasser; +Cc: gdb

I\'m very interested in MI interface. But I don\'t know what\'s the way to
make it works with GDB. I mean, does it work with normal GDB? Is it a
library? How do I interact with it? Is there any restriction with GDB
versions?

Thanks in advance.

Quoting Fernando Nasser <fnasser@redhat.com>:

> You should also look at the MI interface (see the manual).  It is the
safer
> way
> for sending commands and receiving output from GDB that is to be
parsed. 
> It
> won\'t change frequently like the output printed for human consumption.
>
>
>
> --
> Fernando Nasser
> Red Hat - Toronto                       E-Mail:  fnasser@redhat.com
> 2323 Yonge Street, Suite #300
> Toronto, Ontario   M4P 2C9
> 


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

* Re: Emacs and GDB
  2002-11-23  3:59   ` a2782
  2002-11-23 12:34     ` Eli Zaretskii
  2002-11-25  6:50     ` Kris Warkentin
@ 2002-12-05 16:56     ` Fernando Nasser
  2002-12-09  9:40       ` a2782
  2 siblings, 1 reply; 16+ messages in thread
From: Fernando Nasser @ 2002-12-05 16:56 UTC (permalink / raw)
  To: a2782; +Cc: gdb

a2782@dis.ulpgc.es wrote:> Any idea about how can I do this emacs-style 
invocation in (Kylix) C++?
> I want to execute GDB and redirect its input to the output of my 
> program in C++ (in order to send commands to GDB); and its output to 
> the input of my C++ program (in order to parse the information which 
> GDB returns).
> 

You should also look at the MI interface (see the manual).  It is the safer way 
for sending commands and receiving output from GDB that is to be parsed.  It 
won't change frequently like the output printed for human consumption.



-- 
Fernando Nasser
Red Hat - Toronto                       E-Mail:  fnasser@redhat.com
2323 Yonge Street, Suite #300
Toronto, Ontario   M4P 2C9


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

* Re: Emacs and GDB
  2002-11-23  3:59   ` a2782
  2002-11-23 12:34     ` Eli Zaretskii
@ 2002-11-25  6:50     ` Kris Warkentin
  2002-12-05 16:56     ` Fernando Nasser
  2 siblings, 0 replies; 16+ messages in thread
From: Kris Warkentin @ 2002-11-25  6:50 UTC (permalink / raw)
  To: a2782, gdb

Another place you might like to look is the sources for DDD.  The file
'Agent.C' does the setup of the pty with the pipes and dups and all the
other fun stuff.  You can also look at some of it's subclasses such as
AsyncAgent which modify the behaviour somewhat.  A cool thing with DDD
(maybe emacs too?) is that you can access the gdb console and use 'show
args' to see how they setup the command line with the redirection and so on.

cheers,

Kris

----- Original Message -----
From: <a2782@dis.ulpgc.es>
To: <gdb@sources.redhat.com>
Sent: Saturday, November 23, 2002 7:57 AM
Subject: Re: Emacs and GDB


> Any idea about how can I do this emacs-style invocation in (Kylix) C++?
> I want to execute GDB and redirect its input to the output of my
> program in C++ (in order to send commands to GDB); and its output to
> the input of my C++ program (in order to parse the information which
> GDB returns).
>
> Thanks to all people who are replying me!
>
> > Emacs calls GDB like this:
> >
> >       gdb -fullname <args...>
> >
> > where \"<args...>\" is whatever you type at \"M-x gdb\"\'s prompt.
> >
> > In other words, if you tell Emacs to invoke GDB with \"gdb myprog\",
> > Emacs invokes \"gdb -fullname myprog\".
> >
> > See gud.el in the Emacs distribution for more details, and see the GDB
> > user manual for the description of the -fullname option.
> >
>


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

* Re: Emacs and GDB
  2002-11-23 15:52       ` Jim Blandy
@ 2002-11-23 21:55         ` Eli Zaretskii
  0 siblings, 0 replies; 16+ messages in thread
From: Eli Zaretskii @ 2002-11-23 21:55 UTC (permalink / raw)
  To: Jim Blandy; +Cc: a2782, gdb


On 23 Nov 2002, Jim Blandy wrote:

> > Why not do what Emacs does: create a pipe for communications between
> > GDB and your program, then fork/exec GDB and redirect its standard
> > streams to the pipe using dup2/dup system calls?
> 
> Actually, Emacs creates a pseudo-tty, and runs GDB there.

Actually, Emacs does both: it uses pseudo-ttys where available, or 
creates a pipe where they aren't.  (More accurately, there's also a third 
method, via a socket.)

The source file process.c in the Emacs distribution has the gory details.


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

* Re: Emacs and GDB
  2002-11-23 12:34     ` Eli Zaretskii
@ 2002-11-23 15:52       ` Jim Blandy
  2002-11-23 21:55         ` Eli Zaretskii
  0 siblings, 1 reply; 16+ messages in thread
From: Jim Blandy @ 2002-11-23 15:52 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: a2782, gdb

"Eli Zaretskii" <eliz@is.elta.co.il> writes:

> > Date: Sat, 23 Nov 2002 12:57:05 GMT
> > From: a2782@dis.ulpgc.es
> > 
> > Any idea about how can I do this emacs-style invocation in (Kylix) C++? 
> > I want to execute GDB and redirect its input to the output of my 
> > program in C++ (in order to send commands to GDB); and its output to 
> > the input of my C++ program (in order to parse the information which 
> > GDB returns).
> 
> Why not do what Emacs does: create a pipe for communications between
> GDB and your program, then fork/exec GDB and redirect its standard
> streams to the pipe using dup2/dup system calls?

Actually, Emacs creates a pseudo-tty, and runs GDB there.  That allows
Emacs to send a SIGINT when the user types 'C-c C-c', and things like
that.


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

* Re: Emacs and GDB
  2002-11-23  3:59   ` a2782
@ 2002-11-23 12:34     ` Eli Zaretskii
  2002-11-23 15:52       ` Jim Blandy
  2002-11-25  6:50     ` Kris Warkentin
  2002-12-05 16:56     ` Fernando Nasser
  2 siblings, 1 reply; 16+ messages in thread
From: Eli Zaretskii @ 2002-11-23 12:34 UTC (permalink / raw)
  To: a2782; +Cc: gdb

> Date: Sat, 23 Nov 2002 12:57:05 GMT
> From: a2782@dis.ulpgc.es
> 
> Any idea about how can I do this emacs-style invocation in (Kylix) C++? 
> I want to execute GDB and redirect its input to the output of my 
> program in C++ (in order to send commands to GDB); and its output to 
> the input of my C++ program (in order to parse the information which 
> GDB returns).

Why not do what Emacs does: create a pipe for communications between
GDB and your program, then fork/exec GDB and redirect its standard
streams to the pipe using dup2/dup system calls?


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

* Re: Emacs and GDB
  2002-11-23  3:36 ` Eli Zaretskii
@ 2002-11-23  3:59   ` a2782
  2002-11-23 12:34     ` Eli Zaretskii
                       ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: a2782 @ 2002-11-23  3:59 UTC (permalink / raw)
  To: gdb

Any idea about how can I do this emacs-style invocation in (Kylix) C++? 
I want to execute GDB and redirect its input to the output of my 
program in C++ (in order to send commands to GDB); and its output to 
the input of my C++ program (in order to parse the information which 
GDB returns).

Thanks to all people who are replying me!

> Emacs calls GDB like this:
>
>       gdb -fullname <args...>
>
> where \"<args...>\" is whatever you type at \"M-x gdb\"\'s prompt.
>
> In other words, if you tell Emacs to invoke GDB with \"gdb myprog\",
> Emacs invokes \"gdb -fullname myprog\".
>
> See gud.el in the Emacs distribution for more details, and see the GDB
> user manual for the description of the -fullname option.
> 


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

* Re: Emacs and GDB
  2002-11-23  2:36 Emacs and GDB a2782
@ 2002-11-23  3:36 ` Eli Zaretskii
  2002-11-23  3:59   ` a2782
  0 siblings, 1 reply; 16+ messages in thread
From: Eli Zaretskii @ 2002-11-23  3:36 UTC (permalink / raw)
  To: a2782; +Cc: gdb

> Date: Sat, 23 Nov 2002 11:33:54 GMT
> From: a2782@dis.ulpgc.es
> 
> Does anyone know how Emacs invokes GDB?

Emacs calls GDB like this:

      gdb -fullname <args...>

where "<args...>" is whatever you type at "M-x gdb"'s prompt.

In other words, if you tell Emacs to invoke GDB with "gdb myprog",
Emacs invokes "gdb -fullname myprog".

See gud.el in the Emacs distribution for more details, and see the GDB
user manual for the description of the -fullname option.


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

* Emacs and GDB
@ 2002-11-23  2:36 a2782
  2002-11-23  3:36 ` Eli Zaretskii
  0 siblings, 1 reply; 16+ messages in thread
From: a2782 @ 2002-11-23  2:36 UTC (permalink / raw)
  To: gdb

Does anyone know how Emacs invokes GDB?

Thanks


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

end of thread, other threads:[~2009-01-25  1:17 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-11-06  7:07 emacs and gdb Dave Milter
2008-11-06  9:16 ` Andreas Schwab
2008-11-06  9:40   ` Dave Milter
2008-11-06  9:44     ` Andreas Schwab
2008-11-06 10:31       ` Dave Milter
2009-01-25  1:17         ` Nick Roberts
  -- strict thread matches above, loose matches on Subject: below --
2002-11-23  2:36 Emacs and GDB a2782
2002-11-23  3:36 ` Eli Zaretskii
2002-11-23  3:59   ` a2782
2002-11-23 12:34     ` Eli Zaretskii
2002-11-23 15:52       ` Jim Blandy
2002-11-23 21:55         ` Eli Zaretskii
2002-11-25  6:50     ` Kris Warkentin
2002-12-05 16:56     ` Fernando Nasser
2002-12-09  9:40       ` a2782
2002-12-09 10:12         ` Keith Seitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox