[PATCH v4 1/1] gdb, breakpoint: add breakpoint location debugging logs

Andrew Burgess aburgess@redhat.com
Wed Jun 7 14:37:20 GMT 2023


"Schimpe, Christina" <christina.schimpe@intel.com> writes:

> Hi Andrew, 
>
> Thanks a lot for your review. 
> I only have one small question, else I agree with all of your feedback.
>
>> > +
>> > +static std::string
>> > +breakpoint_location_address_str (const bp_location* bl) {
>> > +  std::string str = string_printf ("Breakpoint %d, location (%s) at address %s",
>> > +				   bl->owner->number,
>> > +				   host_address_to_string (bl),
>> > +				   paddress (bl->gdbarch, bl->address));
>> 
>> I can't help but think using 'location' in this string is a bad idea, 'location' already
>> has a meaning for GDB breakpoints.  How about just dropping the work
>> 'location'?
>
> Just to be sure that I understand correctly - do you suggest dropping the word 'location' in string_printf as follows:
>
> static std::string
> breakpoint_location_address_str (const bp_location* bl) {
>   std::string str = string_printf ("Breakpoint %d (%s) at address %s",
> 			             bl->owner->number,
> 			             host_address_to_string (bl),
> 			             paddress (bl->gdbarch, bl->address));

Yes.  For me a location would either be something like '1.1' or maybe
just '1' if (given context) it is obvious we're talking about breakpoint
#1, thus 1.1 would be implied.

Or a location could be an address within the inferior for where the
location has been placed -- which is what I would naturally assume if I
saw an address labelled as a location.

There's also a benefit for removing extra text that the debug message
have more chance of fitting on the terminal without wrapping too much!

Thanks,
Andrew

>
> This would be fine for me.
>
> Best Regards,
> Christina
> Intel Deutschland GmbH
> Registered Address: Am Campeon 10, 85579 Neubiberg, Germany
> Tel: +49 89 99 8853-0, www.intel.de <http://www.intel.de>
> Managing Directors: Christin Eisenschmid, Sharon Heck, Tiffany Doon Silva  
> Chairperson of the Supervisory Board: Nicole Lau
> Registered Office: Munich
> Commercial Register: Amtsgericht Muenchen HRB 186928



More information about the Gdb-patches mailing list