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 v3 4/9] Explicit locations: introduce address locations


On 03/01/2015 01:02 PM, Doug Evans wrote:
> Keith Seitz <keiths@redhat.com> writes:
>> +/* Convert the given ADDRESS into SaLs.  */
>> +
>> +static struct symtabs_and_lines
>> +convert_address_location_to_sals (struct linespec_state *self,
>> +				  CORE_ADDR address)
>> +{
>> +  struct symtab_and_line sal;
>> +  struct symtabs_and_lines sals = {NULL, 0};
>> +
>> +  sal = find_pc_line (address, 0);
>> +  sal.pc = address;
>> +  sal.section = find_pc_overlay (address);
>> +  sal.explicit_pc = 1;
>> +  add_sal_to_sals (self, &sals, &sal, core_addr_to_string (address), 1);
>> +
>> +  if (self->canonical != NULL)
>> +    self->canonical->location = new_address_location (address);
>
> ====
> Modifying self->canonical->location is an undocumented side-effect.
> Can you augment the function comment to document and explain this?

In general, all of the convert_*_location_to_sals functions will
canonicalize the location into linespec_state.canonical.

Address locations are, though, completely specified, unlike some
linespecs/explicit locations, where we might have to "fill-in" some
missing bits, e.g., "b 30" -> "30" -> "sourcefile.c:30".

In that vein, I am simply going to remove this. It is not needed anymore.

Keith



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