From ed6dfe517ee323ed631aa8b9816289ea35219409 Mon Sep 17 00:00:00 2001 From: Petr Tesarik Date: Thu, 28 Jun 2018 08:30:42 +0200 Subject: Make add-symbol-file's address argument optional The (first) .text section must be always specified as the second non-option argument. The documentation states that GDB cannot figure out this address by itself. This is true if the object file was indeed relocated, but it is also confusing, because all other sections can be omitted and will use the address provided by BFD. gdb/ChangeLog: 2018-06-28 Petr Tesarik * symfile.c (add_symbol_file_command, _initialize_symfile): Do not require the second argument. If omitted, load sections at the addresses specified in the file. gdb/doc/ChangeLog: 2018-06-28 Petr Tesarik * gdb.texinfo (Files): The address argument for "add-symbol-file" is no longer mandatory. gdb/testsuite/ChangeLog: 2018-06-28 Petr Tesarik * gdb.base/relocate.exp: Test add-symbol-file behavior when the address argument is omitted. --- gdb/doc/ChangeLog | 5 +++++ gdb/doc/gdb.texinfo | 17 ++++++++--------- 2 files changed, 13 insertions(+), 9 deletions(-) (limited to 'gdb/doc') diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog index f312873..9fd3d3c 100644 --- a/gdb/doc/ChangeLog +++ b/gdb/doc/ChangeLog @@ -1,5 +1,10 @@ 2018-06-28 Petr Tesarik + * gdb.texinfo (Files): The address argument for "add-symbol-file" + is no longer mandatory. + +2018-06-28 Petr Tesarik + * gdb.texinfo (Files): Document "symbol-file -o offset". 2018-06-14 Tom de Vries diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index 3282562..64c511d 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -18918,18 +18918,17 @@ the program is running. To do this, use the @code{kill} command @kindex add-symbol-file @cindex dynamic linking -@item add-symbol-file @var{filename} @var{address} -@itemx add-symbol-file @var{filename} @var{address} @r{[} -readnow @r{|} -readnever @r{]} -@itemx add-symbol-file @var{filename} @var{address} -s @var{section} @var{address} @dots{} +@item add-symbol-file @var{filename} @r{[} -readnow @r{|} -readnever @r{]} @r{[} @var{textaddress} @r{]} @r{[} -s @var{section} @var{address} @dots{} @r{]} The @code{add-symbol-file} command reads additional symbol table information from the file @var{filename}. You would use this command when @var{filename} has been dynamically loaded (by some other means) -into the program that is running. The @var{address} should give the memory -address at which the file has been loaded; @value{GDBN} cannot figure -this out for itself. You can additionally specify an arbitrary number -of @samp{-s @var{section} @var{address}} pairs, to give an explicit -section name and base address for that section. You can specify any -@var{address} as an expression. +into the program that is running. The @var{textaddress} parameter gives +the memory address at which the file's text section has been loaded. +You can additionally specify the base address of other sections using +an arbitrary number of @samp{-s @var{section} @var{address}} pairs. +If a section is omitted, @value{GDBN} will use its default addresses +as found in @var{filename}. Any @var{address} or @var{textaddress} +can be given as an expression. The symbol table of the file @var{filename} is added to the symbol table originally read with the @code{symbol-file} command. You can use the -- cgit v1.1