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] Consistent display of "<optimized out>"


> Date: Tue, 6 Aug 2013 14:08:46 +0100
> From: "Andrew Burgess" <aburgess@broadcom.com>
> 
> In some cases we report optimized out registers as "*value not available*"
> rather than "<optimized out>", the patch below makes this more consistent
> in the case I've spotted.
> 
> Here's an example:
> 
> (gdb) up
> #1  0x0000000000400800 in first_frame () at dw2-reg-undefined.c:27
> 27      in dw2-reg-undefined.c
> (gdb) info registers rax
> rax            *value not available*
> (gdb) p/x $rax
> $1 = <optimized out>
> 
> After the patch the behaviour is now:
> 
> (gdb) up
> #1  0x0000000000400800 in first_frame () at dw2-reg-undefined.c:27
> 27      in dw2-reg-undefined.c
> (gdb) info registers rax
> rax            <optimized out>
> (gdb) p/x $rax
> $1 = <optimized out>
> 
> The behaviour for values that are unavailable is currently unchanged,
> though I have a follow up patch for this too.
> 
> OK to apply?

I'd say no.  There is a difference between "unavailable" and
"optimized out".  Registers will be unavailable even if you compile
without any optimization, because the ABI specifies that their
contents are not saved across function calls.  So "optimized out"
makes very little sense for registers.


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