From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28443 invoked by alias); 8 Mar 2011 13:37:25 -0000 Received: (qmail 28337 invoked by uid 22791); 8 Mar 2011 13:37:24 -0000 X-SWARE-Spam-Status: No, hits=-1.1 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST X-Spam-Check-By: sourceware.org Received: from mail-qw0-f41.google.com (HELO mail-qw0-f41.google.com) (209.85.216.41) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 08 Mar 2011 13:37:16 +0000 Received: by qwd7 with SMTP id 7so5052503qwd.0 for ; Tue, 08 Mar 2011 05:37:14 -0800 (PST) MIME-Version: 1.0 Received: by 10.224.136.9 with SMTP id p9mr4336685qat.187.1299591434276; Tue, 08 Mar 2011 05:37:14 -0800 (PST) Received: by 10.229.89.197 with HTTP; Tue, 8 Mar 2011 05:37:14 -0800 (PST) In-Reply-To: <201103081333.03177.pedro@codesourcery.com> References: <201103081243.34340.pedro@codesourcery.com> <201103081333.03177.pedro@codesourcery.com> Date: Tue, 08 Mar 2011 14:45:00 -0000 Message-ID: Subject: Re: [patch libiberty include]: Add additional helper functions for directory-separator searching From: Kai Tietz To: Pedro Alves Cc: gdb-patches@sourceware.org, gcc-patches@gcc.gnu.org, Eli Zaretskii , binutils@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2011-03/txt/msg00535.txt.bz2 2011/3/8 Pedro Alves : > On Tuesday 08 March 2011 12:48:11, Kai Tietz wrote: > >> Well, a better example is elfstab_offset_sections() in elfread.c. > > =A0/* The ELF symbol info doesn't include path names, so strip the path > =A0 =A0 (if any) from the psymtab filename. =A0*/ > =A0while (0 !=3D (p =3D strchr (filename, '/'))) > =A0 =A0filename =3D p + 1; > > Looks like its looking for the last path separator, so > it might as well use filename_dirrchr instead. True, see patch I've posted about filename_cmp. I replaced it there by a strrchr search. >> Another is in find_file_and_directory() in dwarf2read.c file. > > Workaround for Irix. =A0Certainly that '/' should not depend > on the host gdb is running on. Right. But well, I was asked if strchr is used in combination with paths. And so I've shown. If those uses could be rewritten is a different story and might be true. Kai