From eddf0baefe616104691f026987c9a74693cc45f2 Mon Sep 17 00:00:00 2001 From: Doug Evans Date: Mon, 24 Feb 2014 14:01:45 -0800 Subject: [PATCH] * value.c (record_latest_value): Fix comment. * printcmd.c (print_command_1): Remove code to handle -1 return from record_latest_value. --- gdb/ChangeLog | 6 ++++++ gdb/printcmd.c | 16 ++++------------ gdb/value.c | 4 +--- 3 files changed, 11 insertions(+), 15 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index b642ac95acf..9f9088d1509 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2014-02-24 Doug Evans + + * value.c (record_latest_value): Fix comment. + * printcmd.c (print_command_1): Remove code to handle -1 return from + record_latest_value. + 2014-02-24 Pedro Alves * procfs.c (procfs_target): Don't install procfs_xfer_memory as diff --git a/gdb/printcmd.c b/gdb/printcmd.c index 10d3c230ee6..e5fea179fa1 100644 --- a/gdb/printcmd.c +++ b/gdb/printcmd.c @@ -985,16 +985,11 @@ print_command_1 (const char *exp, int voidprint) struct value_print_options opts; int histindex = record_latest_value (val); - if (histindex >= 0) - annotate_value_history_begin (histindex, value_type (val)); - else - annotate_value_begin (value_type (val)); + annotate_value_history_begin (histindex, value_type (val)); - if (histindex >= 0) - printf_filtered ("$%d = ", histindex); + printf_filtered ("$%d = ", histindex); - if (histindex >= 0) - annotate_value_history_value (); + annotate_value_history_value (); get_formatted_print_options (&opts, format); opts.raw = fmt.raw; @@ -1002,10 +997,7 @@ print_command_1 (const char *exp, int voidprint) print_formatted (val, fmt.size, &opts, gdb_stdout); printf_filtered ("\n"); - if (histindex >= 0) - annotate_value_history_end (); - else - annotate_value_end (); + annotate_value_history_end (); } do_cleanups (old_chain); diff --git a/gdb/value.c b/gdb/value.c index 73ba18ee138..50b02454364 100644 --- a/gdb/value.c +++ b/gdb/value.c @@ -1642,9 +1642,7 @@ set_value_component_location (struct value *component, /* Access to the value history. */ /* Record a new value in the value history. - Returns the absolute history index of the entry. - Result of -1 indicates the value was not saved; otherwise it is the - value history index of this new item. */ + Returns the absolute history index of the entry. */ int record_latest_value (struct value *val) -- 2.30.2