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 2/2] Find the next matched trace file in 'tfile target'.


On 02/27/2013 03:52 AM, Pedro Alves wrote:
I'm confused on why this bit of the predicate

(tfnum == traceframe_number && tfnum == 0)

is necessary.  traceframe_number is -1 when not looking
at a traceframe yet, so "tfnum > traceframe_number"
should be sufficient, no?


This condition was added to handle the case like this below:


(gdb) tfind 0
Found trace frame 0, tracepoint 2
(gdb) tfind tracepoint 2
Found trace frame 0, tracepoint 2

It is not necessary, and doesn't match the documentation. We start from trace frame zero, and look for *next* frame from trace frame one. This predicate can be removed.

I find it clearer to move the frame skipping a bit higher
up, even before the specific tfind tp/range/etc. matching.
Doing it this way also avoids unnecessary read/lseek system
calls done by tfile_get_traceframe_address.

WDYT?


That makes sense to me.



Regression tested on x86_64 Fedora 17.


     gdb/
     2013-02-25  Yao Qi<yao@codesourcery.com>
     	    Pedro Alves<palves@redhat.com>

     	* tracepoint.c (tfile_trace_find): For tfind
     	pc/tp/range/outside, look for the next trace frame instead of
     	always starting from frame 0.

Committed. -- Yao (éå)


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