Bug 12983 - Web Inspector break on the debugger keyword
Summary: Web Inspector break on the debugger keyword
Status: VERIFIED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P3 Enhancement
Assignee: Nobody
URL:
Keywords: InRadar
: 17232 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-03-06 09:38 PST by Darrell Esau
Modified: 2008-07-24 00:27 PDT (History)
2 users (show)

See Also:


Attachments
A simple test case. (504 bytes, text/html)
2007-04-19 14:28 PDT, Darrell Esau
no flags Details
Patch-fu! (12.68 KB, patch)
2008-06-03 04:36 PDT, Oliver Hunt
timothy: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Darrell Esau 2007-03-06 09:38:15 PST
Adding "debugger;" to javascript acts as a breakpoint in most other JS debuggers -- it doesn't seem to work in Drosera.

Any reason this isn't implemented?
Comment 1 Darrell Esau 2007-04-19 14:28:25 PDT
Created attachment 14095 [details]
A simple test case.

How to use this test case:

Open Drosera, attach to the Safari/WebKit process then open the attached HTML file.  Click on the contained link. After the first alert is displayed, Drosera should break at the debugger keyword.
Comment 2 Mark Rowe (bdash) 2008-02-08 22:43:17 PST
*** Bug 17232 has been marked as a duplicate of this bug. ***
Comment 3 Mark Rowe (bdash) 2008-02-08 22:43:44 PST
<rdar://problem/5732833>

Comment 4 Brett Fattori 2008-02-26 07:08:27 PST
This is important since most times the debugger does not know about files that are yet to be loaded.
Comment 5 Timothy Hatcher 2008-05-17 09:23:14 PDT
Still applies to the new Web Inspector debugger, moving to that component.
Comment 6 Oliver Hunt 2008-06-03 04:36:53 PDT
Created attachment 21475 [details]
Patch-fu!
Comment 7 Timothy Hatcher 2008-06-03 06:54:40 PDT
Comment on attachment 21475 [details]
Patch-fu!

I would recommend "Breakpoint" instead of "BreakPoint" to match the inspector and Xcode.

+// about to leave a stack frame (i.e. return from a function)
+- (void)webView:(WebView *)webView   didReachBreakPoint:(WebScriptCallFrame *)frame

Also that comment is not correct for the method you added.
Comment 8 Geoffrey Garen 2008-06-03 10:50:34 PDT
Please don't add the WebKit debug delegate callback. The WebKit debug delegate's only client is DashCode, and it doesn't listen for the message you've added. Generally, the WebKit debug delegate is deprecated. I'd rather leave its bits completely frozen.
Comment 9 Oliver Hunt 2008-06-03 15:49:56 PDT
Committing to http://svn.webkit.org/repository/webkit/trunk ...
	M	JavaScriptCore/ChangeLog
	M	JavaScriptCore/VM/CodeBlock.cpp
	M	JavaScriptCore/VM/Machine.cpp
	M	JavaScriptCore/VM/Machine.h
	M	JavaScriptCore/kjs/debugger.h
	M	JavaScriptCore/kjs/grammar.y
	M	JavaScriptCore/kjs/nodes.cpp
	M	JavaScriptCore/kjs/nodes.h
	M	JavaScriptCore/kjs/nodes2string.cpp
	M	WebCore/ChangeLog
	M	WebCore/page/JavaScriptDebugServer.cpp
	M	WebCore/page/JavaScriptDebugServer.h
	M	WebKit/mac/ChangeLog
	M	WebKit/mac/WebView/WebScriptDebugger.h
	M	WebKit/mac/WebView/WebScriptDebugger.mm
Committed r34351

Comment 10 Darrell Esau 2008-06-03 19:13:51 PDT
Awesome!  Can't wait to try this out.  Thanks Oliver!
Comment 11 Darrell Esau 2008-06-05 13:32:32 PDT
Verified - works great.  Thanks again.
Comment 12 Johan Lund 2008-07-23 02:14:00 PDT
It works but not for code that has been read in with eval. :(
I will log a separate request to support evaled code.
Comment 13 Johan Lund 2008-07-24 00:27:11 PDT
The new related bug report is:
https://bugs.webkit.org/show_bug.cgi?id=20139