From: Kai Tietz <ktietz70@googlemail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: Pedro Alves <pedro@codesourcery.com>,
gdb-patches@sourceware.org, gcc-patches@gcc.gnu.org,
binutils@sourceware.org
Subject: Re: [patch libiberty include]: Add additional helper functions for directory-separator searching
Date: Tue, 08 Mar 2011 18:58:00 -0000 [thread overview]
Message-ID: <AANLkTincj7k3f1==6MuDC-grHxZcpTHL28CLZ1nXvt2o@mail.gmail.com> (raw)
In-Reply-To: <838vwph30i.fsf@gnu.org>
2011/3/8 Eli Zaretskii <eliz@gnu.org>:
>> From: Pedro Alves <pedro@codesourcery.com>
>> Date: Tue, 8 Mar 2011 13:33:02 +0000
>> Cc: Kai Tietz <ktietz70@googlemail.com>,
>> gcc-patches@gcc.gnu.org,
>> Eli Zaretskii <eliz@gnu.org>,
>> binutils@sourceware.org
>>
>> On Tuesday 08 March 2011 12:48:11, Kai Tietz wrote:
>>
>> > Well, a better example is elfstab_offset_sections() in elfread.c.
>>
>> /* The ELF symbol info doesn't include path names, so strip the path
>> (if any) from the psymtab filename. */
>> while (0 != (p = strchr (filename, '/')))
>> filename = p + 1;
>>
>> Looks like its looking for the last path separator, so
>> it might as well use filename_dirrchr instead.
>
> Exactly.
>
>> > Another is in find_file_and_directory() in dwarf2read.c file.
>>
>> Workaround for Irix. Certainly that '/' should not depend
>> on the host gdb is running on.
>
> It actually should use IS_ABSOLUTE_FILE_NAME, if any portability
> enhancement is needed here.
>
> In my experience, the strchr analog is not needed, only the strrchr
> one (which could be used quite a lot). The few places that use strchr
> now should actually be rewritten to search from the end, because
> that's what they need.
>
Here I am not that sure. For example in gcc's gengtype.c
(read_input_list) is a use-case for strchr on filenames, which can't
be expressed by strrchr.
Please be aware that libiberty is shared between different ventures.
I admit that filenames/paths are searched normal from right to left.
But there might be cases a left to right search is suitable.
Regards,
Kai
next prev parent reply other threads:[~2011-03-08 18:51 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 [this message]
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
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='AANLkTincj7k3f1==6MuDC-grHxZcpTHL28CLZ1nXvt2o@mail.gmail.com' \
--to=ktietz70@googlemail.com \
--cc=binutils@sourceware.org \
--cc=eliz@gnu.org \
--cc=gcc-patches@gcc.gnu.org \
--cc=gdb-patches@sourceware.org \
--cc=pedro@codesourcery.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