Re: [PATCH] add-symbol-file-from-memory command

Eli Zaretskii
2004-02-02T06:19:23Z

> Date: Sun, 1 Feb 2004 19:38:26 -0800
> From: Roland McGrath <roland@redhat.com>
>
> This patch hasn't changed since the last time I posted it. But I'm hoping
> that it will be approved this time. This support (the underlying function,
> not the user command) is the last nontrivial piece required for backtraces
> from system calls to work right with vanilla Linux 2.6 kernels. The only
> objections previously were not apropos, and noone said anything about the
> content of the code itself. If there is valid cause not to put this in
> now, I hope I can see it stated clearly.

I have a couple of minor comments regarding the documentation and the
user interface:

> + c = add_cmd ("add-symbol-file-from-memory", class_files,
> + add_symbol_file_from_memory_command,
> + "Usage: add-symbol-file-from-memory ADDR\n\
> +Load the symbols out of memory from a dynamically loaded object file.\n\
> +ADDR is the starting address of the file's shared object file header.",
> + &cmdlist);
> +

There are two problems with this command definition:

. The first line of the doc string, up until the first \n, should
be a short description of the command, since that is what GDB
displays when several commands are listed (e.g., by `apropos' or
`help files' commands). [Yes, I know: `add-symbol-file' that is
already there has the same problem.]

. It is not entirely clear what could ADDR be. Is that a numerical
address, or something more flexible? The reason that this is
important is that the command's completion function should be set
according to the possible arguments it could accept; as written,
the command's completion will try to complete on symbol names,
which I'm not sure to be appropriate.

Also, if this code is approved, please add to the manual a
description of the new command.

TIA

P.S. This command is undocumented. Could someone of the symfile.c
maintainers please document it?

> c = add_cmd ("add-shared-symbol-files", class_files,
> add_shared_symbol_files_command,
> "Load the symbols from shared objects in the dynamic linker's link map.",