From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29745 invoked by alias); 5 Jun 2011 21:34:56 -0000 Received: (qmail 29560 invoked by uid 22791); 5 Jun 2011 21:34:56 -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; Sun, 05 Jun 2011 21:34:37 +0000 Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with ESMTP id 2E2C12AC02B; Sun, 5 Jun 2011 21:34:36 +0000 (UTC) From: Mike Frysinger To: gdb-patches@sourceware.org Cc: toolchain-devel@blackfin.uclinux.org, Jie Zhang Subject: [PATCH] gdb: tests/monitor: set remotetimeout to gdb_load_timeout for remote targets Date: Sun, 05 Jun 2011 21:34:00 -0000 Message-Id: <1307309678-10966-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: 2011-06/txt/msg00083.txt.bz2 From: Jie Zhang Rather than relying on the default remotetimeout value (which might be too small for some slower devices), use the existing gdb_load_timeout config option to set it. Signed-off-by: Jie Zhang Signed-off-by: Mike Frysinger --- gdb/testsuite/config/monitor.exp | 47 +++++++++++++++++++++++++++++++++++++- 1 files changed, 46 insertions(+), 1 deletions(-) diff --git a/gdb/testsuite/config/monitor.exp b/gdb/testsuite/config/monitor.exp index be98f1a..9efaf39 100644 --- a/gdb/testsuite/config/monitor.exp +++ b/gdb/testsuite/config/monitor.exp @@ -138,6 +138,7 @@ proc gdb_load { arg } { global gdb_prompt global timeout global last_gdb_file; + global decimal if { $arg == "" } { if [info exists last_gdb_file] { @@ -226,6 +227,32 @@ proc gdb_load { arg } { set loadtimeout 1600 } + if [is_remote target] { + send_gdb "show remotetimeout\n" + gdb_expect { + -re "Timeout limit to wait for target to respond is ($decimal).*$gdb_prompt $" { + set oldremotetimeout $expect_out(1,string); + } + timeout { + if { $verbose > 1 } { + perror "Timed out trying to get remotetimeout." + } + } + } + send_gdb "set remotetimeout $loadtimeout\n"; + gdb_expect { + -re "$gdb_prompt $" { + verbose "Set remotetimeout to $loadtimeout\n" + } + timeout { + if { $verbose > 1 } { + perror "Timed out trying to set remotetimeout." + } + } + } + } + + set load_ok 0 send_gdb $command; gdb_expect $loadtimeout { -re "\[Ff\]ailed.*$gdb_prompt $" { @@ -235,7 +262,7 @@ proc gdb_load { arg } { } -re "$gdb_prompt $" { verbose "Loaded $farg into $GDB\n" - return 0; + set load_ok 1 } timeout { if { $verbose > 1 } { @@ -243,6 +270,24 @@ proc gdb_load { arg } { } } } + + if [is_remote target] { + send_gdb "set remotetimeout $oldremotetimeout\n"; + gdb_expect { + -re "$gdb_prompt $" { + verbose "Set remotetimeout to $oldremotetimeout\n" + } + timeout { + if { $verbose > 1 } { + perror "Timed out trying to set remotetimeout." + } + } + } + } + + if { $load_ok == 1 } { + return 0; + } } # Make sure we don't have an open connection to the target. -- 1.7.5.3