From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19525 invoked by alias); 18 Oct 2012 09:34:31 -0000 Received: (qmail 19352 invoked by uid 22791); 18 Oct 2012 09:34:30 -0000 X-SWARE-Spam-Status: No, hits=-5.0 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,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, 18 Oct 2012 09:34:26 +0000 Received: from [10.9.200.133] by mms1.broadcom.com with ESMTP (Broadcom SMTP Relay (Email Firewall v6.5)); Thu, 18 Oct 2012 02:33:07 -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, 18 Oct 2012 02:33:39 -0700 Received: from [10.177.72.92] (unknown [10.177.72.92]) by mail-irva-13.broadcom.com (Postfix) with ESMTP id 2D0FB40FE3; Thu, 18 Oct 2012 02:34:12 -0700 (PDT) Message-ID: <507FCD17.30003@broadcom.com> Date: Thu, 18 Oct 2012 09:34:00 -0000 From: "Andrew Burgess" User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:16.0) Gecko/20121010 Thunderbird/16.0.1 MIME-Version: 1.0 To: "Tom Tromey" cc: "gdb-patches@sourceware.org" Subject: Re: [PATCH] Display full file path in MI style disassembly listing References: <506DB4B8.5030001@broadcom.com> <87a9vl3tq2.fsf@fleche.redhat.com> In-Reply-To: <87a9vl3tq2.fsf@fleche.redhat.com> 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/msg00318.txt.bz2 On 17/10/2012 6:15 PM, Tom Tromey wrote: >>>>>> "Andrew" == Andrew Burgess writes: > > Andrew> + char *filename; > > I think this could be const. > > Andrew> + > Andrew> + filename = s->fullname; > Andrew> + if (filename == NULL) > Andrew> + { > Andrew> + filename = symtab_to_fullname (s); > Andrew> + if (filename == NULL) > Andrew> + filename = s->filename; > Andrew> + } > Andrew> + > Andrew> ui_out_field_int (uiout, "line", line); > Andrew> ui_out_text (uiout, "\tin "); > Andrew> - ui_out_field_string (uiout, "file", s->filename); > Andrew> + ui_out_field_string (uiout, "file", filename); > Andrew> ui_out_text (uiout, "\n"); > > It isn't obvious to me that this only applies to the MI case. > Can you explain that? You are correct, and my subject line is miss-leading. It is possible to hit this code from cli gdb, but I believe this only happens if we fail to open the file. - we first test "ui_out_test_flags (uiout, ui_source_list)" which I believe is always true for cli gdb. I couldn't see a way this can be turned off, but maybe I missed something. - we then try to open the file in question. If we're not printing source (mi) or the open failed (mi/cli) then we'll pass through the code I changed. Thanks, Andrew