[1/1] gdb: Update doc of the "maintenance info line-table"

Message ID 20230322102642.510635-2-lancelot.six@amd.com
State New
Headers
Series gdb: Update doc of the "maintenance info line-table" |

Commit Message

Lancelot SIX March 22, 2023, 10:26 a.m. UTC
  Commit 904d9b02a18 (gdb: make "maintenance info line-table" show
relocated addresses again) have updated the "maintenance info
line-table" command, but did not update the associated documentation.

This patch updates the documentation to reflect the new command output.
---
 gdb/doc/gdb.texinfo | 32 +++++++++++++++++++-------------
 1 file changed, 19 insertions(+), 13 deletions(-)
  

Comments

Simon Marchi March 22, 2023, 1:59 p.m. UTC | #1
On 3/22/23 06:26, Lancelot SIX via Gdb-patches wrote:
> Commit 904d9b02a18 (gdb: make "maintenance info line-table" show
> relocated addresses again) have updated the "maintenance info
> line-table" command, but did not update the associated documentation.
> 
> This patch updates the documentation to reflect the new command output.

Thanks, I didn't think that a maintenance command would have so much
details in the doc.

> ---
>  gdb/doc/gdb.texinfo | 32 +++++++++++++++++++-------------
>  1 file changed, 19 insertions(+), 13 deletions(-)
> 
> diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
> index 6c811b8be2e..dbb6267f3fd 100644
> --- a/gdb/doc/gdb.texinfo
> +++ b/gdb/doc/gdb.texinfo
> @@ -20345,21 +20345,27 @@ 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
> +INDEX  LINE   REL-ADDRESS        UNREL-ADDRESS      IS-STMT PROLOGUE-END
> +0      3      0x0000555555955110 0x0000000000401110 Y
> +1      4      0x0000555555955114 0x0000000000401114 Y       Y
> +2      9      0x0000555555955120 0x0000000000401120 Y
> +3      10     0x0000555555955124 0x0000000000401124 Y       Y
> +4      10     0x0000555555955129 0x0000000000401129
> +5      15     0x0000555555955130 0x0000000000401130 Y
> +6      16     0x0000555555955134 0x0000000000401134 Y       Y
> +7      16     0x0000555555955139 0x0000000000401139
> +8      21     0x0000555555955140 0x0000000000401140 Y
> +9      22     0x000055555595514f 0x000000000040114f Y       Y
> +10     22     0x0000555555955154 0x0000000000401154
> +11     END    0x000055555595515a 0x000000000040115a Y
>  @end smallexample
>  @noindent
> +The @samp{UNREL-ADDRESS} column gives the unrelocated address of the
> +instruction as read from the debug information.  The @samp{REL-ADDRESS} column
> +gives the corresponding address in the process memory (relocated address).  If

process -> inferior, to be generic?

You could also say "in the current inferior's memory" to be more
precise, as the relocated address is given based on the current
inferior.

> +no process is started when executing this command, the relocated address is the

And therefore here, "If the current inferior is not running when
executing the command...".

> +same as the unrelocated address.

The two addresses can also be the same if the executable doesn't require
relocation.  But your formulation doesn't imply that you are describing
all cases where addresses are equal, so perhaps we can leave that detail
out.

Simon
  
Eli Zaretskii March 22, 2023, 2:58 p.m. UTC | #2
> Cc: lsix@lancelotsix.com,
> 	Lancelot SIX <lancelot.six@amd.com>
> Date: Wed, 22 Mar 2023 10:26:42 +0000
> From: Lancelot SIX via Gdb-patches <gdb-patches@sourceware.org>
> 
> Commit 904d9b02a18 (gdb: make "maintenance info line-table" show
> relocated addresses again) have updated the "maintenance info
> line-table" command, but did not update the associated documentation.
> 
> This patch updates the documentation to reflect the new command output.
> ---
>  gdb/doc/gdb.texinfo | 32 +++++++++++++++++++-------------
>  1 file changed, 19 insertions(+), 13 deletions(-)

This is OK, thanks.

Approved-By: Eli Zaretskii <eliz@gnu.org>
  
Lancelot SIX March 22, 2023, 4:48 p.m. UTC | #3
Hi,

>>
>> This patch updates the documentation to reflect the new command output.
> 
> Thanks, I didn't think that a maintenance command would have so much
> details in the doc.

The textual description might be unnecessary for a maint command but 
does not hurt either.  At least, the example output should match what 
GDB produces.


>> +The @samp{UNREL-ADDRESS} column gives the unrelocated address of the
>> +instruction as read from the debug information.  The @samp{REL-ADDRESS} column
>> +gives the corresponding address in the process memory (relocated address).  If
> 
> process -> inferior, to be generic?

Done locally.

> 
> You could also say "in the current inferior's memory" to be more
> precise, as the relocated address is given based on the current
> inferior.
> 
>> +no process is started when executing this command, the relocated address is the
> 
> And therefore here, "If the current inferior is not running when
> executing the command...".
> 
>> +same as the unrelocated address.
> 
> The two addresses can also be the same if the executable doesn't require
> relocation.  But your formulation doesn't imply that you are describing
> all cases where addresses are equal, so perhaps we can leave that detail
> out.

I'll add a "or if the executable does not require relocation".  But I 
could also remove the phrase discussing when relocated == unrelocated. 
This part of the manual documents the maint function, not relocations.

> 
> Simon

I'll send a V2 soon.

Lancelot.
  

Patch

diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index 6c811b8be2e..dbb6267f3fd 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -20345,21 +20345,27 @@  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
+INDEX  LINE   REL-ADDRESS        UNREL-ADDRESS      IS-STMT PROLOGUE-END
+0      3      0x0000555555955110 0x0000000000401110 Y
+1      4      0x0000555555955114 0x0000000000401114 Y       Y
+2      9      0x0000555555955120 0x0000000000401120 Y
+3      10     0x0000555555955124 0x0000000000401124 Y       Y
+4      10     0x0000555555955129 0x0000000000401129
+5      15     0x0000555555955130 0x0000000000401130 Y
+6      16     0x0000555555955134 0x0000000000401134 Y       Y
+7      16     0x0000555555955139 0x0000000000401139
+8      21     0x0000555555955140 0x0000000000401140 Y
+9      22     0x000055555595514f 0x000000000040114f Y       Y
+10     22     0x0000555555955154 0x0000000000401154
+11     END    0x000055555595515a 0x000000000040115a Y
 @end smallexample
 @noindent
+The @samp{UNREL-ADDRESS} column gives the unrelocated address of the
+instruction as read from the debug information.  The @samp{REL-ADDRESS} column
+gives the corresponding address in the process memory (relocated address).  If
+no process is started when executing this command, the relocated address is the
+same as the unrelocated address.
+
 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 place to set a breakpoint at the