[PATCH][gdb/breakpoint] Handle setting breakpoint on label without address

Pedro Alves pedro@palves.net
Thu Aug 27 12:41:29 GMT 2020


On 8/27/20 12:52 PM, Tom de Vries wrote:
> Hi,
> 
> Consider test-case test.c:
> ...
> $ cat test.c
> int main (void) {
>   return 0;
>  L1:
>   (void)0;
> }
> ...
> 
> Compiled with debug info:
> ...
> $ gcc test.c -g
> ...
> 
> When attempting to set a breakpoint at L1, which is a label without address:
> ...
>  <1><f4>: Abbrev Number: 2 (DW_TAG_subprogram)
>     <f5>   DW_AT_name        : main
>  <2><115>: Abbrev Number: 3 (DW_TAG_label)
>     <116>   DW_AT_name        : L1
>     <119>   DW_AT_decl_file   : 1
>     <11a>   DW_AT_decl_line   : 5
>  <2><11b>: Abbrev Number: 0

Is this a debug info bug, or is the debug info telling us that the
address of the label is the same as the line number's address?

How about looking up the line number address instead of throwing
an error?


More information about the Gdb-patches mailing list