From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5327 invoked by alias); 13 Jun 2006 13:13:09 -0000 Received: (qmail 5311 invoked by uid 22791); 13 Jun 2006 13:13:07 -0000 X-Spam-Check-By: sourceware.org Received: from potter.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 13 Jun 2006 13:13:04 +0000 Received: (qmail 28367 invoked from network); 13 Jun 2006 13:13:02 -0000 Received: from unknown (HELO ?192.168.189.145?) (nathan@127.0.0.2) by mail.codesourcery.com with ESMTPA; 13 Jun 2006 13:13:02 -0000 Message-ID: <448EB9AF.3040002@codesourcery.com> Date: Tue, 13 Jun 2006 13:13:00 -0000 From: Nathan Sidwell User-Agent: Mozilla Thunderbird 1.0.8 (X11/20060502) MIME-Version: 1.0 To: gdb-patches@sourceware.org Subject: add gdb_load_cmd to test harness Content-Type: multipart/mixed; boundary="------------050407030903000706080908" Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-06/txt/msg00179.txt.bz2 This is a multi-part message in MIME format. --------------050407030903000706080908 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 505 This patch adds a gdb_load_cmd procedure to the test harness. It's useful to have this as a separate component so that a target specific gdb_load procedure can be built up. There are some instances in the testsuite/config directory that could be simplified by using this -- I've not done so, because I cannot easily test them. ok? nathan -- Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery nathan@codesourcery.com :: http://www.planetfall.pwp.blueyonder.co.uk --------------050407030903000706080908 Content-Type: text/x-patch; name="support-2.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="support-2.patch" Content-length: 1692 2006-06-13 Nathan Sidwell gdb/testsuite/ * lib/gdb.exp (gdb_load_cmd): New. Index: gdb/testsuite/lib/gdb.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/lib/gdb.exp,v retrieving revision 1.64.10.1 diff -c -3 -p -r1.64.10.1 gdb.exp *** gdb/testsuite/lib/gdb.exp 7 Mar 2006 15:48:34 -0000 1.64.10.1 --- gdb/testsuite/lib/gdb.exp 13 Jun 2006 07:31:34 -0000 *************** proc gdb_exit { } { *** 1867,1872 **** --- 1867,1916 ---- } # + # gdb_load_cmd -- load a file into the debugger. + # ARGS - additional args to load command. + # return a -1 if anything goes wrong. + # + proc gdb_load_cmd { args } { + global gdb_prompt + + if [target_info exists gdb_load_timeout] { + set loadtimeout [target_info gdb_load_timeout] + } else { + set loadtimeout 1600 + } + send_gdb "load $args\n" + verbose "Timeout is now $timeout seconds" 2 + gdb_expect $loadtimeout { + -re "Loading section\[^\r\]*\r\n" { + exp_continue + } + -re "Start address\[\r\]*\r\n" { + exp_continue + } + -re "Transfer rate\[\r\]*\r\n" { + exp_continue + } + -re "Memory access error\[^\r\]*\r\n" { + perror "Failed to load program" + return -1 + } + -re "$gdb_prompt $" { + return 0 + } + -re "(.*)\r\n$gdb_prompt " { + perror "Unexpected reponse from 'load' -- $expect_out(1,string)" + return -1 + } + timeout { + perror "Timed out trying to load $arg." + return -1 + } + } + return -1 + } + + # # gdb_load -- load a file into the debugger. # Many files in config/*.exp override this procedure. # --------------050407030903000706080908--