From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22485 invoked by alias); 3 Aug 2007 11:40:42 -0000 Received: (qmail 22472 invoked by uid 22791); 3 Aug 2007 11:40:41 -0000 X-Spam-Check-By: sourceware.org Received: from NaN.false.org (HELO nan.false.org) (208.75.86.248) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 03 Aug 2007 11:40:36 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id 1F77B98123; Fri, 3 Aug 2007 11:40:36 +0000 (GMT) Received: from caradoc.them.org (22.svnf5.xdsl.nauticom.net [209.195.183.55]) by nan.false.org (Postfix) with ESMTP id BFC4198122; Fri, 3 Aug 2007 11:40:35 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.67) (envelope-from ) id 1IGvWD-0004Qo-HS; Fri, 03 Aug 2007 07:40:33 -0400 Date: Fri, 03 Aug 2007 11:40:00 -0000 From: Daniel Jacobowitz To: Michael Snyder Cc: gdb-patches@sourceware.org, Mark Kettenis Subject: Re: [PATCH] symfile.c, find_separate_debug_file Message-ID: <20070803114033.GA16806@caradoc.them.org> Mail-Followup-To: Michael Snyder , gdb-patches@sourceware.org, Mark Kettenis References: <10431.12.7.175.2.1186103684.squirrel@webmail.sonic.net> <200708030554.l735scVD028947@brahms.sibelius.xs4all.nl> <000b01c7d59d$608d4040$677ba8c0@sonic.net> <10431.12.7.175.2.1186103684.squirrel@webmail.sonic.net> <20070803013005.GA22901@caradoc.them.org> <006901c7d587$db360400$677ba8c0@sonic.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <000b01c7d59d$608d4040$677ba8c0@sonic.net> <006901c7d587$db360400$677ba8c0@sonic.net> User-Agent: Mutt/1.5.15 (2007-04-09) 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: 2007-08/txt/msg00033.txt.bz2 On Thu, Aug 02, 2007 at 09:36:27PM -0700, Michael Snyder wrote: > The existing code doesn't use it. If you want me to undertake to > revise the code to use DIR_SEPARATOR, I'll be glad to do it. for (i = strlen(dir) - 1; i >= 0; i--) { if (IS_DIR_SEPARATOR (dir[i])) break; } gdb_assert (i >= 0 && IS_DIR_SEPARATOR (dir[i])); ... if (canon_name && strncmp (canon_name, gdb_sysroot, strlen (gdb_sysroot)) == 0 && IS_DIR_SEPARATOR (canon_name[strlen (gdb_sysroot)])) Adding "/" to strings is fine; it's when looking at passed in strings that you have to check directory separators more carefully. On Fri, Aug 03, 2007 at 12:10:30AM -0700, Michael Snyder wrote: > Well I don't know -- they seemed to hurt when I tried it, > and getting rid of them certainly seemed to help. > > If I type /usr/lib//tmp/foo, isn't that equivalent, at least > in some contexts, to typing /tmp/foo? To my knowledge this is true only in Emacs, not in any normal operating system's file access routines. GDB does not run on top of Emacs... Maybe you could describe how it seemed to hurt. -- Daniel Jacobowitz CodeSourcery