call stack mapping to incorrect line in file

941 views
Skip to first unread message

scott....@sap.com

unread,
Oct 17, 2012, 6:49:55 PM10/17/12
to google-chrome-...@googlegroups.com
Hi,

I've noticed for the last little while in both Chrome Stable and Canary that sometimes the debugger maps frames in my call stack into incorrect places in the JavaScript file.  I'm using d3.js, which heavily uses closures and anonymous functions as arguments.  If I put a breakpoint into a function that is invoked directly, it seems OK.  But if I put a breakpoint into the implementation of an anonymous function that is invoked as a callback, the call stack is messed up.  The breakpoint does get hit, but if I try to step through back into d3 to the spot where it was invoked it takes me to some completely different part of the file.

Not sure if it's related but I've also noticed lately that sometimes breakpoints can't be removed -- they go away when I click to remove but reappear when I refresh the page or reopen the JavaScript file.  Sometimes these ghost breakpoints will get hit but sometimes not.

Thanks,
scott

Vsevolod Vlasov

unread,
Nov 7, 2012, 12:01:47 PM11/7/12
to scott....@sap.com, Google Chrome Developer Tools
For the first problem I would like to see a reproduction scenario. Do you have an URL where this consistently reproduces?

Second problem sounds like https://code.google.com/p/chromium/issues/detail?id=157852, can you confirm that?
--
Thank you,
Vsevolod Vlasov (vse...@google.com)

jeff.w...@gmail.com

unread,
Sep 26, 2013, 2:57:47 PM9/26/13
to google-chrome-...@googlegroups.com, scott....@sap.com, vse...@google.com
I've had this problem and have found its root cause for my case.

The js file had a mix of different line ending characters.   While the file displays correctly in the debugger, the function internally is being represented as one line by the intepreter.

For example,   the debugger displays:

function a() {
  b;
  c;
  d;
}

then type  a in the console to see the implementation, it shows everything on one line"

{    b; c; d;  }

The file is then shifted after this function permanently
I have my workaround to fix the file.   But I have noticed this issue in some 3rd party libraries.   It would be nice to have the file shown consistently compared to what the interpreter see.

Thanks!
Reply all
Reply to author
Forward
0 new messages