From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4349 invoked by alias); 21 May 2018 16:32:40 -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 4311 invoked by uid 89); 21 May 2018 16:32:38 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-6.9 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_1,SPF_PASS autolearn=ham version=3.3.2 spammy=contrast, talk X-HELO: eggs.gnu.org Received: from eggs.gnu.org (HELO eggs.gnu.org) (208.118.235.92) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 21 May 2018 16:32:36 +0000 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fKnja-0008K5-8u for gdb-patches@sourceware.org; Mon, 21 May 2018 12:32:35 -0400 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:55457) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fKnja-0008Jy-5W; Mon, 21 May 2018 12:32:30 -0400 Received: from [176.228.60.248] (port=3000 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1fKnjZ-0007UB-KC; Mon, 21 May 2018 12:32:30 -0400 Date: Mon, 21 May 2018 17:46:00 -0000 Message-Id: <83y3gddl5q.fsf@gnu.org> From: Eli Zaretskii To: Andrew Burgess CC: gdb-patches@sourceware.org In-reply-to: <20180521115357.GS3797@embecosm.com> (message from Andrew Burgess on Mon, 21 May 2018 12:53:57 +0100) Subject: Re: [PATCHv2 2/2] gdb: Change how frames are selected for 'frame' and 'info frame'. Reply-to: Eli Zaretskii References: <63020671a997f926cd747677cd4e614e51e81f8d.1525797846.git.andrew.burgess@embecosm.com> <83k1sanw3t.fsf@gnu.org> <20180521115357.GS3797@embecosm.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-IsSubscribed: yes X-SW-Source: 2018-05/txt/msg00496.txt.bz2 > Date: Mon, 21 May 2018 12:53:57 +0100 > From: Andrew Burgess > Cc: gdb-patches@sourceware.org > > I don't really understand what it is you're asking here, but I think > it might be related to overloading of the word "frame", and possibly > the keyword "create" not being a good choice. > > Sure, within the inferior there are a set of frames, some of these > form the current stack, and some might exist on some alternative > stack. Those frames exist regardless of GDB's ability to visualise > them. > > However, there's a second use of the word frame, which we use for > GDB's representation of a stack-frame. Under this second meaning the > only frames that exist are those GDB can derive from the current > machine state. So, if the user asks for a backtrace and is told about > #0 A, #1 B, #2 C, then GDB only knows about those 3 frames. > > If the user knows of #3 D that called C (but the unwind failed for > some reason) then they can use: 'frame create STACK-ADDR PC-ADDR' to > "create" a suitable frame and examine the machine state. The frame > being "created" here is really a GDB frame, that is, a representation > of a preexisting inferior frame. The old text was this: > > > -@item frame @var{stack-addr} [ @var{pc-addr} ] > > > -@itemx f @var{stack-addr} [ @var{pc-addr} ] > > > -Select the frame at address @var{stack-addr}. This is useful mainly if the > > > -chaining of stack frames has been damaged by a bug, making it > > > -impossible for @value{GDBN} to assign numbers properly to all frames. In > > > -addition, this can be useful when your program has multiple stacks and > > > -switches between them. The optional @var{pc-addr} can also be given to > > > -specify the value of PC for the stack frame. This seems to imply that if the frame #3 D existed, but the unwind failed to find it, the user could say "frame STACK-ADDR PC-ADDR" to refer to that frame. By contrast, your new text: > > > +@kindex frame create > > > +@item create @var{stack-address} @r{[} @var{pc-addr} @r{]} > > > +Create and then select a new frame at stack address @var{stack-addr}. > > > +This is useful mainly if the chaining of stack frames has been damaged > > > +by a bug, making it impossible for @value{GDBN} to assign numbers > > > +properly to all frames. In addition, this can be useful when your > > > +program has multiple stacks and switches between them. The optional > > > +@var{pc-addr} can also be given to specify the value of PC for the > > > +stack frame. forces the use of "create", which is confusing, since the frame does exist on the stack, albeit unbeknownst to GDB. IOW, I always thought of stack frames as existing or not independently of whether the GDB unwinder succeeded to find them, so it's strange for me to talk about "creating" a frame in this use case. For that matter, I don't understand why we need to force the user to type "create" explicitly. > Anyway, I'm happy to rework the text if you can suggest some > improvements. Alternatively, maybe it was my choice of "create" as > the keyword that was confusing... again, if you have any better > suggestions I'm happy to change it, I'm not tied to "create". Why do we need an extra keyword, again? If we do need a keyword, how about "frame add"?