This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch] remote_set_trace_notes
- From: Pedro Alves <palves at redhat dot com>
- To: "Abid, Hafiz" <hafiz_abid at mentor dot com>
- Cc: stan at codesourcery dot com, gdb-patches at sourceware dot org
- Date: Fri, 01 Mar 2013 18:31:23 +0000
- Subject: Re: [patch] remote_set_trace_notes
- References: <1362159789.18212.1@abidh-ubunto1104>
On 03/01/2013 05:43 PM, Abid, Hafiz wrote:
>
> Hi All,
> During review of trace-buffer-size patch, I was asked to move a change into a separate patch. This is simple change in remote_set_trace_notes that will make this function return if all arguments are NULL.
>
> 2012-03-01 Stan Shebs <stan@codesourcery.com>
> Hafiz Abid Qadeer <abidh@codesourcery.com>
>
> gdb/
> * remote.c (remote_set_trace_notes): Handle no-op case better.
Should this really be a no-op? I'm not sure this is correct.
Say you connect to a target that had been tracing
before (disconnected tracing), and had its trace
notes/user/etc. set.
GDB connects, the user sets up a new trace session,
but doesn't set notes/user/etc. IOW, the (trace_user/trace_notes/etc.)
GDB variables are left with their NULL defaults.
"show trace-notes" shows:
(gdb) show trace-notes
The notes string to use for current and future trace runs is "".
The user starts the trace session with tstart.
With the patch, GDB skips sending "QTNotes:...".
The target reuses the user/notes from the previous session.
That can't be right.
Do the same experiment again, but do (literally)
"set trace-notes" before tstart. This sets the trace_notes
variable to "" instead of NULL. This time, "tstart"
actually clears the previous run's trace notes on the
target.
Seems to me there's actually a bug here, and NULL and ""
should be treated as equivalent by remote_set_trace_notes.
--
Pedro Alves