From: Bob Rossi <bob@brasko.net>
To: Andreas Schwab <schwab@suse.de>
Cc: Elena Zannoni <ezannoni@redhat.com>, Eli Zaretskii <eliz@gnu.org>,
gdb-patches@sources.redhat.com
Subject: Re: -file-list-exec-source-files
Date: Mon, 28 Jun 2004 20:40:00 -0000 [thread overview]
Message-ID: <20040628204031.GE2665@white> (raw)
In-Reply-To: <je3c4gooyy.fsf@sykes.suse.de>
On Sun, Jun 27, 2004 at 08:06:13PM +0200, Andreas Schwab wrote:
> Bob Rossi <bob@brasko.net> writes:
>
> > +/* Finds the fullname that a symtab represents.
> > +
> > + If this functions finds the fullname, it will save it in ps->fullname
> > + and it will also return the value.
> >
> > + If this function fails to find the file that this symtab represents,
> > + NULL will be returned and ps->fullname will be set to NULL. */
>
> This causes gdb to crash in lookup_symtab.
>
> if (full_path != NULL)
> {
> const char *fp = symtab_to_fullname (s);
> if (FILENAME_CMP (full_path, fp) == 0)
> {
> return s;
> }
> }
>
> if (real_path != NULL)
> {
> char *rp = gdb_realpath (symtab_to_fullname (s));
> make_cleanup (xfree, rp);
> if (FILENAME_CMP (real_path, rp) == 0)
> {
> return s;
> }
> }
The patch below checks symtab_to_fullname's return value against NULL.
Even though this is the "trivial" fix, I believe it is the correct
patch. When I added these calls recently, I blindly changed the old call
to symtab_to_fullname, and the old call did not return NULL.
Permission to apply?
2004-06-28 Bob Rossi <bob@brasko.net>
* symtab.c (lookup_symtab): check return value of symtab_to_fullname
Index: symtab.c
===================================================================
RCS file: /cvs/src/src/gdb/symtab.c,v
retrieving revision 1.133
diff -w -u -r1.133 symtab.c
--- symtab.c 18 Jun 2004 21:36:15 -0000 1.133
+++ symtab.c 28 Jun 2004 20:36:18 -0000
@@ -182,7 +182,7 @@
if (full_path != NULL)
{
const char *fp = symtab_to_fullname (s);
- if (FILENAME_CMP (full_path, fp) == 0)
+ if (fp != NULL && FILENAME_CMP (full_path, fp) == 0)
{
return s;
}
@@ -190,7 +190,10 @@
if (real_path != NULL)
{
- char *rp = gdb_realpath (symtab_to_fullname (s));
+ char *fullname = symtab_to_fullname (s);
+ if (fullname != NULL)
+ {
+ char *rp = gdb_realpath (fullname);
make_cleanup (xfree, rp);
if (FILENAME_CMP (real_path, rp) == 0)
{
@@ -198,6 +201,7 @@
}
}
}
+ }
/* Now, search for a matching tail (only if name doesn't have any dirs) */
next prev parent reply other threads:[~2004-06-28 20:40 UTC|newest]
Thread overview: 112+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-02-25 4:01 -file-list-exec-source-files Bob Rossi
2004-03-19 0:09 ` -file-list-exec-source-files Elena Zannoni
2004-03-05 22:36 ` -file-list-exec-source-files Elena Zannoni
2004-03-19 0:09 ` -file-list-exec-source-files Jason Molenda
2004-03-05 23:02 ` -file-list-exec-source-files Jason Molenda
2004-03-19 0:09 ` -file-list-exec-source-files Bob Rossi
2004-03-06 15:57 ` -file-list-exec-source-files Bob Rossi
2004-03-11 13:25 ` -file-list-exec-source-files Bob Rossi
2004-03-19 0:09 ` -file-list-exec-source-files Bob Rossi
2004-03-23 13:09 ` A small patch case study, -file-list-exec-source-files Bob Rossi
2004-03-23 15:49 ` [Gdbheads] " Robert Dewar
2004-03-23 16:13 ` Ian Lance Taylor
2004-03-25 4:36 ` Bob Rossi
2004-03-25 5:59 ` Joel Brobecker
2004-03-25 6:11 ` Ian Lance Taylor
2004-03-25 6:19 ` Robert Dewar
2004-03-25 12:43 ` Bob Rossi
2004-03-25 13:34 ` Ian Lance Taylor
2004-03-25 14:04 ` Robert Dewar
2004-03-25 14:34 ` Ian Lance Taylor
2004-03-25 15:08 ` Robert Dewar
2004-03-25 15:43 ` Ian Lance Taylor
2004-03-27 0:21 ` Robert Dewar
2004-03-27 1:02 ` Michael Snyder
2004-03-27 1:10 ` Ian Lance Taylor
2004-03-25 18:17 ` Christopher Faylor
2004-03-25 19:27 ` Michael Snyder
2004-03-25 19:51 ` Ian Lance Taylor
2004-03-25 7:35 ` Eli Zaretskii
2004-03-25 7:59 ` Joel Brobecker
2004-03-25 14:21 ` Bob Rossi
2004-03-25 19:16 ` Michael Snyder
2004-03-25 6:34 ` Eli Zaretskii
2004-03-25 19:31 ` Michael Snyder
2004-03-23 16:14 ` Bob Rossi
2004-03-23 16:56 ` Joel Brobecker
2004-03-23 21:27 ` David Carlton
2004-03-24 6:34 ` Eli Zaretskii
2004-03-23 21:25 ` David Carlton
2004-03-24 6:34 ` Eli Zaretskii
2004-03-24 5:39 ` Richard Stallman
2004-03-23 20:59 ` Feb's patch resolution rate Andrew Cagney
2004-03-23 21:15 ` David Carlton
2004-03-23 21:31 ` Andrew Cagney
2004-03-23 22:07 ` David Carlton
2004-03-24 6:16 ` Eli Zaretskii
2004-03-25 2:05 ` [Gdbheads] " Richard Stallman
2004-03-25 4:13 ` Bob Rossi
2004-03-25 6:11 ` Robert Dewar
2004-03-25 6:43 ` Eli Zaretskii
2004-03-25 11:08 ` Mark Kettenis
2004-03-25 16:53 ` Andrew Cagney
2004-03-29 20:55 ` -file-list-exec-source-files Bob Rossi
2004-04-05 21:40 ` -file-list-exec-source-files Bob Rossi
2004-04-12 15:06 ` -file-list-exec-source-files Bob Rossi
2004-04-21 1:10 ` -file-list-exec-source-files Bob Rossi
2004-04-21 4:52 ` -file-list-exec-source-files Eli Zaretskii
2004-04-21 12:20 ` -file-list-exec-source-files Bob Rossi
2004-04-21 18:41 ` -file-list-exec-source-files Eli Zaretskii
2004-04-22 15:43 ` -file-list-exec-source-files Elena Zannoni
2004-04-27 0:05 ` -file-list-exec-source-files Bob Rossi
2004-05-06 22:13 ` -file-list-exec-source-files Bob Rossi
2004-05-07 15:24 ` -file-list-exec-source-files Eli Zaretskii
[not found] ` <9743-Sat08May2004132930+0300-eliz@gnu.org>
2004-05-17 13:11 ` -file-list-exec-source-files Bob Rossi
2004-05-22 1:53 ` -file-list-exec-source-files Bob Rossi
2004-05-23 10:40 ` -file-list-exec-source-files Eli Zaretskii
2004-05-23 10:51 ` -file-list-exec-source-files Eli Zaretskii
2004-05-24 2:02 ` -file-list-exec-source-files Bob Rossi
2004-05-28 12:52 ` -file-list-exec-source-files Bob Rossi
2004-06-01 16:07 ` -file-list-exec-source-files Elena Zannoni
2004-06-01 18:01 ` -file-list-exec-source-files Bob Rossi
2004-06-01 18:56 ` -file-list-exec-source-files Jason Molenda
2004-06-01 21:22 ` -file-list-exec-source-files Bob Rossi
2004-06-02 19:22 ` -file-list-exec-source-files Elena Zannoni
2004-06-03 2:35 ` -file-list-exec-source-files Bob Rossi
2004-06-09 18:18 ` -file-list-exec-source-files Bob Rossi
2004-06-09 18:42 ` -file-list-exec-source-files Daniel Jacobowitz
2004-06-09 19:17 ` -file-list-exec-source-files Bob Rossi
2004-06-09 19:57 ` -file-list-exec-source-files Daniel Jacobowitz
2004-06-10 20:04 ` -file-list-exec-source-files Bob Rossi
2004-06-27 18:12 ` -file-list-exec-source-files Andreas Schwab
2004-06-27 19:07 ` -file-list-exec-source-files Bob Rossi
2004-06-27 20:33 ` -file-list-exec-source-files Andreas Schwab
2004-06-28 19:48 ` -file-list-exec-source-files Bob Rossi
2004-06-28 20:40 ` Bob Rossi [this message]
2004-06-29 4:05 ` -file-list-exec-source-files Eli Zaretskii
2004-06-29 18:34 ` -file-list-exec-source-files Bob Rossi
2004-06-29 18:52 ` -file-list-exec-source-files Eli Zaretskii
2004-06-29 20:10 ` -file-list-exec-source-files Bob Rossi
2004-06-29 20:27 ` -file-list-exec-source-files Eli Zaretskii
2004-06-29 20:29 ` -file-list-exec-source-files Bob Rossi
2004-02-26 2:06 -file-list-exec-source-files Bob Rossi
2004-02-26 23:54 ` -file-list-exec-source-files Andrew Cagney
2004-02-27 13:23 ` -file-list-exec-source-files Bob Rossi
2004-02-29 3:20 ` -file-list-exec-source-files Bob Rossi
2004-03-02 0:33 ` -file-list-exec-source-files Bob Rossi
2004-03-02 5:43 ` -file-list-exec-source-files Eli Zaretskii
2004-03-02 15:21 ` -file-list-exec-source-files Andrew Cagney
2004-03-02 15:28 ` -file-list-exec-source-files Bob Rossi
2004-03-19 0:09 ` -file-list-exec-source-files Bob Rossi
2004-03-02 16:32 ` -file-list-exec-source-files Eli Zaretskii
2004-03-19 0:09 ` -file-list-exec-source-files Eli Zaretskii
2004-03-19 0:09 ` -file-list-exec-source-files Andrew Cagney
2004-03-19 0:09 ` -file-list-exec-source-files Eli Zaretskii
2004-03-19 0:09 ` -file-list-exec-source-files Bob Rossi
2004-03-25 3:54 -file-list-exec-source-files Bob Rossi
2004-06-27 19:14 -file-list-exec-source-files Michael Elizabeth Chastain
2004-06-29 4:57 -file-list-exec-source-files Michael Elizabeth Chastain
2004-06-29 22:37 -file-list-exec-source-files Michael Elizabeth Chastain
2004-06-30 3:32 ` -file-list-exec-source-files Eli Zaretskii
2004-07-06 21:02 ` -file-list-exec-source-files Bob Rossi
2004-07-08 11:19 ` -file-list-exec-source-files Bob Rossi
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=20040628204031.GE2665@white \
--to=bob@brasko.net \
--cc=eliz@gnu.org \
--cc=ezannoni@redhat.com \
--cc=gdb-patches@sources.redhat.com \
--cc=schwab@suse.de \
/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