Message from discussion Debugger API feedback
Received: by 10.68.195.131 with SMTP id ie3mr24827410pbc.8.1337643282756;
Mon, 21 May 2012 16:34:42 -0700 (PDT)
NNTP-Posting-Date: Mon, 21 May 2012 18:33:24 -0500
X-Virus-Scanned: amavisd-new at mozilla.org
Received-SPF: none (mozilla.com: No applicable sender policy available)
Date: Mon, 21 May 2012 16:42:03 -0500
From: Jason Orendorff <jorendo...@mozilla.com>
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7;
rv:15.0) Gecko/15.0 Thunderbird/15.0a1
To: David Bruant <bruan...@gmail.com>
References: <4FB79382.firstname.lastname@example.org> <4FBA82EC.email@example.com>
Cc: Jim Blandy <j...@mozilla.com>,
List-Id: SpiderMonkey internals
subject: Re: Debugger API feedback
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
On 5/21/12 1:59 PM, David Bruant wrote:
>> In an event-driven GUI program, it's awkward to pause in the middle of
>> event handler code. For the program to remain responsive, you have to
>> be in the event loop processing events. But to debug the code, it has
>> to remain paused on the stack. Dilemma! You have two options:
>> 1. Capture the current continuation (in the call/cc sense) of the
>> paused code you're debugging.
> I'm sorry, but I didn't understand this sentense at all :-s
> What is a continuation?
> What is the call/cc sense? (and what other senses are they?)
A continuation is "what happens next" after a certain point in a
program. I don't think it'll help this discussion to get into it, but
I'd be happy to chat with you about it. It's very hard to explain.
Let me try this question over again. I'll try two different approaches.
1. Basically when you're in a debugging hook, the stack looks like this:
the main event loop
Suppose you call dbg.pause(), and then you return. What's supposed to
2. You don't need a dbg.pause() method because the Debugger API
automatically pauses and resumes the debuggee as needed! If a debugging
hook is running, that means the debuggee is paused. If you want the
debuggee to stay paused, just don't return!
>> Now, there is a high-level, asynchronous, remote-able protocol,
>> implemented atop the Debugger API, which has messages like "interrupt"
>> and "resume":
>> It's implemented, and the built-in debugger uses it; see
>> toolkit/devtools/debugger/server and particularly the
>> dbg-script-actors.js file in that directory. This protocol lets you
>> debug from out-of-process and pause everything (the entire browser, if
>> you want).
> Having this capability with a remote protocol, but not locally is an
> intriguing idea. But thanks for the pointer, I'll take a look.
The remote debugging protocol works fine in-process, as well as
remotely. The built-in debugger uses it. You can use it.
> I tend to think that the OO style for callbacks is too verbose.
Yeah, I'm not going to reply to this in detail because we basically agree.