Fetch lazy value before calling val_print
authorYao Qi <yao.qi@linaro.org>
Fri, 3 Mar 2017 17:16:19 +0000 (17:16 +0000)
committerYao Qi <yao.qi@linaro.org>
Fri, 3 Mar 2017 17:16:19 +0000 (17:16 +0000)
As reported in PR 21165,

(gdb) info locals^M
gv = /home/yao/SourceCode/gnu/gdb/git/gdb/value.c:372: internal-error: int value_bits_any_optimized_out(const value*, int, int): Assertion `!value->lazy' failed.^M
A problem internal to GDB has been detected,^M
further debugging may prove unreliable.^M
Quit this debugging session? (y or n) FAIL: gdb.ada/info_locals_renaming.exp: info locals (GDB internal error)
Resyncing due to internal error.

This internal error is caused by e8b24d9 (Remove parameter valaddr from
la_val_print).  Commit e8b24d9 removes some calls to
value_contents_for_printing, but value_fetch_lazy is not called, so the
internal error above is triggered.  This patch adds value_fetch_lazy
call before val_print.

gdb:

2017-03-03  Yao Qi  <yao.qi@linaro.org>

PR gdb/21165
* ada-valprint.c (ada_val_print_ref): Call value_fetch_lazy if
value is lazy.
* valprint.c (common_val_print): Likewise.

gdb/ChangeLog
gdb/ada-valprint.c
gdb/valprint.c

index b06029154fde508494398efa7f7484956b692f75..368b24c93ef16aa5bfc1c3b98e3f532b7c5c3c95 100644 (file)
@@ -1,3 +1,10 @@
+2017-03-03  Yao Qi  <yao.qi@linaro.org>
+
+       PR gdb/21165
+       * ada-valprint.c (ada_val_print_ref): Call value_fetch_lazy if
+       value is lazy.
+       * valprint.c (common_val_print): Likewise.
+
 2017-02-28  Peter Bergner  <bergner@vnet.ibm.com>
 
        * NEWS: Mention new set/show disassembler-options commands.
index 804cf403f6f486d950850419e43eff05ea141d90..d2489a2b2e8ff63e174c42872d43cb0f7ae06f73 100644 (file)
@@ -1058,6 +1058,9 @@ ada_val_print_ref (struct type *type, const gdb_byte *valaddr,
      (Eg: an array whose bounds are not set yet).  */
   ada_ensure_varsize_limit (value_type (deref_val));
 
+  if (value_lazy (deref_val))
+    value_fetch_lazy (deref_val);
+
   val_print (value_type (deref_val),
             value_embedded_offset (deref_val),
             value_address (deref_val), stream, recurse + 1,
index c3e17ffe6d104a8f99396ec5e47fb97ba7912e16..529f9a5058d1f286f2ed94b6e34d5c0c62ad8ada 100644 (file)
@@ -1201,6 +1201,9 @@ common_val_print (struct value *val, struct ui_file *stream, int recurse,
        get a fixed representation of our value.  */
     val = ada_to_fixed_value (val);
 
+  if (value_lazy (val))
+    value_fetch_lazy (val);
+
   val_print (value_type (val),
             value_embedded_offset (val), value_address (val),
             stream, recurse,
This page took 0.028585 seconds and 4 git commands to generate.