From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17606 invoked by alias); 21 Apr 2004 14:59:53 -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 17566 invoked from network); 21 Apr 2004 14:59:52 -0000 Received: from unknown (HELO nevyn.them.org) (66.93.172.17) by sources.redhat.com with SMTP; 21 Apr 2004 14:59:52 -0000 Received: from drow by nevyn.them.org with local (Exim 4.32 #1 (Debian)) id 1BGJCZ-0001JM-8W; Wed, 21 Apr 2004 10:59:51 -0400 Date: Wed, 21 Apr 2004 14:59:00 -0000 From: Daniel Jacobowitz To: Andrew Cagney Cc: gdb-patches@sources.redhat.com Subject: Re: [RFC] XFAIL bigcore.exp on some GNU/Linux targets Message-ID: <20040421145951.GB4980@nevyn.them.org> Mail-Followup-To: Andrew Cagney , gdb-patches@sources.redhat.com References: <20040417214254.GA14000@nevyn.them.org> <40855D55.7000708@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <40855D55.7000708@gnu.org> User-Agent: Mutt/1.5.5.1+cvs20040105i X-SW-Source: 2004-04/txt/msg00486.txt.bz2 On Tue, Apr 20, 2004 at 01:26:45PM -0400, Andrew Cagney wrote: > Why not ask the program the heap size? it's in total_allocated, just > make that a static. Duh. I'll update the patch to do that before I check it in. > > >+# Traverse part of bigcore's linked list of memory chunks, finding the > >total > >+# size. Note that we use GDB to do the math; TCL is not reliable with > >+# extremely large integers. > >+ > >+proc heap_size { } { > >+ global gdb_prompt > >+ global expect_out > >+ set test "find heap size" > >+ set lim 0 > >+ gdb_test "set \$size = 0" "" > >+ gdb_test_multiple "print heap.next" "$test" { > >+ -re " = \\(struct list \\*\\) 0x0.*$gdb_prompt $" { > >+ pass "$test" > >+ } > >+ -re " = \\(struct list \\*\\) (0x\[0-9a-f\]*).*$gdb_prompt $" { > >+ if { $lim >= 50 } { > >+ pass "$test (stop at $lim)" > >+ } else { > >+ incr lim > >+ gdb_test "set \$size = \$size + \$.size" "" > >+ send_gdb "print \$.next\n" > >+ exp_continue > >+ } > >+ } > >+ -re ".*$gdb_prompt $" { > >+ fail "$test (entry $lim)" > >+ } > >+ timeout { > >+ fail "$test (timeout)" > >+ } > >+ } > >+ gdb_test_multiple "print \$size" "print \$size" { > >+ -re " = (\[0-9\]*)\r\n$gdb_prompt $" { > >+ set size $expect_out(1,string) > >+ pass "print \$size" > >+ } > >+ } > >+ return $size; > >+} > >+ > > > Andrew > > -- Daniel Jacobowitz MontaVista Software Debian GNU/Linux Developer