<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>59926</bug_id>
          
          <creation_ts>2011-05-02 03:56:03 -0700</creation_ts>
          <short_desc>Debugger call frame line numbers are inaccurate if your file contains getter or setter declarations</short_desc>
          <delta_ts>2012-03-11 12:33:16 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>JavaScriptCore</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Mac (Intel)</rep_platform>
          <op_sys>OS X 10.6</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>77675</dup_id>
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P1</priority>
          <bug_severity>Critical</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="Ryan Ackley">rackley</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>barraclough</cc>
    
    <cc>BugZilla</cc>
    
    <cc>domenic</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>396322</commentid>
    <comment_count>0</comment_count>
      <attachid>91907</attachid>
    <who name="Ryan Ackley">rackley</who>
    <bug_when>2011-05-02 03:56:03 -0700</bug_when>
    <thetext>Created attachment 91907
test file to reproduce the problem

If you have a file that uses getter/setter syntax similar to

TestObject.prototype={
  get prop(){
    return 0;
  }
}

The line numbers become skewed in the parser/debugger call frame. For each one of these in your file, the parser seems to add 2 or 3 extra lines to the current line count. 

I first noticed this problem when trying to debug the Web Inspector. It is currently impossible to accurately step through the Web Inspector using the debugger since this syntax is used quite frequently by it.

I&apos;ve attached a simple test case that reproduces the problem on the nightly build. There is an html file and script. If you set a breakpoint on line 6 of test.html and step into the function call, you will notice that you step into the function a few lines forward from the proper place. I&apos;ve verified that this line number is being received from the backend and it isn&apos;t a bug in the inspector. 

This seems to have been happening for a while. This is probably the cause of Bug 42252.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>396323</commentid>
    <comment_count>1</comment_count>
      <attachid>91908</attachid>
    <who name="Ryan Ackley">rackley</who>
    <bug_when>2011-05-02 03:57:03 -0700</bug_when>
    <thetext>Created attachment 91908
test script used by test.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>396691</commentid>
    <comment_count>2</comment_count>
      <attachid>91985</attachid>
    <who name="Ryan Ackley">rackley</who>
    <bug_when>2011-05-02 14:54:13 -0700</bug_when>
    <thetext>Created attachment 91985
patch to fix the bug</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>443983</commentid>
    <comment_count>3</comment_count>
    <who name="Kevin H McCullough">BugZilla</who>
    <bug_when>2011-07-29 10:27:24 -0700</bug_when>
    <thetext>I encountered this problem too, while trying to debug the LeaksParser.  The attached patch fixed it for me, but I don&apos;t know enough about the area of code to review it.  It is fairly straightforward though.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>444068</commentid>
    <comment_count>4</comment_count>
    <who name="Ryan Ackley">rackley</who>
    <bug_when>2011-07-29 13:31:00 -0700</bug_when>
    <thetext>Strange because I think this was fixed by a change made against another bug.  When is the last time you did a full update?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>444128</commentid>
    <comment_count>5</comment_count>
    <who name="Kevin H McCullough">BugZilla</who>
    <bug_when>2011-07-29 15:04:39 -0700</bug_when>
    <thetext>I&apos;m on r91704.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>444148</commentid>
    <comment_count>6</comment_count>
    <who name="Ryan Ackley">rackley</who>
    <bug_when>2011-07-29 15:40:57 -0700</bug_when>
    <thetext>I thought this change might have fixed it 

http://trac.webkit.org/changeset/85456/trunk/Source/JavaScriptCore/parser/JSParser.cpp
 
Sounds like it&apos;s not the same fix.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>575815</commentid>
    <comment_count>7</comment_count>
    <who name="Gavin Barraclough">barraclough</who>
    <bug_when>2012-03-11 12:33:16 -0700</bug_when>
    <thetext>This should be fixed in r106589.  If it&apos;s not, please reopen bug#77675, that is now tracking this problem.

cheers,
G.

*** This bug has been marked as a duplicate of bug 77675 ***</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>91907</attachid>
            <date>2011-05-02 03:56:03 -0700</date>
            <delta_ts>2011-05-02 03:56:03 -0700</delta_ts>
            <desc>test file to reproduce the problem</desc>
            <filename>test.html</filename>
            <type>text/html</type>
            <size>161</size>
            <attacher name="Ryan Ackley">rackley</attacher>
            
              <data encoding="base64">PGh0bWw+CjxoZWFkPgo8c2NyaXB0IHR5cGU9InRleHQvamF2YXNjcmlwdCIgc3JjPSJ0ZXN0Lmpz
