From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29336 invoked by alias); 4 Oct 2012 16:09:44 -0000 Received: (qmail 29084 invoked by uid 22791); 4 Oct 2012 16:09:42 -0000 X-SWARE-Spam-Status: No, hits=-4.9 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_SPAMHAUS_DROP,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mms1.broadcom.com (HELO mms1.broadcom.com) (216.31.210.17) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 04 Oct 2012 16:09:38 +0000 Received: from [10.9.200.133] by mms1.broadcom.com with ESMTP (Broadcom SMTP Relay (Email Firewall v6.5)); Thu, 04 Oct 2012 09:08:27 -0700 X-Server-Uuid: 06151B78-6688-425E-9DE2-57CB27892261 Received: from mail-irva-13.broadcom.com (10.11.16.103) by IRVEXCHHUB02.corp.ad.broadcom.com (10.9.200.133) with Microsoft SMTP Server id 8.2.247.2; Thu, 4 Oct 2012 09:08:55 -0700 Received: from [10.177.73.83] (unknown [10.177.73.83]) by mail-irva-13.broadcom.com (Postfix) with ESMTP id 23FA340FE4 for ; Thu, 4 Oct 2012 09:09:28 -0700 (PDT) Message-ID: <506DB4B8.5030001@broadcom.com> Date: Thu, 04 Oct 2012 16:09:00 -0000 From: "Andrew Burgess" User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:15.0) Gecko/20120907 Thunderbird/15.0.1 MIME-Version: 1.0 To: "gdb-patches@sourceware.org" Subject: [PATCH] Display full file path in MI style disassembly listing Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 7bit 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: 2012-10/txt/msg00083.txt.bz2 When producing an MI style disassembly listing we use the shorted symtab filename, rather than computing the fullname. This can make it harder for an MI consumer to figure out which file to open. The patch below tries to use the fullname when it can, and falls back to the shorter name if it can't figure out the full name. Ok to apply? Thanks, Andrew gdb/ChangeLog 2012-10-04 Andrew Burhess * source.c (print_source_lines_base): Display full file name when producing MI style disassembly listings. diff --git a/gdb/source.c b/gdb/source.c index 31e104f..2a02382 100644 --- a/gdb/source.c +++ b/gdb/source.c @@ -1298,9 +1298,19 @@ print_source_lines_base (struct symtab *s, int line, int stopline, int noerror) } else { + char *filename; + + filename = s->fullname; + if (filename == NULL) + { + filename = symtab_to_fullname (s); + if (filename == NULL) + filename = s->filename; + } + ui_out_field_int (uiout, "line", line); ui_out_text (uiout, "\tin "); - ui_out_field_string (uiout, "file", s->filename); + ui_out_field_string (uiout, "file", filename); ui_out_text (uiout, "\n"); }