[PATCH v2 2/2] gdb: Add support for DW_LNS_set_prologue_end in line-table

Eli Zaretskii eliz@gnu.org
Wed Mar 30 12:26:31 GMT 2022


> Date: Wed, 30 Mar 2022 10:34:58 +0100
> From: Lancelot SIX via Gdb-patches <gdb-patches@sourceware.org>
> Cc: lsix@lancelotsix.com, Lancelot SIX <lancelot.six@amd.com>
> 
> --- a/gdb/NEWS
> +++ b/gdb/NEWS
> @@ -8,6 +8,17 @@
>  * Remove support for building against Python 2, it is now only possible to
>    build GDB against Python 3.
>  
> +* GDB now honours the DWARF prologue_end line-table entry flag the compiler can
> +  emit to indicate where a breakpoint should be placed to break in a function
> +  past its prologue.
> +
> +* Changed commands
> +
> +maintenance info line-table
> +  Add a PROLOGUE-END column to the output which indicates that an
> +  entry corresponds to an address where a breakpoint should be placed
> +  to be at the first instruction past a function's prologue.
> +
>  * Python API
>  

This part is OK.

> --- a/gdb/doc/gdb.texinfo
> +++ b/gdb/doc/gdb.texinfo
> @@ -19794,6 +19794,33 @@ line 1574.
>  List the @code{struct linetable} from all @code{struct symtab}
>  instances whose name matches @var{regexp}.  If @var{regexp} is not
>  given, list the @code{struct linetable} from all @code{struct symtab}.
> +For example:
> +
> +@smallexample
> +(@value{GDBP}) maint info line-table
> +objfile: /home/gnu/build/a.out ((struct objfile *) 0x6120000e0d40)
> +compunit_symtab: simple.cpp ((struct compunit_symtab *) 0x6210000ff450)
> +symtab: /home/gnu/src/simple.cpp ((struct symtab *) 0x6210000ff4d0)
> +linetable: ((struct linetable *) 0x62100012b760):
> +INDEX  LINE   ADDRESS            IS-STMT PROLOGUE-END
> +0      3      0x0000000000401110 Y
> +1      4      0x0000000000401114 Y       Y
> +2      9      0x0000000000401120 Y
> +3      10     0x0000000000401124 Y       Y
> +4      10     0x0000000000401129
> +5      15     0x0000000000401130 Y
> +6      16     0x0000000000401134 Y       Y
> +7      16     0x0000000000401139
> +8      21     0x0000000000401140 Y
> +9      22     0x000000000040114f Y       Y
> +10     22     0x0000000000401154
> +11     END    0x000000000040115a Y
> +@end smallexample
> +@noindent

This is also OK, but please fix this:

> +The @samp{IS-STMT} column indicates if the address is a recommended breakpoint
> +location to represent a line or a statement.  The @samp{PROLOGUE-END} column
> +indicates that a given address is an adequate to place a breakpoint at the
                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
That should be "is an adequate place to set a breakpoint".

Thanks.


More information about the Gdb-patches mailing list