diff options
author | Petr Tesarik <ptesarik@suse.cz> | 2018-06-28 08:30:42 +0200 |
---|---|---|
committer | Petr Tesarik <ptesarik@suse.cz> | 2018-06-28 08:35:34 +0200 |
commit | ed6dfe517ee323ed631aa8b9816289ea35219409 (patch) | |
tree | 8ebac09e44c3a548370a0c1d8a7b1f8d4e8cf299 /gdb/doc | |
parent | d4d429d589c4d6a4450146fbcac8e1aad445114d (diff) | |
download | gdb-ed6dfe517ee323ed631aa8b9816289ea35219409.zip gdb-ed6dfe517ee323ed631aa8b9816289ea35219409.tar.gz gdb-ed6dfe517ee323ed631aa8b9816289ea35219409.tar.bz2 |
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 <ptesarik@suse.cz>
* 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 <ptesarik@suse.cz>
* gdb.texinfo (Files): The address argument for "add-symbol-file"
is no longer mandatory.
gdb/testsuite/ChangeLog:
2018-06-28 Petr Tesarik <ptesarik@suse.cz>
* gdb.base/relocate.exp: Test add-symbol-file behavior when the
address argument is omitted.
Diffstat (limited to 'gdb/doc')
-rw-r--r-- | gdb/doc/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/doc/gdb.texinfo | 17 |
2 files changed, 13 insertions, 9 deletions
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 <ptesarik@suse.cz> + * gdb.texinfo (Files): The address argument for "add-symbol-file" + is no longer mandatory. + +2018-06-28 Petr Tesarik <ptesarik@suse.cz> + * gdb.texinfo (Files): Document "symbol-file -o offset". 2018-06-14 Tom de Vries <tdevries@suse.de> 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 |