diff options
Diffstat (limited to 'gdb/testsuite/lib')
-rw-r--r-- | gdb/testsuite/lib/ada.exp | 27 | ||||
-rw-r--r-- | gdb/testsuite/lib/gdb.exp | 15 |
2 files changed, 37 insertions, 5 deletions
diff --git a/gdb/testsuite/lib/ada.exp b/gdb/testsuite/lib/ada.exp index ee9ade1..1345c74 100644 --- a/gdb/testsuite/lib/ada.exp +++ b/gdb/testsuite/lib/ada.exp @@ -78,3 +78,30 @@ proc standard_ada_testfile {base_file {dir ""}} { set srcfile $srcdir/$subdir/$testdir/$testfile.adb set binfile [standard_output_file $testfile] } + +# A helper function to find the appropriate version of a tool. +# TOOL is the tool's name, e.g., "gnatbind" or "gnatlink". + +proc find_ada_tool {tool} { + set upper [string toupper $tool] + + set targname ${upper}_FOR_TARGET + global $targname + if {[info exists $targname]} { + return $targname + } + + global tool_root_dir + set root "$tool_root_dir/gcc" + set result "" + + if {![is_remote host]} { + set result [lookfor_file $root $tool] + } + + if {$result == ""} { + set result [transform $tool] + } + + return $result +} diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index 25d370e..57866da 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -3832,11 +3832,16 @@ proc gdb_compile_shlib {sources dest options} { set outdir [file dirname $dest] set objects "" foreach source $sources { - set sourcebase [file tail $source] - if {[gdb_compile $source "${outdir}/${sourcebase}.o" object $obj_options] != ""} { - return -1 - } - lappend objects ${outdir}/${sourcebase}.o + set sourcebase [file tail $source] + if {[file extension $source] == ".o"} { + # Already a .o file. + lappend objects $source + } elseif {[gdb_compile $source "${outdir}/${sourcebase}.o" object \ + $obj_options] != ""} { + return -1 + } else { + lappend objects ${outdir}/${sourcebase}.o + } } set link_options $options |