Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@false.org>
To: Andrew Cagney <cagney@gnu.org>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [RFC] XFAIL bigcore.exp on some GNU/Linux targets
Date: Wed, 21 Apr 2004 14:59:00 -0000	[thread overview]
Message-ID: <20040421145951.GB4980@nevyn.them.org> (raw)
In-Reply-To: <40855D55.7000708@gnu.org>

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


  reply	other threads:[~2004-04-21 14:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-17 21:42 Daniel Jacobowitz
2004-04-21 14:55 ` Andrew Cagney
2004-04-21 14:59   ` Daniel Jacobowitz [this message]
2004-05-10 16:49     ` Daniel Jacobowitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040421145951.GB4980@nevyn.them.org \
    --to=drow@false.org \
    --cc=cagney@gnu.org \
    --cc=gdb-patches@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox