From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14687 invoked by alias); 13 Nov 2012 12:56:43 -0000 Received: (qmail 14676 invoked by uid 22791); 13 Nov 2012 12:56:42 -0000 X-SWARE-Spam-Status: No, hits=-7.7 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 13 Nov 2012 12:56:32 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id qADCuV6W020693 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 13 Nov 2012 07:56:31 -0500 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id qADCuTXk013799; Tue, 13 Nov 2012 07:56:30 -0500 Message-ID: <50A2437D.7080301@redhat.com> Date: Tue, 13 Nov 2012 12:56:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121029 Thunderbird/16.0.2 MIME-Version: 1.0 To: Tom Tromey CC: gdb-patches@sourceware.org Subject: Re: RFA: handle "MiniDebuginfo" section References: <87wqxuel5k.fsf@fleche.redhat.com> <509D47B5.6020302@redhat.com> <87haoycvqi.fsf@fleche.redhat.com> In-Reply-To: <87haoycvqi.fsf@fleche.redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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: 2012-11/txt/msg00310.txt.bz2 On 11/09/2012 09:27 PM, Tom Tromey wrote: > Pedro> Seems like this won't work with remote hosts as is. Can we make > Pedro> it use "remote_file host delete", "remote_spawn host", etc.? If > Pedro> not, perhaps just bail early if [is_remote host]. > > FWIW, I took a stab at this, using the appended patch. > However, I could not get it to work. I always get an error: > > ERROR: bad spawn_id (process died earlier?) > while executing > "expect { > -i $spawn_id -timeout $timeout -re ".+" { > append output $expect_out(buffer) > if { [string length $output] < 512000 } { > exp_contin..." > (procedure "local_exec" line 94) > invoked from within > [...] > > > I don't know if this is my bug, or dejagnu's, or expect's -- but I > couldn't find a way to work around it. I did some experimenting, and found that the problem is in args passed to remote_exec. Specifically, leaving input empty, while specifying an output at the same time. Using "/dev/null" instead works. See patch below. I wondered if /dev/null would work on Windows, so I did a google search for remote_exec and /dev/null, and found that returns hits in the binutils testsuite, ... testsuite/lib/ld-lib.exp:70: remote_exec host "$ld --version" "" "/dev/null" "ld.version" testsuite/lib/ld-lib.exp:91: set status [remote_exec host [concat sh -c [list "$prog $command 2>&1"]] "" "/dev/null" "ld.tmp"] testsuite/lib/ld-lib.exp:299: set status [remote_exec host [concat sh -c [list "$cc $flags $ccflags -c $source -o $object 2>&1"]] "" "/dev/null" "ld.tmp"] ... so that does sound like the way to go. In sum, OK: remote_exec host program "" "/dev/null" "output" Not OK: remote_exec host program "" "" "output" I see one FAIL though. Exactly the same with your original patch that didn't do any remote_exec stuff, and with the fixed remote_exec stuff: (gdb) kill The program is not being run. (gdb) file /home/pedro/gdb/mygit/build/gdb/testsuite/gdb.dwarf2/dw2-gnu-debugdata.test Reading symbols from /home/pedro/gdb/mygit/build/gdb/testsuite/gdb.dwarf2/dw2-gnu-debugdata.test...(no debugging symbols found)...done. (gdb) p debugdata_function No symbol table is loaded. Use the "file" command. (gdb) FAIL: gdb.dwarf2/dw2-gnu-debugdata.exp: have symtab testcase ../../../src/gdb/testsuite/gdb.dwarf2/dw2-gnu-debugdata.exp completed in 1 seconds I haven't tried your new updated patch yet. gdb/testsuite/gdb.dwarf2/dw2-gnu-debugdata.exp | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/gdb/testsuite/gdb.dwarf2/dw2-gnu-debugdata.exp b/gdb/testsuite/gdb.dwarf2/dw2-gnu-debugdata.exp index 85391e6..8aaf97f 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-gnu-debugdata.exp +++ b/gdb/testsuite/gdb.dwarf2/dw2-gnu-debugdata.exp @@ -24,19 +24,24 @@ if [build_executable ${testfile}.exp $testfile] { return -1 } -source /tmp/remote.exp - -set pipeline_counter 0 - # A wrapper for 'remote_exec host' that passes or fails a test. # Returns 0 if all went well, nonzero on failure. # TEST is the name of the test, other arguments are as for # remote_exec. proc run {test program args} { verbose -log "cmdline is remote_exec host $program $args" - set result [eval remote_exec host [list $program] $args] + + # "" -> "/dev/null" + if { [llength $args] > 1 } { + if {[lindex $args 1] == ""} { + set args [lreplace $args 1 1 "/dev/null"] + } + } + + set result [eval remote_exec host $program $args] + verbose "result is $result" - lassign $result output status + lassign $result status output if {$status == 0} { pass $test return 0 @@ -54,7 +59,7 @@ proc run {test program args} { # Each program in the pipeline takes its input from the previous # program's output. proc pipeline {test args} { - global pipeline_counter + set pipeline_counter 0 set input_file {} foreach arglist $args { @@ -68,7 +73,7 @@ proc pipeline {test args} { set output pipe.[pid].$pipeline_counter incr pipeline_counter } - verbose -log "cooked args are [list $program $arguments $input $output]" + verbose -log "cooked args are: $program [list $arguments $input $output]" if {[run "$test - invoke $program" $program $arguments \ $input $output]} {