kashiwazakinenji / chromedevtools

Automatically exported from code.google.com/p/chromedevtools
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Need a way to customize stack frame line number translation #19

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Chrome developer tools fetch JS from the browser. In the case of HTML files 
this results in separate "resource" for each JS fragment that has 0 origin 
(see http://code.google.com/p/chromedevtools/issues/detail?id=2)

In our project we keep all HTML and JS sources in the user workspace so we 
need to let the user trace through the whole HTML page. We need to translate 
line number from the JS fragment using the fragment starting line as an 
offset.

Enclosed patch provides add-on developers an API to customize the line 
translation.

Original issue reported on code.google.com by eostrouk...@gmail.com on 9 Feb 2010 at 6:47

Attachments:

GoogleCodeExporter commented 8 years ago
Just for illustrative purposes, this is how we need to translate line numbers 
(code 
is currently in our workspace bridge):
public int getLineNumber(CallFrame stackFrame) {
  int offset = 0;
  Script script = stackFrame.getScript();
  if (script != null) {
    offset = script.getStartLine();
  }
  return offset + stackFrame.getLineNumber() + 1;
}

Original comment by eostrouk...@gmail.com on 9 Feb 2010 at 7:12

GoogleCodeExporter commented 8 years ago

Original comment by peter.ry...@gmail.com on 3 Mar 2010 at 11:38

GoogleCodeExporter commented 8 years ago
Hi Eugene

I'm sorry this lasts so long.

However, can I ask you to review recent changes in HEAD. In particular, it is 
about 
to close issue #2.
This potentially makes your patch obsolete.

Peter

Original comment by peter.ry...@gmail.com on 4 Jun 2010 at 3:29

GoogleCodeExporter commented 8 years ago
True, our patch is no longer needed.

This bug report can be closed as fixed.

Original comment by eostrouk...@gmail.com on 8 Jun 2010 at 8:48

GoogleCodeExporter commented 8 years ago

Original comment by peter.ry...@gmail.com on 10 Aug 2010 at 8:38