Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Elena Zannoni <ezannoni@cygnus.com>
To: Mark Kettenis <kettenis@wins.uva.nl>
Cc: gdb-patches@sources.redhat.com, jimb@cygnus.com, ezannoni@cygnus.com
Subject: Re: [PATCH, RFA] Fix basename bug in symtab.c
Date: Mon, 14 May 2001 06:41:00 -0000	[thread overview]
Message-ID: <15103.57505.663396.845883@kwikemart.cygnus.com> (raw)
In-Reply-To: <200105132045.f4DKjpm03579@delius.kettenis.local>

Mark Kettenis writes:
 > [Jim, Elena, sorry I keep saying cygnus instead of redhat :-(]
 > 
 > Here is a patch that fixes the problems discussed on the discussion
 > list.  Eli pretty much convinced me that this is the right approach.
 > We can still discuss the other uses of basename() in GDB, but since
 > this fixes a rather serious bug on FreeBSD (and I suppose other
 > systems as well), I'd like to get this in ASAP.
 > 
 > Mark
 > 

Yes, go ahead. I think this qualifies pretty much as an obvious fix.

Should you include libiberty.h ?

Thanks
Elena


 > 
 > Index: ChangeLog
 > from  Mark Kettenis  <kettenis@gnu.org>
 > 
 > 	* symtab.c (lookup_symtab_1): Use lbasename (NAME) instead of
 > 	basename (NAME).  The FreeBSD basename returns a pointer to a
 > 	static buffer, even if it's simply returning a string identical to
 > 	its argument.
 > 	(lookup_partial_symtab): Likewise.
 > 
 > Index: symtab.c
 > ===================================================================
 > RCS file: /cvs/src/src/gdb/symtab.c,v
 > retrieving revision 1.37
 > diff -u -p -r1.37 symtab.c
 > --- symtab.c 2001/05/11 17:48:31 1.37
 > +++ symtab.c 2001/05/13 19:37:21
 > @@ -154,7 +154,7 @@ got_symtab:
 >  
 >    /* Now, search for a matching tail (only if name doesn't have any dirs) */
 >  
 > -  if (basename (name) == name)
 > +  if (lbasename (name) == name)
 >      ALL_SYMTABS (objfile, s)
 >      {
 >        if (FILENAME_CMP (basename (s->filename), name) == 0)
 > @@ -244,7 +244,7 @@ lookup_partial_symtab (char *name)
 >  
 >    /* Now, search for a matching tail (only if name doesn't have any dirs) */
 >  
 > -  if (basename (name) == name)
 > +  if (lbasename (name) == name)
 >      ALL_PSYMTABS (objfile, pst)
 >      {
 >        if (FILENAME_CMP (basename (pst->filename), name) == 0)
 > 


  parent reply	other threads:[~2001-05-14  6:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-05-13 13:45 Mark Kettenis
2001-05-13 23:52 ` Eli Zaretskii
2001-05-14  6:41 ` Elena Zannoni [this message]
2001-05-14  7:02   ` Eli Zaretskii
2001-05-14  7:09     ` Elena Zannoni
     [not found] <3B0039B5.7060704@cygnus.com>
2001-05-14 23:19 ` Eli Zaretskii
2001-05-15  1:31 Michael Elizabeth Chastain

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=15103.57505.663396.845883@kwikemart.cygnus.com \
    --to=ezannoni@cygnus.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=jimb@cygnus.com \
    --cc=kettenis@wins.uva.nl \
    /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