[PATCH] gdb/disassembly: Update to handle non-statement addresses

Andrew Burgess andrew.burgess@embecosm.com
Fri Jul 24 09:13:39 GMT 2020


* Tom Tromey <tom@tromey.com> [2020-07-23 14:44:40 -0600]:

> Pedro> I've always thought that these two paragraphs are backwards -- i.e.,
> Pedro> that we should describe /s first since it's the preferred format,
> Pedro> and then /m should be described in comparison to /s.
> 
> How about the appended?
> 
> Tom
> 
> commit 007c27fe2c11a35d7f8b6b13077b6d42dffb06bd
> Author: Tom Tromey <tromey@adacore.com>
> Date:   Thu Jul 23 14:43:11 2020 -0600
> 
>     Update "disassemble" help
>     
>     Pedro pointed out that disassemble/m should be documented after
>     disassemble/s, because /m is deprecated.  This patch does so, and adds
>     a usage line.
>     
>     Regression tested on x86-64 Fedora 32.
>     
>     gdb/ChangeLog
>     2020-07-23  Tom Tromey  <tromey@adacore.com>
>     
>             * cli/cli-cmds.c (_initialize_cli_cmds): Rearrange "disassemble"
>             help.  Add usage.
> 
> diff --git a/gdb/ChangeLog b/gdb/ChangeLog
> index 37035206f49..f0732ef0331 100644
> --- a/gdb/ChangeLog
> +++ b/gdb/ChangeLog
> @@ -1,3 +1,8 @@
> +2020-07-23  Tom Tromey  <tromey@adacore.com>
> +
> +	* cli/cli-cmds.c (_initialize_cli_cmds): Rearrange "disassemble"
> +	help.  Add usage.
> +
>  2020-07-23  Tom de Vries  <tdevries@suse.de>
>  
>  	PR tui/26282
> diff --git a/gdb/cli/cli-cmds.c b/gdb/cli/cli-cmds.c
> index 14718d1181a..300f7725cb0 100644
> --- a/gdb/cli/cli-cmds.c
> +++ b/gdb/cli/cli-cmds.c
> @@ -2528,8 +2528,13 @@ can be shown using \"show listsize\"."));
>  
>    c = add_com ("disassemble", class_vars, disassemble_command, _("\
>  Disassemble a specified section of memory.\n\
> +Usage: disassemble[/m|/r|/s] START [, END]\n\
>  Default is the function surrounding the pc of the selected frame.\n\
>  \n\
> +With a /s modifier, source lines are included (if available).\n\
> +In this mode, the output is still in PC address order, and\n\
> +file names and contents for all relevant source files are displayed.\n\

Doesn't really make sense any more, "output is still in PC address",
the use of 'still' seems odd as this is the first description for this
command.  How about replacing it with 'displayed'.

> +\n\
>  With a /m modifier, source lines are included (if available).\n\
>  This view is \"source centric\": the output is in source line order,\n\
>  regardless of any optimization that is present.  Only the main source file\n\
> @@ -2537,11 +2542,6 @@ is displayed, not those of, e.g., any inlined functions.\n\
>  This modifier hasn't proved useful in practice and is deprecated\n\
>  in favor of /s.\n\
>  \n\
> -With a /s modifier, source lines are included (if available).\n\
> -This differs from /m in two important respects:\n\
> -- the output is still in pc address order, and\n\
> -- file names and contents for all relevant source files are displayed.\n\
> -\n\
>  With a /r modifier, raw instructions in hex are included.\n\
>  \n\
>  With a single argument, the function surrounding that address is dumped.\n\


More information about the Gdb-patches mailing list