Debugger does not break into code
David Huynh <[email protected]>
| Newsgroups | gmane.comp.mozilla.devel.jsdebugger |
|---|---|
| Organization | Another Netscape Collabra Server User |
| Message-ID | <[email protected]> |
Hi,
I'm having problem using the JS debugger. I'm reading this guide
http://www.svendtofte.com/code/learning_venkman/basics.php
to find out how to use the debugger, and although I've used plenty of
debuggers in the past, I can't figure out how this Venkman thing works.
I have a pretty simple HTML file here:
<html>
<head>
<script type="application/x-javascript"
src="piggy-bank.js"/>
<script language="javascript">
function getStore2() {
debugger
getStore();
}
</script>
</head>
<body>
<span onclick="alert('a'); getStore2();">click me</span>
</body>
</html>
And I followed these steps:
1. start Mozilla
2. open the JS debugger and click on the Stop button (gosh, I didn't
expect to click "stop" to _start_ my debugging task)
3. load the HTML file in Mozilla browser
4. go to the JS debugger and set the right evaluation context
5. refresh the browser. The JS debugger does break into the script file
piggy-bank.js (containing a bunch of functions) and I let it runs through.
6. click on the span "click me". The alert "a" comes up but then nothing
else happens. It doesn't matter if I set any breakpoint in getStore2()
or getStore(). The debugger keyword doesn't help either.
Then I got clever and put in a function call to getStore() at the end of
piggy-bank.js so that step #5 above would let me debug the function
getStore(). The debugger does go into getStore(), which is something
like this:
function getStore() {
debugger
var RDF = Components.classes['@mozilla.org/rdf/rdf-service;1']
.getService(Components.interfaces.nsIRDFService);
...
}
I hit F11 to step into at every point, but then when it reaches the
assignment statement (RDF = ...), F11 seems to behave like F5--Venkman
does not stop at the next statement. Frankly I don't know where it goes
after I hit F11 at the assignment statement.
Then I got even more clever and tried to paste the body of getStore() in
the middle of step #5 above. But alas, the little textbox in Venkman
only takes one line of text!
I'm running Mozilla 1.7.2, Venkman 0.9.81. Venkman seems to be choking
the daylight out of Mozilla.
So I have 2 questions:
1. What should I do if I want to debug the function getStore()?
2. How did those folks that develop various Mozilla-based applications
refrain from killing themselves with this kind of debugging support?
Seriously, I have great respect for the Mozilla product from an
engineering standpoint, but the documentation and developer support
are... Are they using some other tricks to debug their JS code?
Forgot to mention, the HTML file was originally a XUL. But Venkman
doesn't even seem to handle XUL...
Thanks in advance!
David