From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16204 invoked by alias); 1 Jul 2011 00:24:58 -0000 Received: (qmail 16196 invoked by uid 22791); 1 Jul 2011 00:24:57 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from smtp.gentoo.org (HELO smtp.gentoo.org) (140.211.166.183) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 01 Jul 2011 00:24:41 +0000 Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with ESMTP id 1C9431B405F; Fri, 1 Jul 2011 00:24:40 +0000 (UTC) From: Mike Frysinger To: gdb-patches@sourceware.org Cc: toolchain-devel@blackfin.uclinux.org, Jie Zhang Subject: [PATCH/RFC] gdb: tests: add support for testing FLAT toolchains Date: Fri, 01 Jul 2011 00:24:00 -0000 Message-Id: <1309479881-10550-1-git-send-email-vapier@gentoo.org> In-Reply-To: <201003182126.17119.vapier@gentoo.org> References: <201003182126.17119.vapier@gentoo.org> X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2011-07/txt/msg00001.txt.bz2 From: Jie Zhang 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. This restarts an old thread and implements things as suggested by Daniel Jacobowitz: http://sourceware.org/ml/gdb-patches/2010-03/msg00648.html Pretty sure this works (I'll double check), but I want to make sure this is going in the direction people are OK with. Signed-off-by: Jie Zhang Signed-off-by: Mike Frysinger --- gdb/testsuite/lib/gdb.exp | 22 +++++++++++++++++++++- 1 files changed, 21 insertions(+), 1 deletions(-) diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index dc16cfa..091b271 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -2091,6 +2091,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 "" @@ -2286,6 +2296,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; } @@ -2762,7 +2782,7 @@ proc gdb_touch_execfile { binfile } { proc gdb_download { filename } { global cleanfiles - set destname [remote_download target $filename] + set destname [remote_download target [gdb_get_exec_name $filename]] lappend cleanfiles $destname return $destname } -- 1.7.6