Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1141)

Issue 1663113002: [debugger] Use code offsets from frame summary in FromFrame Function. (Closed)

Created:
4 years, 10 months ago by zhengxing.li
Modified:
4 years ago
CC:
v8-reviews_googlegroups.com
Base URL:
https://chromium.googlesource.com/v8/v8.git@master
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

[debugger] Use code offsets from frame summary in FromFrame Function. The CL 33579 (https://codereview.chromium.org/1618343002) use code offsets instead of raw PC where possible. But the offset maybe come from an optimized frame, not the un-optimized frame that FromCodeOffset and BreakIndexFromCodeOffset function expect. So The offset from optimized frame can't be used in FromCodeOffset and BreakIndexFromCodeOffset function. This CL use the frame summary to find the corresponding code offset in unoptimized code according to Yang's suggestion. Committed: https://crrev.com/a0f6d5ed949da17fe94be22021d14b9006238edf Cr-Commit-Position: refs/heads/master@{#33778}

Patch Set 1 #

Patch Set 2 : #

Total comments: 2

Patch Set 3 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+10 lines, -10 lines) Patch
M src/debug/debug.cc View 1 2 2 chunks +10 lines, -10 lines 0 comments Download

Messages

Total messages: 19 (7 generated)
zhengxing.li
PTAL, thanks!
4 years, 10 months ago (2016-02-03 15:32:16 UTC) #2
Yang
On 2016/02/03 15:32:16, zhengxing.li wrote: > PTAL, thanks! Thanks for finding this! I dont think ...
4 years, 10 months ago (2016-02-04 16:25:40 UTC) #3
zhengxing.li
On 2016/02/04 16:25:40, Yang wrote: > On 2016/02/03 15:32:16, zhengxing.li wrote: > > PTAL, thanks! ...
4 years, 10 months ago (2016-02-05 01:08:30 UTC) #4
zhengxing.li
On 2016/02/05 01:08:30, zhengxing.li wrote: > On 2016/02/04 16:25:40, Yang wrote: > > On 2016/02/03 ...
4 years, 10 months ago (2016-02-05 06:21:59 UTC) #6
Yang
See if I understand this correctly: The bug is not new. We used to try ...
4 years, 10 months ago (2016-02-05 08:49:34 UTC) #7
zhengxing.li
On 2016/02/05 08:49:34, Yang wrote: > See if I understand this correctly: > The bug ...
4 years, 10 months ago (2016-02-05 10:35:55 UTC) #8
zhengxing.li
On 2016/02/05 10:35:55, zhengxing.li wrote: > On 2016/02/05 08:49:34, Yang wrote: > > See if ...
4 years, 10 months ago (2016-02-05 10:38:10 UTC) #9
Yang
On 2016/02/05 10:38:10, zhengxing.li wrote: > On 2016/02/05 10:35:55, zhengxing.li wrote: > > On 2016/02/05 ...
4 years, 10 months ago (2016-02-05 11:49:40 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1663113002/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1663113002/40001
4 years, 10 months ago (2016-02-05 13:20:39 UTC) #14
commit-bot: I haz the power
Committed patchset #3 (id:40001)
4 years, 10 months ago (2016-02-05 13:50:32 UTC) #16
commit-bot: I haz the power
Patchset 3 (id:??) landed as https://crrev.com/a0f6d5ed949da17fe94be22021d14b9006238edf Cr-Commit-Position: refs/heads/master@{#33778}
4 years, 10 months ago (2016-02-05 13:50:43 UTC) #18
zhengxing.li
4 years, 10 months ago (2016-02-05 13:53:10 UTC) #19
Message was sent while issue was closed.
On 2016/02/05 11:49:40, Yang wrote:
> On 2016/02/05 10:38:10, zhengxing.li wrote:
> > On 2016/02/05 10:35:55, zhengxing.li wrote:
> > > On 2016/02/05 08:49:34, Yang wrote:
> > > > See if I understand this correctly:
> > > > The bug is not new. We used to try to find the source position from the
> > > > unoptimized code with a raw address into optimized code because we are
in
> an
> > > > optimized frame. This did not break because Code::SourcePosition would
> > simply
> > > > return -1.
> > > > Now that we use an offset, we confuse the offset into unoptimized code
> with
> > > > offset into optimized code, which causes wrong calculation.
> > > > I think this fix is fine, though there are some issues remaining.
> > > > 
> > > > https://codereview.chromium.org/1663113002/diff/20001/src/debug/debug.cc
> > > > File src/debug/debug.cc (right):
> > > > 
> > > >
> > >
> >
>
https://codereview.chromium.org/1663113002/diff/20001/src/debug/debug.cc#newc...
> > > > src/debug/debug.cc:153: FrameSummary
GetFirstFrameSummary(JavaScriptFrame*
> > > > frame);
> > > > Can you simply move the function definition to here?
> > > > 
> > > >
> > >
> >
>
https://codereview.chromium.org/1663113002/diff/20001/src/debug/debug.cc#newc...
> > > > src/debug/debug.cc:160: Handle<JSFunction> function(summary.function());
> > > > You don't need to refresh the frame summary here. We only do that at
other
> > > call
> > > > sites because we may not have the debug info, so we may have to
recompile
> > the
> > > > code. Here we already have the debug info.
> > > 
> > > Yes, It seems that the bug is not new. V8 used to get a raw PC address
from
> an
> > > optimized frame.
> > > 
> > > The result is:
> > > The origianl BreakIndexFromAddress() just compare the raw PC address with
> all
> > > breakpoint's PC address
> > > and return the closest breakpoint's index.
> > > 
> > > For Code::SourcePosition, As far as my understanding,
> > > FrameInspector::GetSourcePosition() call Code::SourcePosition()
> > > if the frame is un-optimized otherwise it will return the Source position
in
> > > deoptimized frame. So It's no problem for the
> > > CL 33579.
> > > 
> > > I updated the CL according to suggestions in your comments, please review
it
> > > again. Thanks!
> > 
> > BTW, Who has the LGTM right for src/debug? you, rmcilroy or vogelheim?
> > 
> > Thanks!
> 
> LGTM. I'm owner of src/debug. So you can click on the "commit" checkbox to
> commit this change.

Done, thanks Yang.

Powered by Google App Engine
This is Rietveld 408576698