Make "set debug frame 1" use the standard print routine for optimized out values.
authorAndrew Burgess <aburgess@broadcom.com>
Wed, 27 Nov 2013 17:49:59 +0000 (17:49 +0000)
committerPedro Alves <palves@redhat.com>
Wed, 27 Nov 2013 17:49:59 +0000 (17:49 +0000)
 ...
 - { frame_unwind_register_value (frame=0,regnum=7(rsp),...) -> optimized out }
 + { frame_unwind_register_value (frame=0,regnum=7(rsp),...) -> <optimized out> }
 ...

Tested on x86_64 Fedora 17.

2013-11-27  Andrew Burgess  <aburgess@broadcom.com>

* frame.c: Include "valprint.h".
(frame_unwind_register_value): Use value_optimized_out.
* value.c (value_fetch_lazy): Likewise.

gdb/ChangeLog
gdb/frame.c
gdb/value.c

index c144565da2e3279d792182f9fec9043c98e6c0e9..727babab768c840d4b2f78834d3d7505127f362a 100644 (file)
@@ -1,3 +1,9 @@
+2013-11-27  Andrew Burgess  <aburgess@broadcom.com>
+
+       * frame.c: Include "valprint.h".
+       (frame_unwind_register_value): Use value_optimized_out.
+       * value.c (value_fetch_lazy): Likewise.
+
 2013-11-26  Andrew Burgess  <aburgess@broadcom.com>
 
        * value.c (allocate_optimized_out_value): Mark value as non-lazy.
index f77ce75a0985dc52015829a5c9b0f5a37b10f54c..4e6e06cbaac8fded803ae553bc44dd2e838ec902 100644 (file)
@@ -44,6 +44,7 @@
 #include "inline-frame.h"
 #include "tracepoint.h"
 #include "hashtab.h"
+#include "valprint.h"
 
 static struct frame_info *get_prev_frame_1 (struct frame_info *this_frame);
 static struct frame_info *get_prev_frame_raw (struct frame_info *this_frame);
@@ -1047,7 +1048,10 @@ frame_unwind_register_value (struct frame_info *frame, int regnum)
     {
       fprintf_unfiltered (gdb_stdlog, "->");
       if (value_optimized_out (value))
-       fprintf_unfiltered (gdb_stdlog, " optimized out");
+       {
+         fprintf_unfiltered (gdb_stdlog, " ");
+         val_print_optimized_out (value, gdb_stdlog);
+       }
       else
        {
          if (VALUE_LVAL (value) == lval_register)
index 8052f52f874689aa07a6a54fb94a51bfc9f856c0..a64e7e117ee64b83905146a0a4250b6650ad549d 100644 (file)
@@ -3572,7 +3572,10 @@ value_fetch_lazy (struct value *val)
 
          fprintf_unfiltered (gdb_stdlog, "->");
          if (value_optimized_out (new_val))
-           fprintf_unfiltered (gdb_stdlog, " optimized out");
+           {
+             fprintf_unfiltered (gdb_stdlog, " ");
+             val_print_optimized_out (new_val, gdb_stdlog);
+           }
          else
            {
              int i;