diff options
author | Jie Zhang <jie@codesourcery.com> | 2010-03-10 10:16:37 -0500 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2022-11-11 01:44:12 +0700 |
commit | 4644fcb7fc37cadb614f90044a73c23f088c809b (patch) | |
tree | 48f8065227b4f069201cc1f8535213e7c024ab9a | |
parent | 714e2151f4354feaff065879c01347431bb37861 (diff) | |
download | gdb-4644fcb7fc37cadb614f90044a73c23f088c809b.zip gdb-4644fcb7fc37cadb614f90044a73c23f088c809b.tar.gz gdb-4644fcb7fc37cadb614f90044a73c23f088c809b.tar.bz2 |
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 <jie@codesourcery.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
-rw-r--r-- | gdb/testsuite/lib/gdb.exp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index 3e0a464..b3e904c 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 } |