From: Pedro Alves <palves@redhat.com>
To: gdb-patches@sourceware.org
Subject: [pushed] Fix type of not saved registers. (was: Re: [PATCH 2/2] Make "set debug frame 1" output print <not saved> instead of <optimized out>.)
Date: Wed, 27 Nov 2013 18:53:00 -0000 [thread overview]
Message-ID: <52963B43.70207@redhat.com> (raw)
In-Reply-To: <5296365E.3010602@redhat.com>
On 11/27/2013 06:13 PM, Pedro Alves wrote:
> On 11/27/2013 05:52 PM, Pedro Alves wrote:
>> struct value *
>> frame_unwind_got_optimized (struct frame_info *frame, int regnum)
>> {
>> - struct gdbarch *gdbarch = frame_unwind_arch (frame);
>> - struct type *reg_type = register_type (gdbarch, regnum);
>
> Oh, wait. Given multi-arch, the arch of FRAME might be different
> from the prev frame's arch, and therefore the type of register
> REGNUM should be retrieved from the unwound arch.
>
>> + struct value *val;
>>
>> - return allocate_optimized_out_value (reg_type);
>> + val = value_of_register_lazy (frame, regnum);
>
> This is using the type of REGNUM in FRAME. I'll fix this
> in a moment...
Done.
-----------
Fix type of not saved registers.
value_of_register_lazy uses the type of REGNUM in FRAME, but given
multi-arch, the arch of FRAME might be different from the previous
frame's arch, and therefore the type of register REGNUM should be
retrieved from the unwound arch. This used to be correct before the
previous change.
Tested on x86_64 Fedora 17.
gdb/
2013-11-27 Pedro Alves <palves@redhat.com>
* frame-unwind.c (frame_unwind_got_optimized): Use the type of the
register in the previous frame's arch.
---
gdb/ChangeLog | 5 +++++
gdb/frame-unwind.c | 9 ++++++++-
2 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index a2da98f..00369e9 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
2013-11-27 Pedro Alves <palves@redhat.com>
+ * frame-unwind.c (frame_unwind_got_optimized): Use the type of the
+ register in the previous frame's arch.
+
+2013-11-27 Pedro Alves <palves@redhat.com>
+
* frame-unwind.c (frame_unwind_got_optimized): Return
an lval_register value instead of a not_lval value.
diff --git a/gdb/frame-unwind.c b/gdb/frame-unwind.c
index 68879f3..a731b33 100644
--- a/gdb/frame-unwind.c
+++ b/gdb/frame-unwind.c
@@ -161,11 +161,18 @@ default_frame_unwind_stop_reason (struct frame_info *this_frame,
struct value *
frame_unwind_got_optimized (struct frame_info *frame, int regnum)
{
+ struct gdbarch *gdbarch = frame_unwind_arch (frame);
+ struct type *type = register_type (gdbarch, regnum);
struct value *val;
- val = value_of_register_lazy (frame, regnum);
+ /* Return an lval_register value, so that we print it as
+ "<not saved>". */
+ val = allocate_value_lazy (type);
set_value_lazy (val, 0);
set_value_optimized_out (val, 1);
+ VALUE_LVAL (val) = lval_register;
+ VALUE_REGNUM (val) = regnum;
+ VALUE_FRAME_ID (val) = get_frame_id (frame);
return val;
}
next prev parent reply other threads:[~2013-11-27 18:35 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-12 12:15 [RFC 00/12] Merge value optimized_out and unavailable Andrew Burgess
2013-08-12 12:16 ` [PATCH 01/12] Introduce is_unavailable_error Andrew Burgess
2013-08-12 12:18 ` [PATCH 02/12]: Remove set_value_optimized_out Andrew Burgess
2013-08-12 12:20 ` [PATCH 03/12] Mark optimized out values as non-lazy Andrew Burgess
2013-11-26 16:38 ` Pedro Alves
2013-11-26 19:19 ` Andrew Burgess
2013-08-12 12:22 ` [PATCH 04/12] Introduce OPTIMIZED_OUT_ERROR Andrew Burgess
2013-08-12 12:24 ` [PATCH 05/12] Convert the unavailable to be bit based Andrew Burgess
2013-08-12 12:27 ` [PATCH 06/12] Delete value_bits_valid Andrew Burgess
2013-11-25 21:41 ` [PATCH] Print entirely unavailable struct/union values as a single <unavailable>. (Re: [PATCH 06/12] Delete value_bits_valid.) Pedro Alves
2013-11-26 10:13 ` Andrew Burgess
2013-11-28 20:14 ` Pedro Alves
2013-08-12 12:28 ` [PATCH 07/12] Generic print unavailable or optimized out function Andrew Burgess
2013-08-12 12:29 ` [PATCH 08/12] Replace some value_optimized_out with value_entirely_available Andrew Burgess
2013-11-27 17:52 ` [COMMITTED PATCH 0/2] "set debug frame 1" and not saved registers (was: Re: [PATCH 08/12] Replace some value_optimized_out with value_entirely_available) Pedro Alves
2013-11-27 18:14 ` [PATCH 1/2] Make "set debug frame 1" use the standard print routine for optimized out values Pedro Alves
2013-11-27 18:35 ` [PATCH 2/2] Make "set debug frame 1" output print <not saved> instead of <optimized out> Pedro Alves
2013-11-27 18:41 ` Pedro Alves
2013-11-27 18:53 ` Pedro Alves [this message]
2013-08-12 12:30 ` [PATCH 09/12] DWARF value, mark unavailable in bits not bytes Andrew Burgess
2013-08-12 12:31 ` [PATCH 10/12] Merge optimized_out into unavailable vector Andrew Burgess
2013-08-12 12:32 ` [PATCH 11/12] Add test mechanism for value " Andrew Burgess
2013-08-12 12:33 ` [PATCH 12/12] Remove old lval check valid functions Andrew Burgess
2013-08-29 17:21 ` PING: Re: [RFC 00/12] Merge value optimized_out and unavailable Andrew Burgess
2013-11-12 9:37 ` Andrew Burgess
2013-11-29 22:31 ` Pedro Alves
2013-12-04 14:54 ` Andrew Burgess
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=52963B43.70207@redhat.com \
--to=palves@redhat.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox