[RFA 3/9] Explicit locations v2 - Locations refactor

Keith Seitz keiths@redhat.com
Wed Sep 3 19:31:00 GMT 2014


On 08/02/2014 12:11 PM, Doug Evans wrote:
>> [...]
>>>    >
>>>    >    if (sals.nelts != 1)
>>>    >      error (_("Couldn't get information on specified line."));
>>>    >
>>>    > +  if (EVENT_LOCATION_TYPE (&copy_location) ==
>>> EVENT_LOCATION_LINESPEC)
>>>    > +    arg = EVENT_LOCATION_LINESPEC (&copy_location);
>>>
>>> A short comment explaining why setting arg here is necessary would help
>>> me the reader.
>>
>>
>> It's the idiom that is forced upon us by the ambiguity of linespecs. Only
>> AFTER creating SaLs do we know what the user specified.
>>
>> You'll see this all over the place as a result.
>
> Ah.  It may take a few iterations to commit this to longer-term memory.
> Apologies for the interim.

This is now accomplished with the more readable:

event_location_advance_input_ptr (&arg, copy_location);

Updated patch attached.

Keith

Changes since last revision:
   - decode_objc: do not pass NULL to new_linespec_location.
     free string (ctor makes its own copy)
   - strace_marker_create_sals_from_location: likewise.
   - Use new paradigm w/copy_event_location_tmp and
     event_location_advance_input_ptr.
   - Use functions instead of EVENT_LOCATION_* macros
   - Move "canonicalization" of location string for pending bps
     and save this representation into the (pending) bp.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: explicit-location-refactor.patch
Type: text/x-patch
Size: 90419 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20140903/c7ff6142/attachment.bin>


More information about the Gdb-patches mailing list