From: Eli Zaretskii <eliz@gnu.org>
To: Stephen Berman <stephen.berman@gmx.net>
Cc: emacs-devel@gnu.org
Subject: Re: gdb problem
Date: Sat, 14 Jun 2008 13:33:30 +0300 [thread overview]
Message-ID: <ur6b0l30l.fsf@gnu.org> (raw)
In-Reply-To: <87y759j7cl.fsf@escher.local.home>
> From: Stephen Berman <stephen.berman@gmx.net>
> Date: Sat, 14 Jun 2008 00:30:34 +0200
>
> (gdb) br /Users/steve/lib/emacs-cvs-pre-unicode/src/window.c:3840
> Internal: readin window.c pst for `/Users/steve/lib/emacs-cvs-pre-unicode/src/window.c' found when no symtab found.
> (gdb) br window.c:3840
> Breakpoint 3 at 0x8099956: file window.c, line 3840.
> (gdb) c
> Continuing.
>
> Breakpoint 3, Fdisplay_buffer (buffer=137869892, not_this_window=137636041, frame=137636041)
> at window.c:3840
> warning: Source file is more recent than executable.
> 3840 p->next = o->next;
>
>
> First, I do not understand the gdb response when I tried to set a
> breakpoint using an absolute path, but it evidently failed to set the
> breakpoint. Then I just used the file name and that did set the
> breakpoint, and when it hit the breakpoint, gdb said it was in
> Fdisplay_buffer, which is what I wanted, so this seemed to be ok. But
> the next two lines, the last two listed above, are strange: the warning
> that the source file is more recent than the executable, and the content
> of the line at the breakpoint. In fact, this line is from window.c in
> the directory /Users/steve/cvsroot/emacs/src, which is my source
> directory of the Emacs CVS trunk (which does not contain Fdisplay_buffer
> any more).
>
> What happened here?
There's something I'd like you to explain first. If, as you say, the
Emacs binary you were debugging was produced from the sources in the
same /Users/steve/lib/emacs-cvs-pre-unicode/ tree, then why did you
use an absolute file name to set a breakpoint in the first place?
That's a highly unusual thing to do on systems where the source file
names and the directories they live in are recorded in the executable's
debug info.
More to the point, my crystal ball says that you compiled that Emacs
binary in the /Users/steve/cvsroot/emacs/ tree, and then moved it,
together with the sources, into /Users/steve/lib/emacs-cvs-pre-unicode/.
As I say above, the original directories are recorded in the debug
info which GDB reads and uses, so it tries to access the source files
which were since updated.
To verify that my guess is correct, type "info sources" in GDB, and
see where it thinks your source files live.
If my guess is correct, then the following command should tell GDB to
try the sources in /Users/steve/lib/emacs-cvs-pre-unicode/src first:
(gdb) dir /Users/steve/lib/emacs-cvs-pre-unicode/src
(you should probably do the same for the lwlib directory).
GDB has a more powerful feature for this kind of situations: the "set
substitute-path" command. If the above doesn't help, read about that
command in the GDB manual, and set up your substitution rules to point
GDB at the /Users/steve/lib/emacs-cvs-pre-unicode/ tree.
Alternatively, just rebuilding Emacs in the emacs-cvs-pre-unicode tree
should resolve all these problems (again, if my guess about the root
cause is correct).
next prev parent reply other threads:[~2008-06-14 10:33 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-13 22:30 gdb problem Stephen Berman
2008-06-14 10:33 ` Eli Zaretskii [this message]
2008-06-14 22:25 ` Stephen Berman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ur6b0l30l.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
--cc=stephen.berman@gmx.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).