codegl / tracegl

traceGL support repository
84 stars 5 forks source link

BUG: Incorrect values are shown on hover #82

Open 3rd-Eden opened 11 years ago

3rd-Eden commented 11 years ago

I've noticed that tracegl sometimes shows the wrong values when you are inspecting variables.

In http://cl.ly/image/2J0A2s130924 you can see that I hover over the key variable in the function. It give the correct value which is version. When I move to the bottom of the Versions.prototype.set function and hover over the key variable again it actually shows the value from the from variable instead of the key variable as seen in http://cl.ly/image/051U3n3B240w. And when I hover over the from variable it shows the value of to.

The code that was traced is open source and available at: https://github.com/3rd-Eden/versions

codegl commented 11 years ago

What happens here is that function arguments are traced by when they enter the function, but are displayed at the point of call. As you can see on->(from, to) is the next function in the callstack. However there are 3 arguments to the emit call (event, from, to). So having an untraced call inbetween 2 traced calls (emit in this case) can disalign the arguments. I currently have no easy way of detecting this, since the call inbetween is untraced. I could trace arguments 'at call' and at entry, but this would slow things down by a factor of 2.

3rd-Eden commented 11 years ago

That sounds reasonable, I guess it's just something that needs to be documented then.