* [PATCH] value.c (record_latest_value): Fix comment.
@ 2014-02-21 1:22 Doug Evans
2014-02-21 1:28 ` Doug Evans
0 siblings, 1 reply; 3+ messages in thread
From: Doug Evans @ 2014-02-21 1:22 UTC (permalink / raw)
To: gdb-patches; +Cc: ludo, eliz
Hi.
This patch fixes a comment that was found to be wrong in this thread:
https://sourceware.org/ml/gdb-patches/2014-02/msg00674.html
I checked as far back as 6.1.1, and it's never returned -1.
[I could go back further, but I don't see the point.]
2014-02-20 Doug Evans <dje@google.com>
* value.c (record_latest_value): Fix comment.
diff --git a/gdb/value.c b/gdb/value.c
index 73ba18e..50b0245 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)
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] value.c (record_latest_value): Fix comment.
2014-02-21 1:22 [PATCH] value.c (record_latest_value): Fix comment Doug Evans
@ 2014-02-21 1:28 ` Doug Evans
2014-02-24 22:02 ` Doug Evans
0 siblings, 1 reply; 3+ messages in thread
From: Doug Evans @ 2014-02-21 1:28 UTC (permalink / raw)
To: gdb-patches; +Cc: ludo, eliz
Doug Evans writes:
> Hi.
>
> This patch fixes a comment that was found to be wrong in this thread:
>
> https://sourceware.org/ml/gdb-patches/2014-02/msg00674.html
>
> I checked as far back as 6.1.1, and it's never returned -1.
> [I could go back further, but I don't see the point.]
>
> 2014-02-20 Doug Evans <dje@google.com>
>
> * value.c (record_latest_value): Fix comment.
Hmmm, even part of gdb still thinks record_latest_value can return -1.
2014-02-20 Doug Evans <dje@google.com>
* value.c (record_latest_value): Fix comment.
* printcmd.c (print_command_1): Remove code to handle -1 return from
record_latest_value.
diff --git a/gdb/value.c b/gdb/value.c
index 73ba18e..50b0245 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)
diff --git a/gdb/printcmd.c b/gdb/printcmd.c
index 10d3c23..e5fea17 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);
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] value.c (record_latest_value): Fix comment.
2014-02-21 1:28 ` Doug Evans
@ 2014-02-24 22:02 ` Doug Evans
0 siblings, 0 replies; 3+ messages in thread
From: Doug Evans @ 2014-02-24 22:02 UTC (permalink / raw)
To: gdb-patches; +Cc: ludo, Eli Zaretskii
On Thu, Feb 20, 2014 at 5:28 PM, Doug Evans <dje@google.com> wrote:
> Doug Evans writes:
> > Hi.
> >
> > This patch fixes a comment that was found to be wrong in this thread:
> >
> > https://sourceware.org/ml/gdb-patches/2014-02/msg00674.html
> >
> > I checked as far back as 6.1.1, and it's never returned -1.
> > [I could go back further, but I don't see the point.]
> >
> > 2014-02-20 Doug Evans <dje@google.com>
> >
> > * value.c (record_latest_value): Fix comment.
>
> Hmmm, even part of gdb still thinks record_latest_value can return -1.
>
> 2014-02-20 Doug Evans <dje@google.com>
>
> * value.c (record_latest_value): Fix comment.
> * printcmd.c (print_command_1): Remove code to handle -1 return from
> record_latest_value.
Committed.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-02-24 22:02 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-21 1:22 [PATCH] value.c (record_latest_value): Fix comment Doug Evans
2014-02-21 1:28 ` Doug Evans
2014-02-24 22:02 ` Doug Evans
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox