This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH] Disallow tfind during trace run
- From: Stan Shebs <stan at codesourcery dot com>
- To: gdb-patches at sourceware dot org
- Date: Wed, 30 Dec 2009 12:01:23 -0800
- Subject: [PATCH] Disallow tfind during trace run
This patch is somewhat of a pragmatic band-aid; one can certainly
imagine a target that can report data from completed traceframes even
while new ones are being constructed, but right now we don't have any
such targets, and since there is no remote protocol for the situation,
tfind simply reports nonsense - and it's quite easy to absentmindedly
type tfind without realizing the experiment hasn't been stopped yet!
This patch also helps set up diff context for the impending cataclysmic
move of all tracepoint operations to the target vector, which is now
about 6-7 patches away...
Stan
2009-12-30 Stan Shebs <stan@codesourcery.com>
* tracepoint.c (trace_find_command): Error out if trace running.
(trace_find_pc_command): Ditto.
(trace_find_tracepoint_command): Ditto.
(trace_find_line_command): Ditto.
(trace_find_range_command): Ditto.
(trace_find_outside_command): Ditto.
Index: tracepoint.c
===================================================================
RCS file: /cvs/src/src/gdb/tracepoint.c,v
retrieving revision 1.130
diff -p -r1.130 tracepoint.c
*** tracepoint.c 30 Dec 2009 16:11:06 -0000 1.130
--- tracepoint.c 30 Dec 2009 19:44:47 -0000
*************** trace_find_command (char *args, int from
*** 1863,1868 ****
--- 1863,1871 ----
if (target_is_remote ())
{
+ if (trace_running_p)
+ error ("May not look at trace frames while trace is running.");
+
if (deprecated_trace_find_hook)
deprecated_trace_find_hook (args, from_tty);
*************** trace_find_pc_command (char *args, int f
*** 1925,1930 ****
--- 1928,1936 ----
if (target_is_remote ())
{
+ if (trace_running_p)
+ error ("May not look at trace frames while trace is running.");
+
if (args == 0 || *args == 0)
pc = regcache_read_pc (get_current_regcache ());
else
*************** trace_find_tracepoint_command (char *arg
*** 1946,1951 ****
--- 1952,1960 ----
if (target_is_remote ())
{
+ if (trace_running_p)
+ error ("May not look at trace frames while trace is running.");
+
if (args == 0 || *args == 0)
{
if (tracepoint_number == -1)
*************** trace_find_line_command (char *args, int
*** 1982,1987 ****
--- 1991,1999 ----
if (target_is_remote ())
{
+ if (trace_running_p)
+ error ("May not look at trace frames while trace is running.");
+
if (args == 0 || *args == 0)
{
sal = find_pc_line (get_frame_pc (get_current_frame ()), 0);
*************** trace_find_range_command (char *args, in
*** 2077,2082 ****
--- 2089,2097 ----
if (target_is_remote ())
{
+ if (trace_running_p)
+ error ("May not look at trace frames while trace is running.");
+
if (args == 0 || *args == 0)
{ /* XXX FIXME: what should default behavior be? */
printf_filtered ("Usage: tfind range <startaddr>,<endaddr>\n");
*************** trace_find_outside_command (char *args,
*** 2116,2121 ****
--- 2131,2139 ----
if (target_is_remote ())
{
+ if (trace_running_p)
+ error ("May not look at trace frames while trace is running.");
+
if (args == 0 || *args == 0)
{ /* XXX FIXME: what should default behavior be? */
printf_filtered ("Usage: tfind outside <startaddr>,<endaddr>\n");