aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite
diff options
context:
space:
mode:
authorPetr Tesarik <ptesarik@suse.cz>2018-06-28 08:30:42 +0200
committerPetr Tesarik <ptesarik@suse.cz>2018-06-28 08:35:34 +0200
commited6dfe517ee323ed631aa8b9816289ea35219409 (patch)
tree8ebac09e44c3a548370a0c1d8a7b1f8d4e8cf299 /gdb/testsuite
parentd4d429d589c4d6a4450146fbcac8e1aad445114d (diff)
downloadgdb-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/testsuite')
-rw-r--r--gdb/testsuite/ChangeLog5
-rw-r--r--gdb/testsuite/gdb.base/relocate.exp15
2 files changed, 20 insertions, 0 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index cea52c7..e3c9141 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,5 +1,10 @@
2018-06-28 Petr Tesarik <ptesarik@suse.cz>
+ * gdb.base/relocate.exp: Test add-symbol-file behavior when the
+ address argument is omitted.
+
+2018-06-28 Petr Tesarik <ptesarik@suse.cz>
+
* gdb.base/relocate.exp: Add test for "symbol-file -o ".
2018-06-27 Omair Javaid <omair.javaid@linaro.org>
diff --git a/gdb/testsuite/gdb.base/relocate.exp b/gdb/testsuite/gdb.base/relocate.exp
index 77f6a88..2b4c4a7 100644
--- a/gdb/testsuite/gdb.base/relocate.exp
+++ b/gdb/testsuite/gdb.base/relocate.exp
@@ -73,6 +73,21 @@ gdb_test_multiple "add-symbol-file -s .text 0x200 $binfile 0x100" $test {
gdb_test "n" "Not confirmed\." $test
}
}
+# Check that passing a single "-s .text" is equivalent to passing
+# the text address in a positional argument.
+set test "add-symbol-file -s .text, no address"
+gdb_test_multiple "add-symbol-file $binfile -s .text 0x100" $test {
+ -re "add symbol table from file \"${binfile}\" at\r\n\t\.text_addr = 0x100\r\n\\(y or n\\) " {
+ gdb_test "n" "Not confirmed\." $test
+ }
+}
+# Check section addresses can be omitted.
+set test "add-symbol-file no address"
+gdb_test_multiple "add-symbol-file $binfile" $test {
+ -re "add symbol table from file \"${binfile}\"\r\n\\(y or n\\) " {
+ gdb_test "n" "Not confirmed\." $test
+ }
+}
# Test that passing "--" disables option processing.
gdb_test "add-symbol-file -- $binfile 0x100 -s .bss 0x3" \
"Unrecognized argument \"-s\"" \