aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.dwarf2/dw2-using-debug-str.c
diff options
context:
space:
mode:
authorAndrew Burgess <andrew.burgess@embecosm.com>2021-03-17 18:07:32 +0000
committerAndrew Burgess <andrew.burgess@embecosm.com>2021-03-22 10:00:19 +0000
commit1e7fcccb8d6d0a6bd295a50400c553cc595250f1 (patch)
treeb4a2d6cc035441ab202427c8d71ab309d465ca68 /gdb/testsuite/gdb.dwarf2/dw2-using-debug-str.c
parentd171632faa9f563f47224e0f6214f8860ed7bcc4 (diff)
downloadbinutils-1e7fcccb8d6d0a6bd295a50400c553cc595250f1.zip
binutils-1e7fcccb8d6d0a6bd295a50400c553cc595250f1.tar.gz
binutils-1e7fcccb8d6d0a6bd295a50400c553cc595250f1.tar.bz2
gdb/testsuite: use the correct .debug_str section name for DW_FORM_strp
When handling DWARF attributes of the form DW_FORM_strp the strings should be placed in the .debug_str section, not .debug_string as they currently are by the DWARF assembler (in lib/dwarf.exp). I've added a test. This is as much to test the DWARF generator as it is to test GDB as GCC makes frequent use of DW_FORM_strp so we can be pretty sure this part of GDB is already well tested. gdb/testsuite/ChangeLog: * gdb.dwarf2/dw2-using-debug-str.c: New file. * gdb.dwarf2/dw2-using-debug-str.exp: New file. * lib/dwarf.exp (Dwarf::DW_FORM_strp): Create .debug_str section, not .debug_string.
Diffstat (limited to 'gdb/testsuite/gdb.dwarf2/dw2-using-debug-str.c')
-rw-r--r--gdb/testsuite/gdb.dwarf2/dw2-using-debug-str.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-using-debug-str.c b/gdb/testsuite/gdb.dwarf2/dw2-using-debug-str.c
new file mode 100644
index 0000000..27f7f0d
--- /dev/null
+++ b/gdb/testsuite/gdb.dwarf2/dw2-using-debug-str.c
@@ -0,0 +1,28 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2021 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+/* Our fake object. */
+int global_var[100];
+
+int
+main (int argc, char **argv)
+{
+ asm ("main_label: .globl main_label");
+
+ return 0;
+}