This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH+DOC] Print registers not saved in the frame as "<not saved>", instead of "<optimized out>".


> Date: Wed, 18 Sep 2013 16:54:27 +0100
> From: Pedro Alves <palves@redhat.com>
> CC: gdb-patches@sourceware.org, Mark Kettenis <mark.kettenis@xs4all.nl>
> 
> Eli, I've added NEWS and documentation changes to this patch.
> Are those OK?

Almost.

> +* GDB now shows "<not saved>" when printing values of registers that
> +  have not been saved in the frame:
> +
> +    (gdb) p $rax $1 = <not saved>
> +    (gdb) info registers rax rax <not saved>

Wrong formatting of what GDB prints.

> +In some ABIs, some registers may not be preserved, or saved, across
> +function calls.  It may therefore not be possible for @value{GDBN} to
> +know the value a register had before the call (in other words, in a
                                                                     ^
"the"

> +outer frame).  Values of registers that @value{GDBN} can tell were not
> +saved in their stack frames are shown as @w{@samp{<not saved>}}.
> +
> +However, if debug or unwind information is missing, @value{GDBN} must
> +deduce where registers are saved, from the machine code generated by
> +your compiler.  If some registers are not saved, or if @value{GDBN} is
> +unable to locate the saved registers, the selected stack frame makes
> +no difference.

I don't understand the significance of the last paragraph.

Also, shouldn't we mention optimizations as (the main) reason for
registers being unavailable?

Thanks.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]