Closed Bug 867880 Opened 11 years ago Closed 11 years ago

built-in debugger skips over too much over code with step-over

Categories

(DevTools :: Debugger, defect)

20 Branch
x86_64
Windows 7
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INVALID

People

(Reporter: jmichae3, Unassigned)

References

()

Details

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:20.0) Gecko/20100101 Firefox/20.0
Build ID: 20130409194949

Steps to reproduce:

1.http://jesusnjim.com/bugs/fb-debugger-pointer-jumps.html#ttp
2. ctrl-shift-s to start built-in debugger (I have firebug installed also)
3.select time-funcs.js
4.breakpoints at lines 2108, 2109
5.at input box, delete the 1 in 1 days, this will cause code to work
6.step over 2108 which is a function call statement
7.if it doesn't do something strange, step over non-function call statements, step into non-function call statements.

this is in ff 20.0.1 32-bit


Actual results:

doesn't work in ff built-in debugger or in firebug on my i7-3970x win7ult64 box. if I hit step-over on 2108, it jumps WAYY over to 2233 instead of line 2109. perhaps this is related?


Expected results:

should step-over to line 2109.
updated URL
Not a bug, the code throws an error: the function atoi64pg does not exist ("ReferenceError: atoi64pg is not defined @ http://jesusnjim.com/bugs/fb-debugger-pointer-jumps_files/time-funcs.js:2238").
That's why stepping over doesn't take you to the next line.

To see errors, please use the whole Developer Toolbar (Tools -> Developer Toolbar), open it clicking on the wrench icon (or, in this case, on the red square with a number in it) and click on the Web Console tab.
Component: Untriaged → Developer Tools: Debugger
yes, the function is not defined. the debugger should say so. yes? instead of leaving me with no info? I ended up fixing it manually without the debugger. I have you a snapshot of the page so you could fix the problem with. don't miss  the opportunity to fix a glaring problem. please, if a function is not declared, by all means alert the developer about it with an error message! (I think that's what error messages are for last time I looked...)
thanks. your time is much appreciated.
btw, I already found the red square with the number on it and guessed what it was. thanks for the heads-up. no appropriate error was there for this. debugger simply failed to do its job. 

so I guess I need to report this same bug with opera as well... thanks for letting me know, I had not tried going that far yet with opera.

is this a debugger specification problem, I mean, if this is a cross-browser debugger issue? is this something I need to submit a bug report to w3c? what section of what group? I would assume whatwg. but I don't know the project name of their debugger.
thanks.
just to let you know, the code doesn't function because there's a missing script atoi64.js that should be at the top. that won't be something you can fix on this particular page (but it's fixed on the appropriate page on my web site).

how you found out about the fact that there was a undefined function I have no idea. if you manually poured over the code debugging it with eyes (what I had to report to), or whether you used a tool, and if so, how (I would like to know if it's not eyes).

I can't remember if dreamweaver gives any clues if a function is not defined. I didn't think it does (yet).


BTW, the whole browser gives up and will not load code (all of them) if a required function is undefined.

aha - I see the following in Chrome's built-in debugger:

Uncaught SyntaxError: Unexpected token ) atoi64.js:1621
Uncaught ReferenceError: atoi64pg is not defined time-funcs.js:2238

so now I figured out how you found the problem. this is the kind of thing I should be seeing from ff's debugger.

opera's debugger shows the following:
Syntax error at line 1621 while loading: expected expression, got ')'	Linked script compilation	atoi64.js
		Uncaught exception: ReferenceError: Undefined variable: atoi64pg	Inline script thread	fb-debugger-pointer-jumps.html:2238


ff reports nothing. [ wait...]
got it! (ooh, nice debugger!)
ff reports
[23:27:57.427] SyntaxError: syntax error @ http://jesusnjim.com/bugs/fb-debugger-pointer-jumps_files/atoi64.js:1621
[23:27:57.444] ReferenceError: atoi64pg is not defined @ http://jesusnjim.com/bugs/fb-debugger-pointer-jumps_files/time-funcs.js:2238
[23:27:57.638] Use of attributes' nodeValue attribute is deprecated. Use value instead. @ http://jesusnjim.com/bugs/fb-debugger-pointer-jumps.html#ttp
[23:28:02.266] ReferenceError: atoi64pg is not defined @ http://jesusnjim.com/bugs/fb-debugger-pointer-jumps_files/time-funcs.js:2238

I got this when I click "web console" and turn on js and turn OFF css. then I right click and pick select all, and right click and pick copy and paste into here.

I suggest for all the web developers out there that you make this debugger available to users via the Tools menu, a button you can add in, in addition to the ctrl-shift-s key combination. it would be most appreciated - because the first I ever heard that firefox had a debugger was from the firebug folks. not from looking at my browser (like normally you would easily find in any other browser in the menus under tools).

the fact that the debugger when you click on step-over which is supposed to step over to the next line, doesn't do that. 

now, we know that one of the functions is undefined. there's no way for me to see that it's undefined without checking the errors, which is in an unseen panel. so I am caught incessantly swapping back and forth between the errors panel and the code panel.

could I request a change to the debugger UI? I would like to see both errors and code lines at the *same time*. it would help my debugging tremendously. I suppose that's another bug report.
let me know if I should post a separate bug report for that. I would be happy to.
Hi Jim, exactly, I saw it from the web console :)
Of course you can request an enhancement! To do so, just file a bug specifying that it's an enhancement.
However the devtools team (which is the team involved in developing the debugger, the web console, etc) is already aware that the debugger could be more user-friendly: in fact, just yesterday they filed a bug for an enhancement, see here: bug 869459
If you wish to add some suggestions, feel free to do it!
If you enable "Pause on exceptions" from the debugger toolbar's "gear" icon, execution will pause at line 2238 and an <exception> entry in bold red will be present in the variables view on the right. Seeing the error in the web console or developer toolbar is a nice hint to enable this option if unchecked.

That said, our current implementation is certainly far from perfect. As noted above bug 869459 has some ideas about making the behavior more evident and bug 812764 needs to get the error details to appear properly in the variables view.
Status: UNCONFIRMED → RESOLVED
Closed: 11 years ago
Resolution: --- → INVALID
Maria: I requested an enhancement like you said, it got shot down.
Status: RESOLVED → UNCONFIRMED
Resolution: INVALID → ---
I'm not sure which enhancement you are referring to, but you may be interested to know that bug 773590 landed in time for Firefox 24, which displays the exception in your case even without enabling the "Pause on exceptions" option. If you try to reproduce the steps from comment 0 in Firefox Nightly or Aurora, you will see that as soon as execution jumps away from the function you were stepping, an exception object appears in the variables view in bright red font.

Another related thing that we are currently working on is to have the console and debugger both visible at the same time, so you can see the console's error message even without switching to it.
Status: UNCONFIRMED → RESOLVED
Closed: 11 years ago11 years ago
Resolution: --- → INVALID
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.