From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14053 invoked by alias); 22 Oct 2014 15:10:37 -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 14041 invoked by uid 89); 22 Oct 2014 15:10:36 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.7 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_SOFTFAIL autolearn=no version=3.3.2 X-HELO: mtaout23.012.net.il Received: from mtaout23.012.net.il (HELO mtaout23.012.net.il) (80.179.55.175) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 22 Oct 2014 15:10:34 +0000 Received: from conversion-daemon.a-mtaout23.012.net.il by a-mtaout23.012.net.il (HyperSendmail v2007.08) id <0NDU00F00Q2R7N00@a-mtaout23.012.net.il> for gdb-patches@sourceware.org; Wed, 22 Oct 2014 18:10:31 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout23.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NDU00FBFQ5J2H90@a-mtaout23.012.net.il>; Wed, 22 Oct 2014 18:10:31 +0300 (IDT) Date: Wed, 22 Oct 2014 15:10:00 -0000 From: Eli Zaretskii Subject: Re: [PATCH] Python API: Add gdb.is_in_prologue and gdb.is_in_epilogue. In-reply-to: <1413986485-4673-1-git-send-email-martin.galvan@tallertechnologies.com> To: Martin Galvan Cc: gdb-patches@sourceware.org, martin.galvan@tallertechnologies.com Reply-to: Eli Zaretskii Message-id: <83tx2w87j0.fsf@gnu.org> References: <1413986485-4673-1-git-send-email-martin.galvan@tallertechnologies.com> X-IsSubscribed: yes X-SW-Source: 2014-10/txt/msg00577.txt.bz2 > From: Martin Galvan > Cc: Martin Galvan > Date: Wed, 22 Oct 2014 11:01:25 -0300 > > Added two new functions to the Python API: gdb.is_in_prologue and gdb.is_in_epilogue. Thanks. > * NEWS: Mention new Python functions. This part is OK. > +@findex gdb.is_in_prologue > +@defun gdb.is_in_prologue (pc, @r{[}functionStart@r{]}) > +Returns @code{True} if the given @var{pc} value *might* correspond to Please use Texinfo markup for emphasis, not ASCII art. I think you want @emph{might} here. > +The optional @var{functionStart} argument is the start address of the > +function you want to check if @var{pc} belongs to. If your binary ^^ "whether" > +doesn't have debugging info, @value{GDBN} may need to use this value > +to guess if @var{pc} belongs to the prologue. If omitted it defaults ^^ Likewise. > +In general you shouldn't worry about passing a @var{functionStart} > +argument unless your binary doesn't have debugging info, in which case > +ommiting @var{functionStart} may result in @code{True} being returned > +when the @var{pc} is not actually inside a prologue. Isn't it better to require this argument in that case? Zero is not very useful starting address, in most cases. > +When stepping by machine instructions it's possible that local variables > +appear to have wrong values at the end of a function. This happens > +because it usually takes more than one instruction to tear down a stack > +frame; such instructions are part of a function's epilogue. @value{GDBN} > +can identify the addresses where the local variables may show wrong > +values and inform you so. This repeats almost verbatim what has been already said about the prologue. It would be better to make a single description that covers both the prologue and the epilogue, before you describe the 2 methods. OK with those changes.