Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion How do I write a language debugger?

Newsgroups: perl.perl6.internals
Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!nntp.perl.org
Return-Path: <ben.goldb...@hotpop.com>
Mailing-List: contact perl6-internals-h...@perl.org; run by ezmlm
Delivered-To: mailing list perl6-intern...@perl.org
To: perl6-intern...@perl.org
Message-ID: <3EE94089.E8161C52@hotpop.com>
Date: Thu, 12 Jun 2003 23:10:01 -0400
X-Mailer: Mozilla 4.8 [en] (Win95; U)
X-Accept-Language: en
MIME-Version: 1.0
Subject: Re: How do I write a language debugger?
References: <5.1.0.14.2.20030610122946.01ff3ca0@mail.geeksalad.org>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Posted-By: 24.44.76.12
Approved: n...@nntp.perl.org
From: ben.goldb...@hotpop.com (Benjamin Goldberg)
Lines: 27

"Clinton A. Pierce" wrote:
[snip]
> DEBUGGER:
>         if one-stepping, DEBUG
>         # Loop over break list
>                 if current statement is on global break list, DEBUG
>         # End loop
>         ret

No comment on your *particular* problem, but might I suggest that you
keep your break "list" in a hash, instead?

Then you'd have:

DEBUGGER:
	if $one_stepping, DEBUG
	set $at_breakpoint_p, $breakpoints[$current_statement]
	unless $at_breakpoint_p, END_OF_DEBUG
DEBUG:
	... stuff from DEBUG ...
END_OF_DEBUG
	ret

-- 
$a=24;split//,240513;s/\B/ => /for@@=qw(ac ab bc ba cb ca
);{push(@b,$a),($a-=6)^=1 for 2..$a/6x--$|;print "$@[$a%6
]\n";((6<=($a-=6))?$a+=$_[$a%6]-$a%6:($a=pop @b))&&redo;}