[RFA,03/12] Update core-related help strings

Message ID 20180430143731.30007-4-tom@tromey.com
State New
Headers show
Series
  • Small help text tweaks
Related show

Commit Message

Tom Tromey April 30, 2018, 2:37 p.m.
This updates some help strings in corefile.c and gcore.c.

2018-04-27  Tom Tromey  <tom@tromey.com>

	* corefile.c (_initialize_core): Update help string.
	* gcore.c (_initialize_gcore): Update help string.
---
 gdb/ChangeLog  | 5 +++++
 gdb/corefile.c | 1 +
 gdb/gcore.c    | 3 ++-
 3 files changed, 8 insertions(+), 1 deletion(-)

-- 
2.13.6

Comments

Pedro Alves May 4, 2018, 6:11 p.m. | #1
On 04/30/2018 03:37 PM, Tom Tromey wrote:

> diff --git a/gdb/gcore.c b/gdb/gcore.c

> index 5ff4e6dc77..c53810049c 100644

> --- a/gdb/gcore.c

> +++ b/gdb/gcore.c

> @@ -611,7 +611,8 @@ _initialize_gcore (void)

>  {

>    add_com ("generate-core-file", class_files, gcore_command, _("\

>  Save a core file with the current state of the debugged process.\n\

> -Argument is optional filename.  Default filename is 'core.<process_id>'."));

> +Usage: generate-core-file [FILENAME]\n\

> +Argument is optional filename.  Default filename is 'core.PROCESS_ID'."));


Do the guidelines say anything about this?  I mean, PROCESS_ID is not
user input, so I'm wondering whether it should be all caps, or whether
it was better as it was.

Otherwise looks fine.

Thanks,
Pedro Alves
Tom Tromey May 9, 2018, 8:31 p.m. | #2
>>>>> "Pedro" == Pedro Alves <palves@redhat.com> writes:


Pedro> On 04/30/2018 03:37 PM, Tom Tromey wrote:
>> diff --git a/gdb/gcore.c b/gdb/gcore.c

>> index 5ff4e6dc77..c53810049c 100644

>> --- a/gdb/gcore.c

>> +++ b/gdb/gcore.c

>> @@ -611,7 +611,8 @@ _initialize_gcore (void)

>> {

>> add_com ("generate-core-file", class_files, gcore_command, _("\

>> Save a core file with the current state of the debugged process.\n\

>> -Argument is optional filename.  Default filename is 'core.<process_id>'."));

>> +Usage: generate-core-file [FILENAME]\n\

>> +Argument is optional filename.  Default filename is 'core.PROCESS_ID'."));


Pedro> Do the guidelines say anything about this?  I mean, PROCESS_ID is not
Pedro> user input, so I'm wondering whether it should be all caps, or whether
Pedro> it was better as it was.

Pedro> Otherwise looks fine.

The docs don't say much, but since the PID is a meta-syntactic variable,
I think this is the way to go.

Tom
Pedro Alves May 24, 2018, 5 p.m. | #3
On 05/09/2018 09:31 PM, Tom Tromey wrote:
>>>>>> "Pedro" == Pedro Alves <palves@redhat.com> writes:

> 

> Pedro> On 04/30/2018 03:37 PM, Tom Tromey wrote:

>>> diff --git a/gdb/gcore.c b/gdb/gcore.c

>>> index 5ff4e6dc77..c53810049c 100644

>>> --- a/gdb/gcore.c

>>> +++ b/gdb/gcore.c

>>> @@ -611,7 +611,8 @@ _initialize_gcore (void)

>>> {

>>> add_com ("generate-core-file", class_files, gcore_command, _("\

>>> Save a core file with the current state of the debugged process.\n\

>>> -Argument is optional filename.  Default filename is 'core.<process_id>'."));

>>> +Usage: generate-core-file [FILENAME]\n\

>>> +Argument is optional filename.  Default filename is 'core.PROCESS_ID'."));

> 

> Pedro> Do the guidelines say anything about this?  I mean, PROCESS_ID is not

> Pedro> user input, so I'm wondering whether it should be all caps, or whether

> Pedro> it was better as it was.

> 

> Pedro> Otherwise looks fine.

> 

> The docs don't say much, but since the PID is a meta-syntactic variable,

> I think this is the way to go.


OK.

Thanks,
Pedro Alves

Patch

diff --git a/gdb/corefile.c b/gdb/corefile.c
index 5a735264ef..d8f30cf804 100644
--- a/gdb/corefile.c
+++ b/gdb/corefile.c
@@ -509,6 +509,7 @@  _initialize_core (void)
 
   c = add_cmd ("core-file", class_files, core_file_command, _("\
 Use FILE as core dump for examining memory and registers.\n\
+Usage: core-file FILE\n\
 No arg means have no core file.  This command has been superseded by the\n\
 `target core' and `detach' commands."), &cmdlist);
   set_cmd_completer (c, filename_completer);
diff --git a/gdb/gcore.c b/gdb/gcore.c
index 5ff4e6dc77..c53810049c 100644
--- a/gdb/gcore.c
+++ b/gdb/gcore.c
@@ -611,7 +611,8 @@  _initialize_gcore (void)
 {
   add_com ("generate-core-file", class_files, gcore_command, _("\
 Save a core file with the current state of the debugged process.\n\
-Argument is optional filename.  Default filename is 'core.<process_id>'."));
+Usage: generate-core-file [FILENAME]\n\
+Argument is optional filename.  Default filename is 'core.PROCESS_ID'."));
 
   add_com_alias ("gcore", "generate-core-file", class_files, 1);
 }