From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20167 invoked by alias); 5 Mar 2004 23:02:35 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 20160 invoked from network); 5 Mar 2004 23:02:34 -0000 Received: from unknown (HELO mail-out4.apple.com) (17.254.13.23) by sources.redhat.com with SMTP; 5 Mar 2004 23:02:34 -0000 Received: from mailgate1.apple.com (a17-128-100-225.apple.com [17.128.100.225]) by mail-out4.apple.com (8.12.11/8.12.11) with ESMTP id i25N4A7k021033 for ; Fri, 5 Mar 2004 15:04:10 -0800 (PST) Received: from relay2.apple.com (relay2.apple.com) by mailgate1.apple.com (Content Technologies SMTPRS 4.3.6) with ESMTP id ; Fri, 5 Mar 2004 15:02:33 -0800 Received: from [17.201.22.21] (moleja.apple.com [17.201.22.21]) by relay2.apple.com (8.12.11/8.12.11) with ESMTP id i25N2FOR009078; Fri, 5 Mar 2004 23:02:16 GMT In-Reply-To: <16456.65451.461753.66554@localhost.redhat.com> References: <20040225040059.GB19094@white> <16456.65451.461753.66554@localhost.redhat.com> Mime-Version: 1.0 (Apple Message framework v609) Content-Type: text/plain; charset=US-ASCII; format=flowed Message-ID: <0040317C-6EF9-11D8-AAF6-000393D457E2@apple.com> Content-Transfer-Encoding: 7bit Cc: gdb-patches@sources.redhat.com, Bob Rossi From: Jason Molenda Subject: Re: -file-list-exec-source-files Date: Fri, 05 Mar 2004 23:02:00 -0000 To: Elena Zannoni X-SW-Source: 2004-03.o/txt/msg00117.txt Message-ID: <20040305230200.BH2zwtRXD9mPIqknk0mitBumiSluNBzXMWgzk8-99Jo@z> Hi Elena, On Mar 5, 2004, at 2:31 PM, Elena Zannoni wrote: >> @@ -1254,6 +1255,8 @@ >> objfile->global_psymbols.next, >> objfile->static_psymbols.next); >> >> + pst->dirname = xstrdup ( comp_unit_die.dirname ); >> + >> pst->read_symtab_private = (char *) >> obstack_alloc (&objfile->objfile_obstack, sizeof (struct >> dwarf2_pinfo)); >> DWARF_INFO_BUFFER (pst) = dwarf_info_buffer; >> @@ -4326,6 +4329,10 @@ >> /* Prefer DW_AT_MIPS_linkage_name over DW_AT_name. */ >> if (part_die->name == NULL) >> part_die->name = DW_STRING (&attr); >> + break; >> + case DW_AT_comp_dir: >> + if (part_die->dirname == NULL) >> + part_die->dirname = DW_STRING (&attr); > > The dwarf2 specs say that the name is in the form ":pathname" or > "hostname:pathname". Should we worry about the hostname? Does gcc emit > that? I have looked at a few executables and didn't see the hostname > part. Oh that the DWARF spec were this cut-and-dried. :-) DWARF3 draft 8 says A DW_AT_comp_dir attribute whose value is a null-terminated string containing the current working directory of the compilation command that produced this compilation unit in whatever form makes sense for the host system. The suggested form for the value of DW_AT_comp_dir attribute on UNIX systems is "hostname:pathname". If no hostname is available, the suggested form is ":pathname". gcc puts the output of getpwd() into DW_AT_comp_dir. Obviously the spec allows this. I suppose a consumer must be prepared to handle any one of /path/to/file :/path/to/file hostname:/path/to/file C:/path/to/file hostname:C:/path/to/file And I wonder what should be done if one of the directory names contains a ":". /path/to:haha/file is clearly ambiguous -- a producer could disambiguate by always prepending a ":", but the consumer has no way of knowing what it might be receiving. Quite a sticky wicket. J