From 1ed8d8006b916d7cda234df9660252545051c6fe Mon Sep 17 00:00:00 2001 From: Yao Qi Date: Fri, 9 Aug 2013 00:35:40 +0000 Subject: [PATCH] gdb/ * stack.c (read_frame_arg): Set 'entryval_error' to NULL if 'entryval' is set. gdb/testsuite/ * gdb.trace/collection.exp (gdb_collect_args_test): Set "only" and "both" to 'print entry-values' before selecting trace frame. --- gdb/ChangeLog | 5 +++++ gdb/stack.c | 5 ++++- gdb/testsuite/ChangeLog | 6 ++++++ gdb/testsuite/gdb.trace/collection.exp | 16 ++++++++++++++++ 4 files changed, 31 insertions(+), 1 deletion(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 13a9ccdaba..e6e13ae9e1 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2013-08-09 Yao Qi + + * stack.c (read_frame_arg): Set 'entryval_error' to NULL if + 'entryval' is set. + 2013-08-08 Azat Khuzhin (tiny change) * gcore.c (create_gcore_bfd): Use tilde_expand. diff --git a/gdb/stack.c b/gdb/stack.c index 7d97dc8328..86932f8e7b 100644 --- a/gdb/stack.c +++ b/gdb/stack.c @@ -469,7 +469,10 @@ read_frame_arg (struct symbol *sym, struct frame_info *frame, || print_entry_values == print_entry_values_both || (print_entry_values == print_entry_values_preferred && (!val || value_optimized_out (val)))) - entryval = allocate_optimized_out_value (SYMBOL_TYPE (sym)); + { + entryval = allocate_optimized_out_value (SYMBOL_TYPE (sym)); + entryval_error = NULL; + } } if ((print_entry_values == print_entry_values_compact || print_entry_values == print_entry_values_if_needed diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 5fb44e755d..0b681f45cd 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2013-08-09 Yao Qi + + * gdb.trace/collection.exp (gdb_collect_args_test): Set + "only" and "both" to 'print entry-values' before selecting + trace frame. + 2013-08-08 Yao Qi * gdb.trace/mi-trace-unavailable.exp: Don't set diff --git a/gdb/testsuite/gdb.trace/collection.exp b/gdb/testsuite/gdb.trace/collection.exp index f6d44ced7e..ba0ada59ba 100644 --- a/gdb/testsuite/gdb.trace/collection.exp +++ b/gdb/testsuite/gdb.trace/collection.exp @@ -128,6 +128,22 @@ proc gdb_collect_args_test { myargs msg } { # Begin the test. run_trace_experiment $msg args_test_func + # Frame arguments and their entry values are displayed correctly with + # various values of "print entry-values" when a trace frame is + # selected. + + gdb_test "tfind -1" ".*" "" + gdb_test_no_output "set print entry-values only" "" + gdb_test "tfind 0" \ + " \\(argc@entry=\[^,\]*, argi@entry=\[^,\]*, argf@entry=\[^,\]*, argd@entry=\[^,\]*, argstruct@entry=\[^,\]*, argarray@entry=\[^,\]*\\) .*" \ + "collect $msg: tfind 0 with entry-values only" + + gdb_test "tfind -1" ".*" "" + gdb_test_no_output "set print entry-values both" "" + gdb_test "tfind 0" \ + " \\(argc=\[^,\]*, argc@entry=\[^,\]*, argi=\[^,\]*, argi@entry=\[^,\]*, argf=\[^,\]*, argf@entry=\[^,\]*, argd=\[^,\]*, argd@entry=\[^,\]*, argstruct=\[^,\]*, argstruct@entry=\[^,\]*, argarray=\[^,\]*, argarray@entry=\[^,\]*\\) .*" \ + "collect $msg: tfind 0 with entry-values both" + gdb_test "print argc" \ "\\$\[0-9\]+ = 1 '.001'$cr" \ "collect $msg: collected arg char" -- 2.34.1