From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9715 invoked by alias); 8 Mar 2011 18:50:14 -0000 Received: (qmail 9647 invoked by uid 22791); 8 Mar 2011 18:50:13 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 08 Mar 2011 18:50:09 +0000 Received: (qmail 3867 invoked from network); 8 Mar 2011 18:50:07 -0000 Received: from unknown (HELO scottsdale.localnet) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 8 Mar 2011 18:50:07 -0000 From: Pedro Alves To: Eli Zaretskii Subject: Re: [patch libiberty include]: Add additional helper functions for directory-separator searching Date: Tue, 08 Mar 2011 18:54:00 -0000 User-Agent: KMail/1.13.5 (Linux/2.6.35-27-generic; KDE/4.6.1; x86_64; ; ) Cc: gdb-patches@sourceware.org, ktietz70@googlemail.com, gcc-patches@gcc.gnu.org, binutils@sourceware.org References: <201103081333.03177.pedro@codesourcery.com> <838vwph30i.fsf@gnu.org> In-Reply-To: <838vwph30i.fsf@gnu.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201103081850.05721.pedro@codesourcery.com> 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/msg00558.txt.bz2 On Tuesday 08 March 2011 18:37:49, Eli Zaretskii wrote: > > > 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. The point of the code, according to its comment, is to workaround an issue with the debug info output by the native Irix compiler. You wouldn't want a cross-Irix, Windows-hosted gdb looking for '\' or a drive prefix in order to decide whether to apply the workaround. In other words, we _always_ want to check for literal '/' here: if (*comp_dir != NULL) { /* Irix 6.2 native cc prepends .: to the compilation directory, get rid of it. */ char *cp = strchr (*comp_dir, ':'); if (cp && cp != *comp_dir && cp[-1] == '.' && cp[1] == '/') *comp_dir = cp + 1; } -- Pedro Alves