[PATCH+DOC] Print registers not saved in the frame as "<not saved>", instead of "<optimized out>".
Eli Zaretskii
eliz@gnu.org
Wed Sep 18 19:35:00 GMT 2013
> Date: Wed, 18 Sep 2013 18:35:07 +0100
> From: Pedro Alves <palves@redhat.com>
> CC: aburgess@broadcom.com, gdb-patches@sourceware.org, mark.kettenis@xs4all.nl
>
> > I don't understand the significance of the last paragraph.
>
> It's preexisting actually. I just added the "debug or unwind info" bit.
> But yeah, it's confusing. I _think_ I know what it's talking about.
> I think "makes no difference" refers to GDB assuming $reg in an outer
> frame is found at the same location as in the inner frame (that is,
> assuming the call clobbered register hasn't been clobbered yet).
>
> I've rewritten all this text now. What do you think?
We are almost there, just a few minor comments below.
> > Also, shouldn't we mention optimizations as (the main) reason for
> > registers being unavailable?
>
> I'm not actually sure how to say that. Not sure you actually
> always need optimization to see this in the debugger. But maybe
> we don't need to in this new version. :-)
One of the comments below addresses that.
> +In some ABIs, some registers may not be preserved, or saved, across
> +function calls.
It's enough to mention optimizations here, as in
In some ABIs, or in optimized code, some registers may not be preserved
> +the outer frame, you may also be affecting the inner frame. Values of
> +registers that @value{GDBN} can definitely tell from the debug/unwind
> +info were not saved in their stack frames and there's nowhere to
> +retrieve the original value from anymore are shown as
> +@w{@samp{<not saved>}}.
The last sentence is unduly hard to read, because it uses passive
tense too aggressively. I would rephrase:
If @value{GDBN} can definitely tell from the debug/unwind info that
the value of a register was not saved in its stack frame, and
there's no other place for it from which to retrieve that register's
original value, @value{GDBN} will show the value of such a register
as @w{@samp{<not saved>}}.
OK with those changes.
Thanks.
More information about the Gdb-patches
mailing list