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] new tracepoint downloaded MI notification.


On 09/29/2012 01:46 AM, Pedro Alves wrote:
Took me a second to recall, but the reason the address is
>necessary is multi-location tracepoints -- a tracepoint on the
>target is identified by the { number, address } tuple.  We don't
>send over the location's sub number (like 1.1, 1.2, etc.).
>
>Should we mention this somewhere (other than at the tracepoint
>packets description), so frontend people don't wonder whether they
>can ignore the address field, and why aren't the other fields of
>the tracepoint (like spec string) included?
And I guess the related question is, are frontends interested
in { number, address }, which is target side detail, or on
{ number, location number }, which is how other breakpoints are
presented to the frontend?  I would think the latter?

From the frontend's point of view, {number, location number} is better, and the schema "number.location_number" has been used in "=breakpoint-modified" notification. However, if we want to use {number, location number} here, we have to guarantee that the location number is an attribute of bp_location, because:


Nowadays, location number is generated by incrementing a counter during iterating a list of bp_location of breakpoint (in breakpoint.c:print_one_breakpoint), so I am wondering that the bp_location object may have the different number, if the list of bp_locations of a breakpoint is removed due to some reasons. Looks bp_location list of breakpoint is *not* removed except in breakpoint_program_space_exit, after examine the source code.

For example,

Originally we have a tracepoint of 3 locations,

4       tracepoint     keep y   <MULTIPLE>
        collect $eip^M
4.1                         y     0x0804859c in func4 inf 1
4.2                         y     0xb7ffc480 in func4 inf 2
4.3                         y     0xb7ffc488 in func4 inf 1

due to some reason, bp_location on address 0xb7ffc480 is removed (for example, inferior 2 is removed), and original bp_location 4.3 becomes 4.2.

In short, if we can make location number persistent (unchanged for a given bp_location object), then {number, location number} is fine, otherwise, I'd prefer {number, address}.

--
Yao


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