This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Python API: Add gdb.is_in_prologue and gdb.is_in_epilogue.
- From: Eli Zaretskii <eliz at gnu dot org>
- To: Martin Galvan <martin dot galvan at tallertechnologies dot com>
- Cc: gdb-patches at sourceware dot org, martin dot galvan at tallertechnologies dot com
- Date: Wed, 22 Oct 2014 18:10:27 +0300
- Subject: Re: [PATCH] Python API: Add gdb.is_in_prologue and gdb.is_in_epilogue.
- Authentication-results: sourceware.org; auth=none
- References: <1413986485-4673-1-git-send-email-martin dot galvan at tallertechnologies dot com>
- Reply-to: Eli Zaretskii <eliz at gnu dot org>
> From: Martin Galvan <martin.galvan@tallertechnologies.com>
> Cc: Martin Galvan <martin.galvan@tallertechnologies.com>
> 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.