Move generic_load declaration to symfile.h
Commit Message
... since the implementation is in symfile.c.
At the same time, add some documentation and make sure the first
parameter's name in the declaration matches the definition.
gdb/ChangeLog:
* defs.h (generic_load): Move from here...
* symfile.h (generic_load): ... to here. Rename name parameter
to args.
* symfile.c (generic_load): Add comment.
---
gdb/defs.h | 3 ---
gdb/symfile.c | 2 ++
gdb/symfile.h | 6 ++++++
3 files changed, 8 insertions(+), 3 deletions(-)
Comments
>>>>> "Simon" == Simon Marchi <simon.marchi@polymtl.ca> writes:
Simon> ... since the implementation is in symfile.c.
Simon> At the same time, add some documentation and make sure the first
Simon> parameter's name in the declaration matches the definition.
Simon> gdb/ChangeLog:
Simon> * defs.h (generic_load): Move from here...
Simon> * symfile.h (generic_load): ... to here. Rename name parameter
Simon> to args.
Simon> * symfile.c (generic_load): Add comment.
Thanks, this looks good to me. I'm generally in favor of shrinking
defs.h and of having the .h reflect the .c.
Tom
On 2019-07-01 9:03 a.m., Tom Tromey wrote:
>>>>>> "Simon" == Simon Marchi <simon.marchi@polymtl.ca> writes:
>
> Simon> ... since the implementation is in symfile.c.
> Simon> At the same time, add some documentation and make sure the first
> Simon> parameter's name in the declaration matches the definition.
>
> Simon> gdb/ChangeLog:
>
> Simon> * defs.h (generic_load): Move from here...
> Simon> * symfile.h (generic_load): ... to here. Rename name parameter
> Simon> to args.
> Simon> * symfile.c (generic_load): Add comment.
>
> Thanks, this looks good to me. I'm generally in favor of shrinking
> defs.h and of having the .h reflect the .c.
>
> Tom
>
Thanks, I have pushed it.
Simon
@@ -300,9 +300,6 @@ EXTERN_C char *re_comp (const char *);
extern void symbol_file_command (const char *, int);
-/* * Remote targets may wish to use this as their load function. */
-extern void generic_load (const char *name, int from_tty);
-
/* From top.c */
typedef void initialize_file_ftype (void);
@@ -2023,6 +2023,8 @@ static void print_transfer_performance (struct ui_file *stream,
unsigned long write_count,
std::chrono::steady_clock::duration d);
+/* See symfile.h. */
+
void
generic_load (const char *args, int from_tty)
{
@@ -532,6 +532,12 @@ void expand_symtabs_matching
void map_symbol_filenames (symbol_filename_ftype *fun, void *data,
int need_fullname);
+/* Target-agnostic function to load the sections of an executable into memory.
+
+ ARGS should be in the form "EXECUTABLE [OFFSET]", where OFFSET is an
+ optional offset to apply to each section. */
+extern void generic_load (const char *args, int from_tty);
+
/* From dwarf2read.c */
/* Names for a dwarf2 debugging section. The field NORMAL is the normal