Bug 40336
Summary: | Web Inspector: add programmatic API for setting breakpoints | ||
---|---|---|---|
Product: | WebKit | Reporter: | Jesse Hallett <hallettj> |
Component: | Web Inspector | Assignee: | Nobody <webkit-unassigned> |
Status: | NEW | ||
Severity: | Normal | CC: | graouts, hallettj, inspector-bugzilla-changes, webkit-bug-importer |
Priority: | P2 | Keywords: | InRadar |
Version: | 528+ (Nightly build) | ||
Hardware: | All | ||
OS: | All |
Jesse Hallett
From time a bug comes up that I can only reproduce in a production environment. This leads to debugging code that is minified and that I cannot change. In situations like this it would be really helpful to be able to programmatically set breakpoints. For example setting a property on a function from the console to cause execution to pause when that function starts running would be great:
> filter._onPreProcess.debug = true;
It would also be handy to be able to set the value of that property to a predicate function so that execution would only pause if the predicate returned `true`:
> filter._onPreProcess.debug = function(/* gets arguments sent to _onPreProcess() */) { return !!arguments[1].match(/foo/); };
There are also cases where I can modify where I believe it would be useful to have other breakpoint API options. When debugging Ruby code with the Ruby debugger I can place a call to a function called `debugger()` in my code to cause execution to pause on that line. It would be nice to have a similar option in Webkit.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Jesse Hallett
I found out that you can use the `debugger;` statement for that latter case.
Brian Burg
This seems like a good candidate for the console command line. Firefox's GCLI (https://github.com/mozilla/gcli/) seems to have a similar interface.
There are significant challenges to making this visible to user scripts, so I think we should focus on something only made available through the inspector console.
Radar WebKit Bug Importer
<rdar://problem/19095011>