aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2021-04-15 10:14:11 -0600
committerTom Tromey <tromey@adacore.com>2021-04-15 10:14:11 -0600
commit644a2e75ace6b5e76f91d38c28c3b97fcfdeeaa5 (patch)
tree8dfae99c64bfcfb054974869ed1df8deeceb96b8
parent9e5e03df52968b416e09a59482409abfed9727c0 (diff)
downloadgdb-644a2e75ace6b5e76f91d38c28c3b97fcfdeeaa5.zip
gdb-644a2e75ace6b5e76f91d38c28c3b97fcfdeeaa5.tar.gz
gdb-644a2e75ace6b5e76f91d38c28c3b97fcfdeeaa5.tar.bz2
Use common_val_print_checked in print_variable_and_value
GDB was crashing in "bt full" for a large Ada program. I tracked this down to a combination of bugs. The first bug, fixed here, is that print_variable_and_value calls common_val_print. Normally only the value-printing implementation should call this; from the top level, common_val_print_checked is preferred, because it correctly handles values that are wholly optimized out. I wasn't able to write a test case for this. gdb/ChangeLog 2021-04-15 Tom Tromey <tromey@adacore.com> * printcmd.c (print_variable_and_value): Use common_val_print_checked.
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/printcmd.c2
2 files changed, 6 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 22a79c2..54a035c 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
2021-04-15 Tom Tromey <tromey@adacore.com>
+ * printcmd.c (print_variable_and_value): Use
+ common_val_print_checked.
+
+2021-04-15 Tom Tromey <tromey@adacore.com>
+
* rust-exp.y (rust_parser::convert_ast_to_expression): Update.
* parse.c (parser_state::push_symbol, parser_state::push_dollar):
Update.
diff --git a/gdb/printcmd.c b/gdb/printcmd.c
index c82f709..a4f62f2 100644
--- a/gdb/printcmd.c
+++ b/gdb/printcmd.c
@@ -2387,7 +2387,7 @@ print_variable_and_value (const char *name, struct symbol *var,
val = read_var_value (var, NULL, frame);
get_user_print_options (&opts);
opts.deref_ref = 1;
- common_val_print (val, stream, indent, &opts, current_language);
+ common_val_print_checked (val, stream, indent, &opts, current_language);
/* common_val_print invalidates FRAME when a pretty printer calls inferior
function. */