This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Remove setting default values in trace_status.


On 9/21/12 2:07 AM, Yao Qi wrote:
Hi,
We set some default value of each field of TS in
remote_get_trace_status, and parse_trace_status, which will be called
later, sets the default value of them again.  Looks we don't have to
set values twice.  This patch is to remove the code setting default value
in remote_get_trace_status.

Regression tested on x86_64-linux/gdbserver.  It is somewhat obvious
to me, but review is welcome.


This was paranoia on my part, plus there was probably some point at which I was unsure if the status parser was going to initialize things itself. In any case, this one is fine with me.

Stan
stan@codesourcery.com


gdb:


2012-09-21 Yao Qi <yao@codesourcery.com>

	* remote.c (remote_get_trace_status): Remove setting default
	values of fields of 'ts'.
---
  gdb/remote.c |    8 ++------
  1 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/gdb/remote.c b/gdb/remote.c
index a3309c7..1750bee 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -10588,15 +10588,11 @@ remote_get_trace_status (struct trace_status *ts)
/* We're working with a live target. */
ts->from_file = 0;
- /* Set some defaults. */
- ts->running_known = 0;
- ts->stop_reason = trace_stop_reason_unknown;
- ts->traceframe_count = -1;
- ts->buffer_free = 0;
-
if (*p++ != 'T')
error (_("Bogus trace status reply from target: %s"), target_buf);
+ /* Function 'parse_trace_status' sets default value of each field of
+ 'ts' at first, so we don't have to do it here. */
parse_trace_status (p, ts);
return ts->running;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]