From: Daniel Jacobowitz <drow@false.org>
To: gdb-patches@sources.redhat.com
Subject: [rfa/symtab] Fix breakpoints by full path
Date: Mon, 20 Sep 2004 00:17:00 -0000 [thread overview]
Message-ID: <20040920001659.GA24644@nevyn.them.org> (raw)
This patch fixes a bug in setting breakpoints by full path. The problem is
two dangling users of source_full_path_of; the right way to set
pst->fullname now is to use psymtab_to_fullname, which takes advantage of
pst->dirname if it was available. source_full_path_of only considers the
search path, which is less useful.
Without the patch, this sequence would fail:
cd tmp
gcc -o tmp tmp.c
cd ..
gdb ./tmp/tmp
break /path/to/tmp/tmp.c:1
But this one would succeed:
cd tmp
gcc -o tmp tmp.c
cd ..
gdb ./tmp/tmp
interpreter-exec mi -file-list-exec-source-files
break /path/to/tmp/tmp.c:1
(because -file-list-exec-source-files initialized fullname correctly).
Tested on i386-pc-linux-gnu, no regressions, fixes the new failure in
fullname.exp. OK?
--
Daniel Jacobowitz
2004-09-19 Daniel Jacobowitz <dan@debian.org>
* symtab.c (lookup_partial_symtab): Use psymtab_to_fullname.
(lookup_partial_symtab): Use symtab_to_fullname.
Index: symtab.c
===================================================================
RCS file: /cvs/src/src/gdb/symtab.c,v
retrieving revision 1.137
diff -u -p -r1.137 symtab.c
--- symtab.c 19 Sep 2004 22:49:23 -0000 1.137
+++ symtab.c 19 Sep 2004 23:32:40 -0000
@@ -272,8 +272,7 @@ lookup_partial_symtab (const char *name)
this symtab and use its absolute path. */
if (full_path != NULL)
{
- if (pst->fullname == NULL)
- source_full_path_of (pst->filename, &pst->fullname);
+ psymtab_to_fullname (pst);
if (pst->fullname != NULL
&& FILENAME_CMP (full_path, pst->fullname) == 0)
{
@@ -284,8 +283,7 @@ lookup_partial_symtab (const char *name)
if (real_path != NULL)
{
char *rp = NULL;
- if (pst->fullname == NULL)
- source_full_path_of (pst->filename, &pst->fullname);
+ psymtab_to_fullname (pst);
if (pst->fullname != NULL)
{
rp = gdb_realpath (pst->fullname);
next reply other threads:[~2004-09-20 0:17 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-09-20 0:17 Daniel Jacobowitz [this message]
2004-09-20 16:59 ` Jim Blandy
2004-09-20 18:31 ` Daniel Jacobowitz
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20040920001659.GA24644@nevyn.them.org \
--to=drow@false.org \
--cc=gdb-patches@sources.redhat.com \
/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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox