aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.dwarf2
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/testsuite/gdb.dwarf2')
-rw-r--r--gdb/testsuite/gdb.dwarf2/dw2-canonicalize-type.S17
-rw-r--r--gdb/testsuite/gdb.dwarf2/dw2-canonicalize-type.exp6
-rw-r--r--gdb/testsuite/gdb.dwarf2/dw2-compdir-oldgcc.S11
-rw-r--r--gdb/testsuite/gdb.dwarf2/dw2-compdir-oldgcc.exp6
-rw-r--r--gdb/testsuite/gdb.dwarf2/dw2-minsym-in-cu.S17
-rw-r--r--gdb/testsuite/gdb.dwarf2/dw2-minsym-in-cu.exp6
-rw-r--r--gdb/testsuite/gdb.dwarf2/dw2-op-stack-value.exp3
-rw-r--r--gdb/testsuite/gdb.dwarf2/dw2-unresolved-main.c22
-rw-r--r--gdb/testsuite/gdb.dwarf2/dw2-unresolved.S21
-rw-r--r--gdb/testsuite/gdb.dwarf2/dw2-unresolved.exp7
-rw-r--r--gdb/testsuite/gdb.dwarf2/fission-reread.S27
-rw-r--r--gdb/testsuite/gdb.dwarf2/fission-reread.exp6
-rw-r--r--gdb/testsuite/gdb.dwarf2/pr13961.S17
-rw-r--r--gdb/testsuite/gdb.dwarf2/pr13961.exp6
14 files changed, 134 insertions, 38 deletions
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-canonicalize-type.S b/gdb/testsuite/gdb.dwarf2/dw2-canonicalize-type.S
index 5c93cfc..909d725 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-canonicalize-type.S
+++ b/gdb/testsuite/gdb.dwarf2/dw2-canonicalize-type.S
@@ -13,9 +13,18 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+#define CONCAT1(a, b) CONCAT2(a, b)
+#define CONCAT2(a, b) a ## b
+
+#ifdef SYMBOL_PREFIX
+# define SYMBOL(str) CONCAT1(SYMBOL_PREFIX, str)
+#else
+# define SYMBOL(str) str
+#endif
+
.text
- .globl main
-main:
+ .globl SYMBOL(main)
+SYMBOL(main):
.4byte 0
.Lmain_end:
.section .debug_info
@@ -29,12 +38,12 @@ debug_start:
.ascii "GNU C 4.4.3\0" /* DW_AT_producer */
.byte 0x4 /* DW_AT_language = DW_LANG_C_plus_plus */
.ascii "1.c\0" /* DW_AT_name */
- .4byte main /* DW_AT_low_pc */
+ .4byte SYMBOL(main) /* DW_AT_low_pc */
.4byte .Lmain_end /* DW_AT_high_pc */
.uleb128 0x4 /* (DIE (0x3c) DW_TAG_subprogram) */
.ascii "f\0" /* DW_AT_name */
/* Value 0 would require has_section_at_zero != 0 (which is true, though). */
- .4byte main /* DW_AT_low_pc */
+ .4byte SYMBOL(main) /* DW_AT_low_pc */
.4byte .Lmain_end /* DW_AT_high_pc */
.byte 0x1 /* DW_AT_prototyped */
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-canonicalize-type.exp b/gdb/testsuite/gdb.dwarf2/dw2-canonicalize-type.exp
index c25e18e..94c9813 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-canonicalize-type.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-canonicalize-type.exp
@@ -19,10 +19,14 @@ if {![dwarf2_support]} {
return 0
}
+# Some targets have leading underscores on assembly symbols.
+set additional_flags [gdb_target_symbol_prefix_flags_asm]
+
standard_testfile .S
set executable ${testfile}
-if [prepare_for_testing $testfile.exp $testfile $srcfile {nodebug}] {
+if [prepare_for_testing $testfile.exp $testfile $srcfile \
+ [list nodebug $additional_flags]] {
return -1
}
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-compdir-oldgcc.S b/gdb/testsuite/gdb.dwarf2/dw2-compdir-oldgcc.S
index 2419b0b..711043e 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-compdir-oldgcc.S
+++ b/gdb/testsuite/gdb.dwarf2/dw2-compdir-oldgcc.S
@@ -15,8 +15,17 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+#define CONCAT1(a, b) CONCAT2(a, b)
+#define CONCAT2(a, b) a ## b
+
+#ifdef SYMBOL_PREFIX
+# define SYMBOL(str) CONCAT1(SYMBOL_PREFIX, str)
+#else
+# define SYMBOL(str) str
+#endif
+
.text
-main: .globl main
+SYMBOL(main): .globl SYMBOL(main)
gcc42: .globl gcc42
.Lgcc42_procstart:
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-compdir-oldgcc.exp b/gdb/testsuite/gdb.dwarf2/dw2-compdir-oldgcc.exp
index f23d3a5..beb5dc3 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-compdir-oldgcc.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-compdir-oldgcc.exp
@@ -19,8 +19,12 @@ if {![dwarf2_support]} {
return 0
}
+# Some targets have leading underscores on assembly symbols.
+set additional_flags [gdb_target_symbol_prefix_flags_asm]
+
standard_testfile .S
-if {[prepare_for_testing $testfile.exp $testfile $srcfile]} {
+if {[prepare_for_testing $testfile.exp $testfile $srcfile \
+ $additional_flags]} {
return -1
}
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-minsym-in-cu.S b/gdb/testsuite/gdb.dwarf2/dw2-minsym-in-cu.S
index 8e602ab..74d379f 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-minsym-in-cu.S
+++ b/gdb/testsuite/gdb.dwarf2/dw2-minsym-in-cu.S
@@ -15,16 +15,25 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+#define CONCAT1(a, b) CONCAT2(a, b)
+#define CONCAT2(a, b) a ## b
+
+#ifdef SYMBOL_PREFIX
+# define SYMBOL(str) CONCAT1(SYMBOL_PREFIX, str)
+#else
+# define SYMBOL(str) str
+#endif
+
.text
.Lbegin_text1:
- .globl main
- .type main, %function
-main:
+ .globl SYMBOL(main)
+ .type SYMBOL(main), %function
+SYMBOL(main):
.Lbegin_main:
.int 0
.Lend_main:
- .size main, .-main
+ .size SYMBOL(main), .-SYMBOL(main)
.globl func2
.type func2, %function
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-minsym-in-cu.exp b/gdb/testsuite/gdb.dwarf2/dw2-minsym-in-cu.exp
index 34e514e..5b7bab6 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-minsym-in-cu.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-minsym-in-cu.exp
@@ -21,9 +21,13 @@ if {![dwarf2_support]} {
# This testfile has reproducibility only with cc-with-index.sh.
+# Some targets have leading underscores on assembly symbols.
+set additional_flags [gdb_target_symbol_prefix_flags_asm]
+
standard_testfile .S
-if [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile}] {
+if [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} \
+ ${additional_flags}] {
return -1
}
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-op-stack-value.exp b/gdb/testsuite/gdb.dwarf2/dw2-op-stack-value.exp
index 00e8e36..aacdddb 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-op-stack-value.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-op-stack-value.exp
@@ -19,6 +19,9 @@ if {![dwarf2_support]} {
return 0
}
+# Some targets have leading underscores on assembly symbols.
+set additional_flags [gdb_target_symbol_prefix_flags_asm]
+
standard_testfile .S
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" $binfile \
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-unresolved-main.c b/gdb/testsuite/gdb.dwarf2/dw2-unresolved-main.c
index e9a0fba..1c6d301 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-unresolved-main.c
+++ b/gdb/testsuite/gdb.dwarf2/dw2-unresolved-main.c
@@ -17,6 +17,20 @@
#include <stdlib.h>
+#define CONCAT1(a, b) CONCAT2(a, b)
+#define CONCAT2(a, b) a ## b
+
+#ifdef SYMBOL_PREFIX
+# define SYMBOL1(str) CONCAT1(SYMBOL_PREFIX, str)
+#else
+# define SYMBOL1(str) str
+#endif
+
+#define STR1(s) #s
+#define STR(s) STR1(s)
+
+#define SYMBOL(str) STR(SYMBOL1(str))
+
asm (".globl cu_text_start");
asm ("cu_text_start:");
@@ -31,12 +45,12 @@ main (void)
extern unsigned char var;
/* Do not rely on the `extern' DIE output by GCC (GCC PR debug/39563). */
-asm (".globl extern_block_start");
-asm ("extern_block_start:");
+asm (".globl " SYMBOL(extern_block_start));
+asm (SYMBOL(extern_block_start) ":");
if (var != 2)
abort ();
-asm (".globl extern_block_end");
-asm ("extern_block_end:");
+asm (".globl " SYMBOL(extern_block_end));
+asm (SYMBOL(extern_block_end) ":");
}
return 0;
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-unresolved.S b/gdb/testsuite/gdb.dwarf2/dw2-unresolved.S
index 1cfab89..f70a8cf 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-unresolved.S
+++ b/gdb/testsuite/gdb.dwarf2/dw2-unresolved.S
@@ -15,15 +15,24 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+#define CONCAT1(a, b) CONCAT2(a, b)
+#define CONCAT2(a, b) a ## b
+
+#ifdef SYMBOL_PREFIX
+# define SYMBOL(str) CONCAT1(SYMBOL_PREFIX, str)
+#else
+# define SYMBOL(str) str
+#endif
+
.data
/* VAR1 is wrong here, in the real inferior it is located on stack. As both
places are never modified and they are initialized to the same value it
makes no difference. Ensure the name clash for "var". */
-var1: .byte 1
+SYMBOL(var1): .byte 1
- .globl var
-var: .byte 2
+ .globl SYMBOL(var)
+SYMBOL(var): .byte 2
/* Debug information */
@@ -64,12 +73,12 @@ var: .byte 2
.byte 2f - 1f /* DW_AT_location */
1: .byte 3 /* DW_OP_addr */
/* See VAR1 definition why this DIE is not correct. */
- .4byte var1 /* <addr> */
+ .4byte SYMBOL(var1) /* <addr> */
2: .4byte .Ltype_uchar-.Lcu1_begin /* DW_AT_type */
.uleb128 6 /* Abbrev: DW_TAG_lexical_block */
- .4byte extern_block_start /* DW_AT_low_pc */
- .4byte extern_block_end /* DW_AT_high_pc */
+ .4byte SYMBOL(extern_block_start) /* DW_AT_low_pc */
+ .4byte SYMBOL(extern_block_end) /* DW_AT_high_pc */
.uleb128 5 /* Abbrev: DW_TAG_variable (extern) */
.ascii "var\0" /* DW_AT_name */
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-unresolved.exp b/gdb/testsuite/gdb.dwarf2/dw2-unresolved.exp
index 792b399..ba371b9 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-unresolved.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-unresolved.exp
@@ -19,7 +19,12 @@ if {![dwarf2_support]} {
return 0
}
-if { [prepare_for_testing dw2-unresolved.exp "dw2-unresolved" {dw2-unresolved-main.c dw2-unresolved.S} {nodebug}] } {
+# Some targets have leading underscores on assembly symbols.
+set additional_flags [gdb_target_symbol_prefix_flags_asm]
+
+if { [prepare_for_testing dw2-unresolved.exp "dw2-unresolved" \
+ {dw2-unresolved-main.c dw2-unresolved.S} \
+ [list nodebug $additional_flags]] } {
return -1
}
diff --git a/gdb/testsuite/gdb.dwarf2/fission-reread.S b/gdb/testsuite/gdb.dwarf2/fission-reread.S
index 22cc3aa..3812ede 100644
--- a/gdb/testsuite/gdb.dwarf2/fission-reread.S
+++ b/gdb/testsuite/gdb.dwarf2/fission-reread.S
@@ -38,27 +38,36 @@
further hand-edited to support that.
*/
+#define CONCAT1(a, b) CONCAT2(a, b)
+#define CONCAT2(a, b) a ## b
+
+#ifdef SYMBOL_PREFIX
+# define SYMBOL(str) CONCAT1(SYMBOL_PREFIX, str)
+#else
+# define SYMBOL(str) str
+#endif
+
.file "fission-reread.cc"
- .globl baz
+ .globl SYMBOL(baz)
.data /* Previously this used .bss, but it's not portable. */
.align 4
- .type baz, %object
- .size baz, 4
-baz:
+ .type SYMBOL(baz), %object
+ .size SYMBOL(baz), 4
+SYMBOL(baz):
.zero 4
.text
.Ltext0:
- .globl main
- .type main, %function
-main:
+ .globl SYMBOL(main)
+ .type SYMBOL(main), %function
+SYMBOL(main):
.LFB0:
.file 1 "fission-reread.cc"
.loc 1 11 0
.4byte 0
.LFE0:
- .size main, .-main
+ .size SYMBOL(main), .-SYMBOL(main)
.Letext0:
.section .debug_types.dwo
@@ -450,4 +459,4 @@ main:
.section .debug_addr
.Ldebug_addr0:
.4byte .LFB0 /* DW_AT_low_pc */
- .4byte baz /* DW_AT_location */
+ .4byte SYMBOL(baz) /* DW_AT_location */
diff --git a/gdb/testsuite/gdb.dwarf2/fission-reread.exp b/gdb/testsuite/gdb.dwarf2/fission-reread.exp
index bcd0196..ec93902 100644
--- a/gdb/testsuite/gdb.dwarf2/fission-reread.exp
+++ b/gdb/testsuite/gdb.dwarf2/fission-reread.exp
@@ -25,10 +25,14 @@ if ![dwarf2_support] {
return 0
}
+# Some targets have leading underscores on assembly symbols.
+set additional_flags [gdb_target_symbol_prefix_flags_asm]
+
standard_testfile .S
if [build_executable_from_fission_assembler \
- "$testfile.exp" "$binfile" "$srcfile" {nodebug}] {
+ "$testfile.exp" "$binfile" "$srcfile" \
+ [list nodebug $additional_flags]] {
return -1
}
diff --git a/gdb/testsuite/gdb.dwarf2/pr13961.S b/gdb/testsuite/gdb.dwarf2/pr13961.S
index 9d76438..0bff742 100644
--- a/gdb/testsuite/gdb.dwarf2/pr13961.S
+++ b/gdb/testsuite/gdb.dwarf2/pr13961.S
@@ -37,6 +37,15 @@
further hand-edited to support that.
*/
+#define CONCAT1(a, b) CONCAT2(a, b)
+#define CONCAT2(a, b) a ## b
+
+#ifdef SYMBOL_PREFIX
+# define SYMBOL(str) CONCAT1(SYMBOL_PREFIX, str)
+#else
+# define SYMBOL(str) str
+#endif
+
.file "pr13961.cc"
.globl baz
@@ -55,13 +64,13 @@ baz:
.text
.Ltext0:
- .globl main
- .type main, %function
-main:
+ .globl SYMBOL(main)
+ .type SYMBOL(main), %function
+SYMBOL(main):
.LFB0:
.4byte 0
.LFE0:
- .size main, .-main
+ .size SYMBOL(main), .-SYMBOL(main)
.Letext0:
.section .debug_types,"",%progbits
diff --git a/gdb/testsuite/gdb.dwarf2/pr13961.exp b/gdb/testsuite/gdb.dwarf2/pr13961.exp
index 850b45d..f62e34b 100644
--- a/gdb/testsuite/gdb.dwarf2/pr13961.exp
+++ b/gdb/testsuite/gdb.dwarf2/pr13961.exp
@@ -22,9 +22,13 @@ if {![dwarf2_support]} {
return 0
}
+# Some targets have leading underscores on assembly symbols.
+set additional_flags [gdb_target_symbol_prefix_flags_asm]
+
standard_testfile .S
-if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile}] == -1 } {
+if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} \
+ ${additional_flags}] == -1 } {
return -1
}