From 4644fcb7fc37cadb614f90044a73c23f088c809b Mon Sep 17 00:00:00 2001 From: Jie Zhang Date: Wed, 10 Mar 2010 10:16:37 -0500 Subject: [PATCH] gdb: tests: add support for testing FLAT toolchains FLAT toolchains output a FLAT binary for the named output and create another file with a .gdb suffix that is used for debugging. So when testing a FLAT toolchain and we need to load up a file, use the .gdb. Signed-off-by: Jie Zhang Signed-off-by: Mike Frysinger --- gdb/testsuite/lib/gdb.exp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index 3e0a46445ca..b3e904cb02f 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -4536,6 +4536,16 @@ proc current_target_name { } { return $answer } +proc gdb_get_exec_name { binfile } { + # FLAT toolchains have to load the .flt file to the board + if { [target_info exists use_binfmt_flat] + && [file exists "${binfile}.flt"] } { + return "${binfile}.flt" + } else { + return ${binfile} + } +} + set gdb_wrapper_initialized 0 set gdb_wrapper_target "" set gdb_wrapper_file "" @@ -5023,6 +5033,16 @@ proc gdb_compile {source dest type options} { clone_output "gdb compile failed, $result" } } + + # FLAT toolchains output a bFLT file with the default name and create + # a secondary ELF file with a .gdb suffix. GDB needs the ELF file in + # order to do debugging, so flip-flop things. + if { [target_info exists use_binfmt_flat] + && [file exists "${dest}.gdb"] } { + file rename -force "${dest}" "${dest}.flt" + file rename -force "${dest}.gdb" "${dest}" + } + return $result } -- 2.47.2