[patch] circ.exp

Abid, Hafiz hafiz_abid@mentor.com
Wed Mar 20 18:26:00 GMT 2013


Hi All,
This is patch to refactor circ.exp. I noticed that it was quitting  
early as gdb_target_supports_trace was failing.  There were some other  
issues too.  After the changes, it is running to completion.  How does  
it look?

One test is failing that probably shows a defect.  Following session,  
which is edited for clarity, shows the problem.  When there is not  
enough buffer left (3rd frame onward), target does not stop the trace.   
It continues but only uses 6 bytes for the frame.

(gdb) set trace-buffer-size 200
(gdb) tstart
(gdb) c
...
(gdb) tstatus
Collected 1 trace frames.
Trace buffer has 131 bytes of 200 bytes free (34% full).
...
(gdb) c
...
(gdb) tstatus
Collected 2 trace frames.
Trace buffer has 62 bytes of 200 bytes free (69% full).
...
(gdb) c
...
(gdb) tstatus
Trace is running on the target.
Collected 3 trace frames.
Trace buffer has 56 bytes of 200 bytes free (72% full).
...
(gdb) c
...
(gdb) tstatus
Collected 4 trace frames.
Trace buffer has 50 bytes of 200 bytes free (75% full).
...
(gdb) c
...
(gdb) tstatus
Collected 5 trace frames.
Trace buffer has 44 bytes of 200 bytes free (78% full).
...
(gdb) tstop
(gdb) tfind start
Found trace frame 0, tracepoint 11
#0  func0 () at ../.././../git/gdb/testsuite/gdb.trace/circ.c:11
11	}
(gdb) p testload
$4 = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13}
(gdb) tfind 4
Found trace frame 4, tracepoint 5
27	}
(gdb) p testload
$5 = {<unavailable> <repeats 13 times>}


Regards,
Abid

gdb/testsuite:

2013-03-20  Hafiz Abid Qadeer  <abidh@codesourcery.com>

	* gdb.trace/circ.exp: (run_trace_experiment): Test
	setup_tracepoints and 'break end' in it.
	(trace_buffer_normal): Refactor it to...
	(support_trace_packet). ..this.
	(gdb_trace_circular_tests): Remove. Move tests to...
	(top level): ... here.  Call 'runto_main' before checking for
	trace support. 	Call 'support_trace_packets' to check the
	support for QTBuffer:size and QTBuffer:circular.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: circ.patch
Type: text/x-patch
Size: 8783 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20130320/cfd3b42f/attachment.bin>


More information about the Gdb-patches mailing list