From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29642 invoked by alias); 14 Mar 2010 20:50:52 -0000 Received: (qmail 29630 invoked by uid 22791); 14 Mar 2010 20:50:51 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00 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; Sun, 14 Mar 2010 20:50:44 +0000 Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with ESMTP id 7C2451B4019; Sun, 14 Mar 2010 20:50:42 +0000 (UTC) From: Mike Frysinger To: gdb-patches@sourceware.org Cc: Jie Zhang Subject: [PATCH] gdb: tests/mi-support: use gdb_load_timeout when loading Date: Sun, 14 Mar 2010 20:50:00 -0000 Message-Id: <1268599940-25337-1-git-send-email-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: 2010-03/txt/msg00505.txt.bz2 From: Jie Zhang Rather than hardcoding the timeout value, used the already existing configuration option. Signed-off-by: Jie Zhang Signed-off-by: Mike Frysinger --- 2010-03-14 Jie Zhang * lib/mi-support.exp (mi_gdb_target_load): Delete unused timeout var. Declare and use new loadtimeout variable. gdb/testsuite/lib/mi-support.exp | 27 ++++++++++++++++----------- 1 files changed, 16 insertions(+), 11 deletions(-) diff --git a/gdb/testsuite/lib/mi-support.exp b/gdb/testsuite/lib/mi-support.exp index ec60ef9..e1dbd19 100644 --- a/gdb/testsuite/lib/mi-support.exp +++ b/gdb/testsuite/lib/mi-support.exp @@ -462,7 +462,12 @@ proc mi_gdb_target_load { } { global loadfile global GDB global mi_gdb_prompt - upvar timeout timeout + + if [target_info exists gdb_load_timeout] { + set loadtimeout [target_info gdb_load_timeout] + } else { + set loadtimeout 1600 + } if { [info procs gdbserver_gdb_load] != "" } { mi_gdb_test "kill" ".*" "" @@ -480,40 +485,40 @@ proc mi_gdb_target_load { } { -re ".*$mi_gdb_prompt$" } send_target_sid - gdb_expect 60 { + gdb_expect $loadtimeout { -re "\\^done.*$mi_gdb_prompt$" { } timeout { - perror "Unable to connect to SID target" + perror "Unable to connect to SID target (timeout)" return -1 } } send_gdb "48-target-download\n" - gdb_expect 10 { + gdb_expect $loadtimeout { -re "48\\^done.*$mi_gdb_prompt$" { } timeout { - perror "Unable to download to SID target" + perror "Unable to download to SID target (timeout)" return -1 } } } elseif { [target_info protocol] == "sim" } { # For the simulator, just connect to it directly. send_gdb "47-target-select sim\n" - gdb_expect 10 { + gdb_expect $loadtimeout { -re "47\\^connected.*$mi_gdb_prompt$" { } timeout { - perror "Unable to select sim target" + perror "Unable to select sim target (timeout)" return -1 } } send_gdb "48-target-download\n" - gdb_expect 10 { + gdb_expect $loadtimeout { -re "48\\^done.*$mi_gdb_prompt$" { } timeout { - perror "Unable to download to sim target" + perror "Unable to download to sim target (timeout)" return -1 } } @@ -524,11 +529,11 @@ proc mi_gdb_target_load { } { return -1 } send_gdb "48-target-download\n" - gdb_expect 10 { + gdb_expect $loadtimeout { -re "48\\^done.*$mi_gdb_prompt$" { } timeout { - perror "Unable to download to remote target" + perror "Unable to download to remote target (timeout)" return -1 } } -- 1.7.0