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)
Path: pr3ni23307pbb.0!nntp.google.com!news1.google.com!news2.google.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!nntp.mozilla.org!news.mozilla.org.POSTED!not-for-mail
NNTP-Posting-Date: Mon, 21 May 2012 18:33:24 -0500
Return-Path: <jorendo...@mozilla.com>
X-Original-To: dev-tech-js-engine-intern...@lists.mozilla.org
Delivered-To: dev-tech-js-engine-intern...@lists.mozilla.org
X-Virus-Scanned: amavisd-new at mozilla.org
Received-SPF: none (mozilla.com: No applicable sender policy available)
receiver=mailman2.mail.corp.phx1.mozilla.com; identity=mailfrom;
envelope-from="jorendo...@mozilla.com";
helo=mx1.mail.corp.phx1.mozilla.com; client-ip=10.20.77.61
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
MIME-Version: 1.0
To: David Bruant <bruan...@gmail.com>
References: <4FB79382.8060308@gmail.com> <4FBA82EC.4030301@mozilla.com>
<4FBA9080.7090701@gmail.com>
In-Reply-To: <4FBA9080.7090701@gmail.com>
Cc: Jim Blandy <j...@mozilla.com>,
dev-tech-js-engine-intern...@lists.mozilla.org
X-BeenThere: dev-tech-js-engine-intern...@lists.mozilla.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: SpiderMonkey internals
<dev-tech-js-engine-internals.lists.mozilla.org>
List-Unsubscribe: <https://lists.mozilla.org/options/dev-tech-js-engine-internals>,
<mailto:dev-tech-js-engine-internals-requ...@lists.mozilla.org?subject=unsubscribe>
List-Archive: <http://lists.mozilla.org/pipermail/dev-tech-js-engine-internals/>
List-Post: <mailto:dev-tech-js-engine-intern...@lists.mozilla.org>
List-Help: <mailto:dev-tech-js-engine-internals-requ...@lists.mozilla.org?subject=help>
List-Subscribe: <https://lists.mozilla.org/listinfo/dev-tech-js-engine-internals>,
<mailto:dev-tech-js-engine-internals-requ...@lists.mozilla.org?subject=subscribe>
subject: Re: Debugger API feedback
Newsgroups: mozilla.dev.tech.js-engine.internals
Message-ID: <mailman.683.1337643197.27472.dev-tech-js-engine-intern...@lists.mozilla.org>
Lines: 54
X-Usenet-Provider: http://www.giganews.com
NNTP-Posting-Host: 63.245.216.66
X-AuthenticatedUsername: NoAuthUser
X-Trace: sv3-gqiUPl9uTEYLdaFrXh7gx3LUxSqxP0uiYPGCa5w2xINAfdf21vhWXUoCg9CYtAlXopw2m/5x3PSvk8Z!9RT2ZjCmS+K1PfsjNekAnW58Hw+2Q/RNmXonvcA4IkG2OW5jCRIqPEKz2neRY8A4Ka4f+VxE/Mk/!ygTZRc8qAqucM7CEapCVNKg66Luz9z1QbOCZnZzCjt4nAC/NAgLsCg==
X-Complaints-To: ab...@mozilla.org
X-DMCA-Complaints-To: ab...@mozilla.org
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
X-Postfilter: 1.3.40
X-Original-Bytes: 5050
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
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:
my_debugging_hook
debuggee code
debuggee code
debuggee code
the main event loop
main()
Suppose you call dbg.pause(), and then you return. What's supposed to
happen?
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":
>> https://wiki.mozilla.org/Remote_Debugging_Protocol
>> 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.
-j