all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Emacs doesn't show source file when debugging with GDB
@ 2008-05-15  9:58 Francis Moreau
  2008-05-15 11:16 ` Nick Roberts
  0 siblings, 1 reply; 11+ messages in thread
From: Francis Moreau @ 2008-05-15  9:58 UTC (permalink / raw
  To: gnu-emacs-help

Hello,

I'm using gdb inside emacs.

One nice feature, is that Emacs can show the source files for the program I'm
debugging with GDB. But after reinstalling a brand new distrib, Emacs doesn't
show the source files anymore.

Still gdb can, if I list the source but it's not really convenient.

Could anyone tell me how to restore the cool behaviour ?

Thanks
-- 
Francis




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

* Re: Emacs doesn't show source file when debugging with GDB
  2008-05-15  9:58 Emacs doesn't show source file when debugging with GDB Francis Moreau
@ 2008-05-15 11:16 ` Nick Roberts
  2008-05-15 12:00   ` Francis Moreau
  0 siblings, 1 reply; 11+ messages in thread
From: Nick Roberts @ 2008-05-15 11:16 UTC (permalink / raw
  To: Francis Moreau; +Cc: gnu-emacs-help

 > I'm using gdb inside emacs.

What version of Emacs are you using?  What configuration?
(M-x report-emacs-bug will provide these details).

 > One nice feature, is that Emacs can show the source files for the program I'm
 > debugging with GDB. But after reinstalling a brand new distrib, Emacs doesn't
 > show the source files anymore.

Emacs should still show the source.  Which distribution did you use?
Did you compile with -g?
Are you sure that Gdb is stopping in a file that has debug information, i.e.
not a system library?

 > Still gdb can, if I list the source but it's not really convenient.

How do you run Gdb?  Hopefully like this:

Run gdb (like this): gdb --annotate=3 myprog

If you remove the --annotate=3 option, Emacs will behave as you describe.

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




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

* Re: Emacs doesn't show source file when debugging with GDB
  2008-05-15 11:16 ` Nick Roberts
@ 2008-05-15 12:00   ` Francis Moreau
  2008-05-15 23:29     ` Nick Roberts
  0 siblings, 1 reply; 11+ messages in thread