Ij48L3NjcmlwdD4KPHNjcmlwdD4KCXZhciB0byA9IG5ldyBUZXN0T2JqZWN0KCk7Cgl0by5ydW5U
ZXN0KCk7Cjwvc2NyaXB0Pgo8L2hlYWQ+Cjxib2R5Pgo8L2JvZHk+CjwvaHRtbD4=
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>91908</attachid>
            <date>2011-05-02 03:57:03 -0700</date>
            <delta_ts>2011-05-02 03:57:03 -0700</delta_ts>
            <desc>test script used by test.html</desc>
            <filename>test.js</filename>
            <type>application/x-javascript</type>
            <size>256</size>
            <attacher name="Ryan Ackley">rackley</attacher>
            
              <data encoding="base64">VGVzdE9iamVjdCA9IGZ1bmN0aW9uKCl7Cgp9CgpUZXN0T2JqZWN0LnByb3RvdHlwZT17CiAgICBn
ZXQgcHJvcCgpewogICAgICAgIHJldHVybiAwOwogICAgfSwKICAgIGdldCBteVByb3AoKXsKICAg
ICAgICByZXR1cm4gMTsKICAgIH0sCiAgICAKICAgIHJ1blRlc3Q6IGZ1bmN0aW9uKCl7CiAgICAg
ICAgdmFyIGMgPSAwOwogICAgICAgIAogICAgICAgIHZhciB5ID0gOCArIGM7CiAgICAgICAgcmV0
dXJuIHRoaXMubXlQcm9wICsgeTsKICAgIH0KfQ==
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>91985</attachid>
            <date>2011-05-02 14:54:13 -0700</date>
            <delta_ts>2011-05-02 14:54:13 -0700</delta_ts>
            <desc>patch to fix the bug</desc>
            <filename>mypatch.txt</filename>
            <type>text/plain</type>
            <size>1555</size>
            <attacher name="Ryan Ackley">rackley</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9KYXZhU2NyaXB0Q29yZS9wYXJzZXIvSlNQYXJzZXIuY3BwCj09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT0KLS0tIFNvdXJjZS9KYXZhU2NyaXB0Q29yZS9wYXJzZXIvSlNQYXJzZXIuY3BwCShyZXZpc2lv
biA4NTQ1NSkKKysrIFNvdXJjZS9KYXZhU2NyaXB0Q29yZS9wYXJzZXIvSlNQYXJzZXIuY3BwCSh3
b3JraW5nIGNvcHkpCkBAIC0xLDUgKzEsNiBAQAogLyoKICAqIENvcHlyaWdodCAoQykgMjAxMCBB
cHBsZSBJbmMuIEFsbCByaWdodHMgcmVzZXJ2ZWQuCisgKiBDb3B5cmlnaHQgKEMpIDIwMTEgUnlh
biBBY2tsZXkgKHJ5YW5hY2tsZXlAZ21haWwuY29tKQogICoKICAqIFJlZGlzdHJpYnV0aW9uIGFu
ZCB1c2UgaW4gc291cmNlIGFuZCBiaW5hcnkgZm9ybXMsIHdpdGggb3Igd2l0aG91dAogICogbW9k
aWZpY2F0aW9uLCBhcmUgcGVybWl0dG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JvcGVydHkpOwogICAgICAgICBpZiAoIW1fc3ludGF4QWxyZWFkeVZhbGlk
YXRlZCAmJiBjb250ZXh0LmdldFR5cGUocHJvcGVydHkpICE9IFByb3BlcnR5Tm9kZTo6Q29uc3Rh
bnQpIHsKICAgICAgICAgICAgIG1fbGV4ZXItPnNldE9mZnNldChzdGFydE9mZnNldCk7CisgICAg
ICAgICAgICBtX2xleGVyLT5zZXRMaW5lTnVtYmVyKHN0YXJ0TGluZSk7CiAgICAgICAgICAgICBu
ZXh0KCk7CiAgICAgICAgICAgICByZXR1cm4gcGFyc2VTdHJpY3RPYmplY3RMaXRlcmFsKGNvbnRl
eHQpOwogICAgICAgICB9Cg==
</data>

          </attachment>
      

    </bug>

</bugzilla>