From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10825 invoked by alias); 3 Dec 2004 18:57:16 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 10779 invoked from network); 3 Dec 2004 18:57:12 -0000 Received: from unknown (HELO nevyn.them.org) (66.93.172.17) by sourceware.org with SMTP; 3 Dec 2004 18:57:12 -0000 Received: from drow by nevyn.them.org with local (Exim 4.34 #1 (Debian)) id 1CaIbw-0002Rf-TQ; Fri, 03 Dec 2004 13:56:57 -0500 Date: Fri, 03 Dec 2004 18:57:00 -0000 From: Daniel Jacobowitz To: Randolph Chung Cc: Andrew Cagney , gdb-patches@sources.redhat.com Subject: Re: [patch/RFA] multiarch INSTRUCTION_NULLIFIED Message-ID: <20041203185656.GA9320@nevyn.them.org> Mail-Followup-To: Randolph Chung , Andrew Cagney , gdb-patches@sources.redhat.com References: <41AC88B2.5070501@gnu.org> <20041130164401.GV6359@tausq.org> <41ACA6BE.5080603@gnu.org> <20041130173841.GW6359@tausq.org> <41AE3759.3030503@gnu.org> <20041201223243.GK6359@tausq.org> <41AE5434.9050901@gnu.org> <20041202052417.GM6359@tausq.org> <41B0ABC7.4020806@gnu.org> <20041203181505.GF6359@tausq.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041203181505.GF6359@tausq.org> User-Agent: Mutt/1.5.5.1+cvs20040105i X-SW-Source: 2004-12/txt/msg00078.txt.bz2 On Fri, Dec 03, 2004 at 10:15:05AM -0800, Randolph Chung wrote: > > Anyway, more relevant, and as daniel asked, can it be done in assember? > > A starting point for that might be the gdb.asm test case which uses > > assembly source code. > > i'm working on it, but getting stuck with a weird problem... i'm seeing > a case where i do: > > proc get_addr_of_sym { sym } { > set addr 0 > global gdb_prompt > global expect_out Not sure but I don't think you need to declare expect_out as a global. > send_gdb "print $sym\n" > gdb_expect 60 { > -re ".*($hex) <$sym>.*$gdb_prompt $" { > set addr $expect_out(1,string) > pass "got address of $sym = $addr" > } > timeout { > fail "cannot get address of $sym (timed out)." > gdb_suppress_tests > } > } > > return $addr > } > > set foo [get_addr_of_sym "foo"] > set bar [get_addr_of_sym "bar"] > > i always get a FAIL on that, and from looking at the log (with --debug) > it seems like the gdb_expect is returning immediately without checking > for results from the previous send_gdb command.... > > viz: > send: sending "print foo\n" to { exp11 }^M > FAIL: gdb.arch/pa-nullify.exp: cannot get address of foo (timed out). > send: sending "print bar\n" to { exp11 }^M > FAIL: gdb.arch/pa-nullify.exp: cannot get address of bar (timed out). > > am i doing something obviously wrong? First, as Andrew mentioned, don't use gdb_expect this way. Use gdb_test_multiple. Secondly, there are two possible causes of this. One is a syntax error, in either the regular expression or the code for the matching case. That will invoke the "timeout" handler. The other is that you've gotten out of sync somehow; doesn't look too likely from the above. Try putting "exp_internal 1" in front of it to see what expect thinks it is doing. I just saw the bug: try "global hex" and see if that helps. -- Daniel Jacobowitz