aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/lib/gdb.exp
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/testsuite/lib/gdb.exp')
-rw-r--r--gdb/testsuite/lib/gdb.exp38
1 files changed, 32 insertions, 6 deletions
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index 3349da7..59967c7 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -2799,6 +2799,12 @@ gdb_caching_proc allow_python_tests {} {
return [expr {[string first "--with-python" $output] != -1}]
}
+# Return a 1 if GDB was configured to support compile commands.
+gdb_caching_proc allow_compile_tests {} {
+ set output [remote_exec host $::GDB "$::INTERNAL_GDBFLAGS -ex \"compile int x = 1\" -batch"]
+ return [expr {[string first "The program must be running" $output] != -1}]
+}
+
# Return a 1 for configurations that use system readline rather than the
# in-repo copy.
@@ -3931,13 +3937,16 @@ gdb_caching_proc is_aarch32_target {} {
return 0
}
- set list {}
- foreach reg \
- {r0 r1 r2 r3} {
- lappend list "\tmov $reg, $reg"
- }
+ return [gdb_can_simple_compile aarch32 {
+ int main (void) {
+ asm ("\tmov r0, r0");
+ asm ("\tmov r1, r1");
+ asm ("\tmov r2, r2");
+ asm ("\tmov r3, r3");
- return [gdb_can_simple_compile aarch32 [join $list \n]]
+ return 0;
+ }
+ }]
}
# Return 1 if this target is an aarch64, either lp64 or ilp32.
@@ -5940,6 +5949,23 @@ proc gdb_compile {source dest type options} {
}
}
+ # On AIX systems, until GCC 12 (maybe later), stabs was the default
+ # debug option, but we'd like to have dwarf instead.
+ # If we're running on one of those systems and debug was requested,
+ # but no explicit -g<format> option was given, use -gdwarf to force
+ # that as the debug info for the inferior.
+ # This list should be exhaustive:
+ set debug_format "btf|ctf|stabs|vms|coff|xcoff"
+ # Since additional_flags is a comma separated list, identify if there
+ # are other (optional) flags in the list.
+ set other_options "-\[a-zA-Z0-9\]*,"
+ set full_regexp "^additional_flags=\($other_options\)*-g\($debug_format\)"
+ if { [istarget *-*-aix*]
+ && [lsearch -exact $options debug] != -1
+ && [lsearch -regexp $options $full_regexp] == -1} {
+ lappend new_options "additional_flags=-gdwarf"
+ }
+
set shlib_found 0
set shlib_load 0
foreach opt $options {