From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 78372 invoked by alias); 10 Aug 2018 10:30:53 -0000 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 Received: (qmail 78180 invoked by uid 89); 10 Aug 2018 10:30:41 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.3 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=Cell, accommodate X-HELO: mx1.redhat.com Received: from mx3-rdu2.redhat.com (HELO mx1.redhat.com) (66.187.233.73) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 10 Aug 2018 10:30:40 +0000 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 72E8040216F4; Fri, 10 Aug 2018 10:30:38 +0000 (UTC) Received: from [127.0.0.1] (ovpn04.gateway.prod.ext.ams2.redhat.com [10.39.146.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id F0A6F2026D65; Fri, 10 Aug 2018 10:30:37 +0000 (UTC) Subject: Re: [RFC] mi: Print frame architecture when printing frames on an MI channel To: Jan Vrany , gdb-patches@sourceware.org References: <20180810055511.26257-1-jan.vrany@fit.cvut.cz> From: Pedro Alves Message-ID: <27ddbc19-e970-a08b-d684-870dd11846b0@redhat.com> Date: Fri, 10 Aug 2018 10:30:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <20180810055511.26257-1-jan.vrany@fit.cvut.cz> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2018-08/txt/msg00267.txt.bz2 Hi Jan, On 08/10/2018 06:55 AM, Jan Vrany wrote: > When printing frames on an MI channel also print frame architecture > like in: > > (gdb) > -stack-list-frames 3 3 > ^done,stack= > [frame={level="3",addr="0x000107a4",func="foo", > file="recursive2.c",fullname="/home/foo/bar/recursive2.c", > line="14",arch="i386:x86_64"}] > (gdb) > > This is usefull for MI clients that need to know the architecture in order Typo: "useful" > to perform further analysis, for example to use their own disassembler to > analyze mechinbe code. Typo: "machine" Sounds like a good idea. Could be useful too for multi-arch debugging (like mixed SPU and Power frames on Cell). This needs a NEWS entry. > > gdb/Changelog: > > * stack.c (print_frame): print frame architecture when printing on > an MI output. Uppercase "Print". > > gdb/testsuite/Changelog > > * lib/mi-support.exp (mi_expect_stop): Regexp updated tp aaccomodate Typo: "accommodate" > new "arch" field in frame output. > * gdb.mi/mi-return.exp: Likewise. > * gdb.mi/mi-stack.exp: Likewise. > * gdb.mi/mi-syn-frame.exp: Likewise. > * gdb.mi/user-selected-context-sync.exp: Likewise. > > gdb/doc/Changelog > > * gdb.texinfo (The -stack-list-frames Command): Updated description > to mention "arch". > Updated MI examples thorough the document to contain "arch" in frame > output. (Nit: avoid past tense, "Updated" -> "Update" throughout.) > diff --git a/gdb/testsuite/gdb.mi/user-selected-context-sync.exp b/gdb/testsuite/gdb.mi/user-selected-context-sync.exp > index 05624deb0a..df3ee42af3 100644 > --- a/gdb/testsuite/gdb.mi/user-selected-context-sync.exp > +++ b/gdb/testsuite/gdb.mi/user-selected-context-sync.exp > @@ -156,11 +156,11 @@ proc make_mi_re { mode thread frame type } { > set thread_event_re "=thread-selected,id=\"$thread\"" > set thread_answer_re "\\^done,new-thread-id=\"$thread\"" > > - set frame_re(0) ",frame=\{level=\"0\",addr=\"$hex\",func=\"child_sub_function\",args=\\\[\\\],file=\"${any}${srcfile}\",fullname=\"${any}${srcfile}\",line=\"$thread_loop_line\"\}" > - set frame_re(1) ",frame=\{level=\"1\",addr=\"$hex\",func=\"child_function\",args=\\\[\{name=\"args\",value=\"0x0\"\}\\\],file=\"${any}${srcfile}\",fullname=\"${any}${srcfile}\",line=\"$thread_caller_line\"\}" > + set frame_re(0) ",frame=\{level=\"0\",addr=\"$hex\",func=\"child_sub_function\",args=\\\[\\\],file=\"${any}${srcfile}\",fullname=\"${any}${srcfile}\",line=\"$thread_loop_line\",arch=\".*\"\}" > + set frame_re(1) ",frame=\{level=\"1\",addr=\"$hex\",func=\"child_function\",args=\\\[\{name=\"args\",value=\"0x0\"\}\\\],file=\"${any}${srcfile}\",fullname=\"${any}${srcfile}\",line=\"$thread_caller_line\",arch=\".*\"\}" I'd rather use a stricter \[^\r\n\]+ or better \[^"\]+ instead of ".*" throughout, in case ".*" ends up too greedy and manages to consume further attributes, like a bug that results in: ....arch="foo", arch="foo"} or a bug/regression that causes arch to come out empty, like: ....arch=""} or if .* makes a test manage to consume one frame too many, or other things like that. (In this file, notice the "$any" variable.) Thanks, Pedro Alves