From: Francis Moreau @ 2008-05-15 12:00 UTC (permalink / raw
  To: Nick Roberts; +Cc: gnu-emacs-help

On Thu, May 15, 2008 at 1:16 PM, Nick Roberts <nickrob@snap.net.nz> wrote:
[ snip ]
> How do you run Gdb?  Hopefully like this:
>
> Run gdb (like this): gdb --annotate=3 myprog
>

nope. It's a custom line that call a script which in turn initialize some
devices before launching gdb. But --annotate option is missing anyways.

After I added it, I now have this in emacs when it tries to show the source
code:

error in process filter: Phase error in gdb-pre-prompt (got pre-emacs)

Do you know what's wrong now ?

> If you remove the --annotate=3 option, Emacs will behave as you describe.

Well it worked before though.

Thanks
-- 
Francis




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

* Re: Emacs doesn't show source file when debugging with GDB
  2008-05-15 12:00   ` Francis Moreau
@ 2008-05-15 23:29     ` Nick Roberts
  2008-05-16  9:22       ` Francis Moreau
  0 siblings, 1 reply; 11+ messages in thread
From: Nick Roberts @ 2008-05-15 23:29 UTC (permalink / raw
  To: Francis Moreau; +Cc: gnu-emacs-help

 > nope. It's a custom line that call a script which in turn initialize some
 > devices before launching gdb. But --annotate option is missing anyways.
 > 
 > After I added it, I now have this in emacs when it tries to show the source
 > code:
 > 
 > error in process filter: Phase error in gdb-pre-prompt (got pre-emacs)
 > 
 > Do you know what's wrong now ?

I can only guess as you don't say which version you are using or what your
script does.  ISTR that in Gdb didn't work in Emacs 22.1 if there was a Gdb
command that started execution in the .gdbinit file (or I guess with the -x
option).  This was fixed in Emacs 22.2


 > > If you remove the --annotate=3 option, Emacs will behave as you describe.
 > 
 > Well it worked before though.

Before what? i.e. with which version of Emacs?  How did it work?  In graphical
mode with breakpoint icons, stack, locals buffers etc or just text mode
with the GUD buffer?

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




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

* Re: Emacs doesn't show source file when debugging with GDB
  2008-05-15 23:29     ` Nick Roberts
@ 2008-05-16  9:22       ` Francis Moreau
  2008-05-16  9:54         ` Nick Roberts
  0 siblings, 1 reply; 11+ messages in thread
From: Francis Moreau @ 2008-05-16  9:22 UTC (permalink / raw
  To: Nick Roberts; +Cc: gnu-emacs-help

On Fri, May 16, 2008 at 1:29 AM, Nick Roberts <nickrob@snap.net.nz> wrote:
>  > nope. It's a custom line that call a script which in turn initialize some
>  > devices before launching gdb. But --annotate option is missing anyways.
>  >
>  > After I added it, I now have this in emacs when it tries to show the source
>  > code:
>  >
>  > error in process filter: Phase error in gdb-pre-prompt (got pre-emacs)
>  >
>  > Do you know what's wrong now ?
>
> I can only guess as you don't say which version you are using

Sorry, here it is:

In GNU Emacs 22.1.1 (i386-redhat-linux-gnu, GTK+ Version 2.12.1)
 of 2007-11-06 on xenbuilder4.fedora.phx.redhat.com
configured using `configure  '--build=i386-redhat-linux-gnu'
'--host=i386-redhat-linux-gnu' '--target=i386-redhat-linux-gnu'
'--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr'
'--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=\
/etc' '--datadir=/usr/share' '--includedir=/usr/include'
'--libdir=/usr/lib' '--libexecdir=/usr/libexec' '--localstatedir=/var'
'--sharedstatedir=/usr/com' '--mandir=/usr/share/man'
'--infodir=/usr/share/info' '--with-pop' '--with-sound' \
'--with-gtk' 'build_alias=i386-redhat-linux-gnu'
'host_alias=i386-redhat-linux-gnu'
'target_alias=i386-redhat-linux-gnu' 'CFLAGS=-DMAIL_USE_LOCKF
-DSYSTEM_PURESIZE_EXTRA=16777216 -O2 -g -pipe -Wall
-Wp,-D_FORTIFY_SOURCE=2 -fexceptions --p\
aram=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic
-fasynchronous-unwind-tables''

> or what your script does.

it just ends up to call gdb with a couple of parameters:

gdb --nowindows --annotate=3 -x my_gdbinit a.out

>  ISTR that in Gdb didn't work in Emacs 22.1 if there was a Gdb
> command that started execution in the .gdbinit file (or I guess with the -x
> option).  This was fixed in Emacs 22.2
>

Interesting because I have another problem: the -x switch seems to be ignored
when I start gdb from emacs whereas it's not if gdb is started from a shell.

> Before what? i.e. with which version of Emacs?

Before upgrading my distrib. I was using Fedora 6 and has moved to Fedora 8.

I don't recall my previous version of Emacs I was using.

> How did it work?  In graphical
> mode with breakpoint icons, stack, locals buffers etc or just text mode
> with the GUD buffer?

The latter...

Thanks
-- 
Francis




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

* Re: Emacs doesn't show source file when debugging with GDB
  2008-05-16  9:22       ` Francis Moreau
@ 2008-05-16  9:54         ` Nick Roberts
  2008-05-16 10:01           ` Francis Moreau
  0 siblings, 1 reply; 11+ messages in thread
From: Nick Roberts @ 2008-05-16  9:54 UTC (permalink / raw
  To: Francis Moreau; +Cc: gnu-emacs-help

 > > or what your script does.
 > 
 > it just ends up to call gdb with a couple of parameters:
 > 
 > gdb --nowindows --annotate=3 -x my_gdbinit a.out

This works for me if I have a very simple my_gdbinit file.  Does my_gdbinit
start execution?  It must fail somewhere there.  Start with an empty file
and gradually add Gdb commands.

 >...
 > > Before what? i.e. with which version of Emacs?
 > 
 > Before upgrading my distrib. I was using Fedora 6 and has moved to Fedora 8.
 > 
 > I don't recall my previous version of Emacs I was using.
 > 
 > > How did it work?  In graphical
 > > mode with breakpoint icons, stack, locals buffers etc or just text mode
 > > with the GUD buffer?
 > 
 > The latter...

You can get the old mode in 22.1 by replacing --annotate=3 with --fullname.

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




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

* Re: Emacs doesn't show source file when debugging with GDB
  2008-05-16  9:54         ` Nick Roberts
@ 2008-05-16 10:01           ` Francis Moreau
  2008-05-16 10:09             ` Nick Roberts
  0 siblings, 1 reply; 11+ messages in thread
From: Francis Moreau @ 2008-05-16 10:01 UTC (permalink / raw
  To: Nick Roberts; +Cc: gnu-emacs-help

On Fri, May 16, 2008 at 11:54 AM, Nick Roberts <nickrob@snap.net.nz> wrote:
>  > > or what your script does.
>  >
>  > it just ends up to call gdb with a couple of parameters:
>  >
>  > gdb --nowindows --annotate=3 -x my_gdbinit a.out
>
> This works for me if I have a very simple my_gdbinit file.  Does my_gdbinit
> start execution?  It must fail somewhere there.  Start with an empty file
> and gradually add Gdb commands.
>

As I said in my previous email, my_gdbinit isn't read by gdb when gdb is started
from emacs. It's only read when I start gdb from a shell, and in that case every
things works fine.

Thanks,
-- 
Francis




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

* Re: Emacs doesn't show source file when debugging with GDB
  2008-05-16 10:01           ` Francis Moreau
@ 2008-05-16 10:09             ` Nick Roberts
  2008-05-16 10:28               ` Francis Moreau
  0 siblings, 1 reply; 11+ messages in thread
From: Nick Roberts @ 2008-05-16 10:09 UTC (permalink / raw
  To: Francis Moreau; +Cc: gnu-emacs-help

 > > This works for me if I have a very simple my_gdbinit file.  Does my_gdbinit
 > > start execution?  It must fail somewhere there.  Start with an empty file
 > > and gradually add Gdb commands.
 > >
 > 
 > As I said in my previous email, my_gdbinit isn't read by gdb when gdb is
 > started from emacs. It's only read when I start gdb from a shell, and in
 > that case every things works fine.

But you also say:

   After I added it, I now have this in emacs when it tries to show the source
   code:

   error in process filter: Phase error in gdb-pre-prompt (got pre-emacs)

which looks like Gdb is doing soething.  Perhaps it's reading your
my_gdbinit file and the error message is getting lost somewhere.


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




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

* Re: Emacs doesn't show source file when debugging with GDB
  2008-05-16 10:09             ` Nick Roberts
@ 2008-05-16 10:28               ` Francis Moreau
  2008-05-16 21:28                 ` Nick Roberts
  0 siblings, 1 reply; 11+ messages in thread
From: Francis Moreau @ 2008-05-16 10:28 UTC (permalink / raw
  To: Nick Roberts; +Cc: gnu-emacs-help

On Fri, May 16, 2008 at 12:09 PM, Nick Roberts <nickrob@snap.net.nz> wrote:
> which looks like Gdb is doing soething.  Perhaps it's reading your
> my_gdbinit file and the error message is getting lost somewhere.
>

Are there any Emacs option to turn it in debug mode and give us more clue.

Anyways since Fedora 9 is out, I'm going to do a new upgrade and see if
the prob persist.

Thanks
-- 
Francis




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

* Re: Emacs doesn't show source file when debugging with GDB
  2008-05-16 10:28               ` Francis Moreau
@ 2008-05-16 21:28                 ` Nick Roberts
  2008-05-19  7:47                   ` Francis Moreau
  0 siblings, 1 reply; 11+ messages in thread
From: Nick Roberts @ 2008-05-16 21:28 UTC (permalink / raw
  To: Francis Moreau; +Cc: gnu-emacs-help

 > > which looks like Gdb is doing soething.  Perhaps it's reading your
 > > my_gdbinit file and the error message is getting lost somewhere.
 > >
 > 
 > Are there any Emacs option to turn it in debug mode and give us more clue.

You can set gdb-enable-debug to t and view gdb-debug-log to look at the
transcript between Emacs and Gdb but as a first check you could see if
a more simple script, e.g., one with just the single Gdb command "pwd",
runs in Emacs.

 > Anyways since Fedora 9 is out, I'm going to do a new upgrade and see if
 > the prob persist.

I think Fedora 9 has the same version of Emacs, i.e. 22.1.

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




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

* Re: Emacs doesn't show source file when debugging with GDB
  2008-05-16 21:28                 ` Nick Roberts
@ 2008-05-19  7:47                   ` Francis Moreau
  0 siblings, 0 replies; 11+ messages in thread
From: Francis Moreau @ 2008-05-19  7:47 UTC (permalink / raw
  To: Nick Roberts; +Cc: gnu-emacs-help

On Fri, May 16, 2008 at 11:28 PM, Nick Roberts <nickrob@snap.net.nz> wrote:
>  > > which looks like Gdb is doing soething.  Perhaps it's reading your
>  > > my_gdbinit file and the error message is getting lost somewhere.
>  > >
>  >
>  > Are there any Emacs option to turn it in debug mode and give us more clue.
>
> You can set gdb-enable-debug to t and view gdb-debug-log to look at the
> transcript between Emacs and Gdb but as a first check you could see if
> a more simple script, e.g., one with just the single Gdb command "pwd",
> runs in Emacs.
>

Ok will try.

>  > Anyways since Fedora 9 is out, I'm going to do a new upgrade and see if
>  > the prob persist.
>
> I think Fedora 9 has the same version of Emacs, i.e. 22.1.
>

nope it's 22.2

thanks
-- 
Francis




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

end of thread, other threads:[~2008-05-19  7:47 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-15  9:58 Emacs doesn't show source file when debugging with GDB Francis Moreau
2008-05-15 11:16 ` Nick Roberts
2008-05-15 12:00   ` Francis Moreau
2008-05-15 23:29     ` Nick Roberts
2008-05-16  9:22       ` Francis Moreau
2008-05-16  9:54         ` Nick Roberts
2008-05-16 10:01           ` Francis Moreau
2008-05-16 10:09             ` Nick Roberts
2008-05-16 10:28               ` Francis Moreau
2008-05-16 21:28                 ` Nick Roberts
2008-05-19  7:47                   ` Francis Moreau

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.