Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <pedro@codesourcery.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: gdb-patches@sourceware.org, dj@redhat.com,
	ktietz70@googlemail.com, binutils@sourceware.org,
	gcc-patches@gcc.gnu.org
Subject: Re: [patch libiberty include]: Add additional helper functions for directory-separator searching
Date: Wed, 09 Mar 2011 13:39:00 -0000	[thread overview]
Message-ID: <201103091258.38655.pedro@codesourcery.com> (raw)
In-Reply-To: <83pqq0pj4b.fsf@gnu.org>

On Wednesday 09 March 2011 12:35:00, Eli Zaretskii wrote:
> > I meant a valid use case in the code bases.
> 
> Sorry for my misunderstanding.

NP.

> 
> > Might as well cook up a (gdb) patch.  Find it pasted below.  Does it
> > look good to you?
> 
> Yes, looks fine.  Thanks.

Thanks.  I've applied it.

> > The one's left are: 1 in a linux-native only file (never cares
> > for other filesystem semantics), and a couple in the coff and
> > mdebug readers.  The latter could be rewritten in terms of
> > lbasename, but I'm not sure whether gcc outputs a literal '/' in
> > that case even when building on mingw.  If so, and we changed them,
> > we'd be breaking reading these files on Windows
> 
> Sorry, I don't understand how would that break on Windows.  Could you
> elaborate?  And what "couple of coff and mdebug readers" did you have
> in mind?

Sorry, in the hurry, I had a (another) brain cramp.  Wouldn't break.
Still it'd be useless to change this _if_ gcc hardcodes '/'.  Dunno
whether it does.

>find . -name "*.c" | xargs grep strrchr | grep "'/'"
./linux-thread-db.c:    cp = strrchr (path, '/');
./mdebugread.c:               p = strrchr (namestring, '/');
./dbxread.c:        p = strrchr (namestring, '/');

Both look like this:

	    /* Some compilers (including gcc) emit a pair of initial N_SOs.
	       The first one is a directory name; the second the file name.
	       If pst exists, is empty, and has a filename ending in '/',
	       we assume the previous N_SO was a directory name.  */

	    p = strrchr (namestring, '/');
	    if (p && *(p + 1) == '\000')
	      {
		/* Save the directory name SOs locally, then save it into
		   the psymtab when it's created below.  */
	        dirname_nso = namestring;
	        continue;		
	      }

-- 
Pedro Alves


  reply	other threads:[~2011-03-09 12:58 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-08 11:25 Kai Tietz
2011-03-08 11:53 ` Eli Zaretskii
2011-03-08 11:55   ` Kai Tietz
2011-03-08 12:01     ` Eli Zaretskii
2011-03-08 12:48       ` Kai Tietz
2011-03-08 13:25         ` Pedro Alves
2011-03-08 13:33           ` Kai Tietz
2011-03-08 14:30             ` Pedro Alves
2011-03-08 14:45               ` Kai Tietz
2011-03-08 18:49               ` Eli Zaretskii
2011-03-08 18:54                 ` Pedro Alves
2011-03-08 18:58                 ` Kai Tietz
2011-03-08 19:59                   ` Eli Zaretskii
     [not found] ` <E1Pwupb-0001ns-M8__47566.5626036518$1299582745$gmane$org@fencepost.gnu.org>
2011-03-08 12:43   ` Andreas Schwab
2011-03-08 16:52 ` Kai Tietz
2011-03-08 17:02   ` Kai Tietz
2011-03-08 18:39     ` Eli Zaretskii
2011-03-08 19:51       ` DJ Delorie
2011-03-08 22:38         ` Eli Zaretskii
2011-03-08 23:10         ` Pedro Alves
2011-03-09  7:12           ` Eli Zaretskii
2011-03-09 12:40             ` Pedro Alves
2011-03-09 12:54               ` Eli Zaretskii
2011-03-09 13:39                 ` Pedro Alves [this message]
2011-03-09 13:54                   ` Eli Zaretskii
2011-03-12 22:59                     ` Kai Tietz
2011-03-09 15:02                   ` Build regression [Re: [patch libiberty include]: Add additional helper functions for directory-separator searching] Jan Kratochvil
2011-03-09 15:40                     ` Pedro Alves
2011-03-09 16:09                       ` Jan Kratochvil
2011-03-13  1:09         ` [patch libiberty include]: Add additional helper functions for directory-separator searching Kai Tietz

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=201103091258.38655.pedro@codesourcery.com \
    --to=pedro@codesourcery.com \
    --cc=binutils@sourceware.org \
    --cc=dj@redhat.com \
    --cc=eliz@gnu.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=gdb-patches@sourceware.org \
    --cc=ktietz70@googlemail.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