|
|
Created:
3 years, 11 months ago by Clemens Hammacher Modified:
3 years, 11 months ago CC:
v8-reviews_googlegroups.com Target Ref:
refs/pending/heads/master Project:
v8 Visibility:
Public. |
Description[wasm] Set and store breakpoints in wasm
Store breakpoint positions in the WasmSharedModuleData in order to set
them on new instantiations. Also redirect them to all live instances at
the time the breakpoint is set.
Inside the WasmDebugInfo, we store the BreakPointInfo objects to find
hit breakpoints.
R=titzer@chromium.org, yangguo@chromium.org
BUG=v8:5822
Review-Url: https://codereview.chromium.org/2626253002
Cr-Commit-Position: refs/heads/master@{#42443}
Committed: https://chromium.googlesource.com/v8/v8/+/2f3de27e1142aa0d5d1b5fe82c5c632786390c8a
Patch Set 1 #
Total comments: 6
Patch Set 2 : Address comments #Patch Set 3 : Define function only in debug #
Total comments: 2
Patch Set 4 : Revert most changes in src/debug #Patch Set 5 : Minor #
Total comments: 2
Patch Set 6 : Remove CheckBreakPoints methods #
Messages
Total messages: 48 (31 generated)
The CQ bit was checked by clemensh@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Description was changed from ========== [wasm] Set and store breakpoints in wasm Store breakpoint positions in the WasmSharedModuleData in order to set them on new instantiations. Also redirect them to all live instances at the time the breakpoint is set. Inside the WasmDebugInfo, we store the BreakPointInfo objects to find hit breakpoints. Rtitzer@chromium.org, yangguo@chromium.org BUG=v8:5822 ========== to ========== [wasm] Set and store breakpoints in wasm Store breakpoint positions in the WasmSharedModuleData in order to set them on new instantiations. Also redirect them to all live instances at the time the breakpoint is set. Inside the WasmDebugInfo, we store the BreakPointInfo objects to find hit breakpoints. R=titzer@chromium.org, yangguo@chromium.org BUG=v8:5822 ==========
clemensh@chromium.org changed reviewers: + titzer@chromium.org, yangguo@chromium.org
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
https://codereview.chromium.org/2626253002/diff/1/src/debug/debug.cc File src/debug/debug.cc (right): https://codereview.chromium.org/2626253002/diff/1/src/debug/debug.cc#newcode540 src/debug/debug.cc:540: break_points_hit = compiled_module->GetHitBreakpoints(location); Do you want to name this method CheckBreakPoints for symmetry with the other method below (or rename the JS one)? https://codereview.chromium.org/2626253002/diff/1/src/wasm/wasm-objects.cc File src/wasm/wasm-objects.cc (right): https://codereview.chromium.org/2626253002/diff/1/src/wasm/wasm-objects.cc#ne... src/wasm/wasm-objects.cc:1069: { So as I see it, this will find the first bytecode position greater than or equal to the given offset_in_func. Is that what we want? IIRC we have a bitmap somewhere which tells us valid bytecode offsets; why not simply start at the given offset and scan the bitmap forward to this position? https://codereview.chromium.org/2626253002/diff/1/src/wasm/wasm-opcodes.h File src/wasm/wasm-opcodes.h (right): https://codereview.chromium.org/2626253002/diff/1/src/wasm/wasm-opcodes.h#new... src/wasm/wasm-opcodes.h:682: static bool IsReturn(const byte opcode) { return opcode == kExprReturn; } I think it's best not to add too many utility functions here, otherwise this class (and header file) will just fill up with lots of them.
The CQ bit was checked by clemensh@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
https://codereview.chromium.org/2626253002/diff/1/src/debug/debug.cc File src/debug/debug.cc (right): https://codereview.chromium.org/2626253002/diff/1/src/debug/debug.cc#newcode540 src/debug/debug.cc:540: break_points_hit = compiled_module->GetHitBreakpoints(location); On 2017/01/12 at 15:51:20, titzer wrote: > Do you want to name this method CheckBreakPoints for symmetry with the other method below (or rename the JS one)? Done. https://codereview.chromium.org/2626253002/diff/1/src/wasm/wasm-objects.cc File src/wasm/wasm-objects.cc (right): https://codereview.chromium.org/2626253002/diff/1/src/wasm/wasm-objects.cc#ne... src/wasm/wasm-objects.cc:1069: { On 2017/01/12 at 15:51:20, titzer wrote: > So as I see it, this will find the first bytecode position greater than or equal to the given offset_in_func. Is that what we want? IIRC we have a bitmap somewhere which tells us valid bytecode offsets; why not simply start at the given offset and scan the bitmap forward to this position? As discussed offline: Made is a DCHECK. https://codereview.chromium.org/2626253002/diff/1/src/wasm/wasm-opcodes.h File src/wasm/wasm-opcodes.h (right): https://codereview.chromium.org/2626253002/diff/1/src/wasm/wasm-opcodes.h#new... src/wasm/wasm-opcodes.h:682: static bool IsReturn(const byte opcode) { return opcode == kExprReturn; } On 2017/01/12 at 15:51:20, titzer wrote: > I think it's best not to add too many utility functions here, otherwise this class (and header file) will just fill up with lots of them. Removed.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: v8_linux_nodcheck_rel_ng on master.tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_linux_nodcheck_rel_ng/bu...)
The CQ bit was checked by clemensh@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
On 2017/01/12 19:55:51, Clemens Hammacher wrote: > https://codereview.chromium.org/2626253002/diff/1/src/debug/debug.cc > File src/debug/debug.cc (right): > > https://codereview.chromium.org/2626253002/diff/1/src/debug/debug.cc#newcode540 > src/debug/debug.cc:540: break_points_hit = > compiled_module->GetHitBreakpoints(location); > On 2017/01/12 at 15:51:20, titzer wrote: > > Do you want to name this method CheckBreakPoints for symmetry with the other > method below (or rename the JS one)? > > Done. > > https://codereview.chromium.org/2626253002/diff/1/src/wasm/wasm-objects.cc > File src/wasm/wasm-objects.cc (right): > > https://codereview.chromium.org/2626253002/diff/1/src/wasm/wasm-objects.cc#ne... > src/wasm/wasm-objects.cc:1069: { > On 2017/01/12 at 15:51:20, titzer wrote: > > So as I see it, this will find the first bytecode position greater than or > equal to the given offset_in_func. Is that what we want? IIRC we have a bitmap > somewhere which tells us valid bytecode offsets; why not simply start at the > given offset and scan the bitmap forward to this position? > > As discussed offline: Made is a DCHECK. > > https://codereview.chromium.org/2626253002/diff/1/src/wasm/wasm-opcodes.h > File src/wasm/wasm-opcodes.h (right): > > https://codereview.chromium.org/2626253002/diff/1/src/wasm/wasm-opcodes.h#new... > src/wasm/wasm-opcodes.h:682: static bool IsReturn(const byte opcode) { return > opcode == kExprReturn; } > On 2017/01/12 at 15:51:20, titzer wrote: > > I think it's best not to add too many utility functions here, otherwise this > class (and header file) will just fill up with lots of them. > > Removed. lgtm
The CQ bit was checked by titzer@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: v8_presubmit on master.tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_presubmit/builds/32349)
Yang, PTAL on src/debug stuff, maybe also src/.
https://codereview.chromium.org/2626253002/diff/40001/src/debug/debug.cc File src/debug/debug.cc (right): https://codereview.chromium.org/2626253002/diff/40001/src/debug/debug.cc#newc... src/debug/debug.cc:539: wasm_frame->wasm_instance()->compiled_module(), isolate_); Does any of the logic in Debug::Break apply to wasm? If there is enough difference, maybe the wasm interpreter should not call into Debug::Break at all, instead of branching on wasm all the time.
The CQ bit was checked by clemensh@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by clemensh@chromium.org
The CQ bit was checked by clemensh@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
https://codereview.chromium.org/2626253002/diff/40001/src/debug/debug.cc File src/debug/debug.cc (right): https://codereview.chromium.org/2626253002/diff/40001/src/debug/debug.cc#newc... src/debug/debug.cc:539: wasm_frame->wasm_instance()->compiled_module(), isolate_); On 2017/01/16 at 15:34:17, Yang wrote: > Does any of the logic in Debug::Break apply to wasm? If there is enough difference, maybe the wasm interpreter should not call into Debug::Break at all, instead of branching on wasm all the time. Right, probably not. All the stepping related logic is quite different for wasm. I changed it back to take a JavaScriptFrame*, and will implement another Debug::BreakInWasm method in a follow-up CL. Now we could probably also change back BreakLocation::FromFrame to take a DebugInfo and a JavaScriptFrame, and have another BreakLocation::FromWasmFrame method. Would you prefer that? I would add it to the follow-up CL then, to get this one out.
On 2017/01/16 16:17:27, Clemens Hammacher wrote: > https://codereview.chromium.org/2626253002/diff/40001/src/debug/debug.cc > File src/debug/debug.cc (right): > > https://codereview.chromium.org/2626253002/diff/40001/src/debug/debug.cc#newc... > src/debug/debug.cc:539: wasm_frame->wasm_instance()->compiled_module(), > isolate_); > On 2017/01/16 at 15:34:17, Yang wrote: > > Does any of the logic in Debug::Break apply to wasm? If there is enough > difference, maybe the wasm interpreter should not call into Debug::Break at all, > instead of branching on wasm all the time. > > Right, probably not. All the stepping related logic is quite different for wasm. > I changed it back to take a JavaScriptFrame*, and will implement another > Debug::BreakInWasm method in a follow-up CL. > Now we could probably also change back BreakLocation::FromFrame to take a > DebugInfo and a JavaScriptFrame, and have another BreakLocation::FromWasmFrame > method. Would you prefer that? I would add it to the follow-up CL then, to get > this one out. I dont have enough overview over what you have planned for stepping etc. E.g. how handing over between stepping in JS and stepping in wasm works (step in, step out). If wasm is mostly self contained, it probably makes sense to separate it.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
On 2017/01/16 at 16:21:25, yangguo wrote: > On 2017/01/16 16:17:27, Clemens Hammacher wrote: > > https://codereview.chromium.org/2626253002/diff/40001/src/debug/debug.cc > > File src/debug/debug.cc (right): > > > > https://codereview.chromium.org/2626253002/diff/40001/src/debug/debug.cc#newc... > > src/debug/debug.cc:539: wasm_frame->wasm_instance()->compiled_module(), > > isolate_); > > On 2017/01/16 at 15:34:17, Yang wrote: > > > Does any of the logic in Debug::Break apply to wasm? If there is enough > > difference, maybe the wasm interpreter should not call into Debug::Break at all, > > instead of branching on wasm all the time. > > > > Right, probably not. All the stepping related logic is quite different for wasm. > > I changed it back to take a JavaScriptFrame*, and will implement another > > Debug::BreakInWasm method in a follow-up CL. > > Now we could probably also change back BreakLocation::FromFrame to take a > > DebugInfo and a JavaScriptFrame, and have another BreakLocation::FromWasmFrame > > method. Would you prefer that? I would add it to the follow-up CL then, to get > > this one out. > > I dont have enough overview over what you have planned for stepping etc. E.g. how handing over between stepping in JS and stepping in wasm works (step in, step out). If wasm is mostly self contained, it probably makes sense to separate it. I am currently looking into stepping. I haven't figured out all the details yet. Do you think that blocks this CL? Otherwise I would propose to land this now and figure out BreakLocation::FromFrame and other details later.
https://codereview.chromium.org/2626253002/diff/80001/src/wasm/wasm-objects.h File src/wasm/wasm-objects.h (right): https://codereview.chromium.org/2626253002/diff/80001/src/wasm/wasm-objects.h... src/wasm/wasm-objects.h:398: MaybeHandle<FixedArray> CheckBreakPoints(const BreakLocation& location); Is this called from anywhere?
https://codereview.chromium.org/2626253002/diff/80001/src/wasm/wasm-objects.h File src/wasm/wasm-objects.h (right): https://codereview.chromium.org/2626253002/diff/80001/src/wasm/wasm-objects.h... src/wasm/wasm-objects.h:398: MaybeHandle<FixedArray> CheckBreakPoints(const BreakLocation& location); On 2017/01/17 at 13:46:41, Yang wrote: > Is this called from anywhere? Not any more, it was called from Debug::Break and will be called from Debug::BreakInWasm or any related method in the future.
On 2017/01/17 14:25:11, Clemens Hammacher wrote: > https://codereview.chromium.org/2626253002/diff/80001/src/wasm/wasm-objects.h > File src/wasm/wasm-objects.h (right): > > https://codereview.chromium.org/2626253002/diff/80001/src/wasm/wasm-objects.h... > src/wasm/wasm-objects.h:398: MaybeHandle<FixedArray> CheckBreakPoints(const > BreakLocation& location); > On 2017/01/17 at 13:46:41, Yang wrote: > > Is this called from anywhere? > > Not any more, it was called from Debug::Break and will be called from > Debug::BreakInWasm or any related method in the future. src/debug lgtm
The CQ bit was checked by clemensh@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
On 2017/01/18 at 09:51:24, yangguo wrote: > On 2017/01/17 14:25:11, Clemens Hammacher wrote: > > https://codereview.chromium.org/2626253002/diff/80001/src/wasm/wasm-objects.h > > File src/wasm/wasm-objects.h (right): > > > > https://codereview.chromium.org/2626253002/diff/80001/src/wasm/wasm-objects.h... > > src/wasm/wasm-objects.h:398: MaybeHandle<FixedArray> CheckBreakPoints(const > > BreakLocation& location); > > On 2017/01/17 at 13:46:41, Yang wrote: > > > Is this called from anywhere? > > > > Not any more, it was called from Debug::Break and will be called from > > Debug::BreakInWasm or any related method in the future. > > src/debug lgtm As discussed: Removed the CheckBreakPoints method for now, will re-introduce once it's actually used. Landing as soon as the bots are green.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
The CQ bit was checked by clemensh@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from titzer@chromium.org, yangguo@chromium.org Link to the patchset: https://codereview.chromium.org/2626253002/#ps100001 (title: "Remove CheckBreakPoints methods")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
CQ is committing da patch. Bot data: {"patchset_id": 100001, "attempt_start_ts": 1484735193068840, "parent_rev": "7634b0eb13e945191c04e63af86bf9fdc1f6aa4c", "commit_rev": "2f3de27e1142aa0d5d1b5fe82c5c632786390c8a"}
Message was sent while issue was closed.
Description was changed from ========== [wasm] Set and store breakpoints in wasm Store breakpoint positions in the WasmSharedModuleData in order to set them on new instantiations. Also redirect them to all live instances at the time the breakpoint is set. Inside the WasmDebugInfo, we store the BreakPointInfo objects to find hit breakpoints. R=titzer@chromium.org, yangguo@chromium.org BUG=v8:5822 ========== to ========== [wasm] Set and store breakpoints in wasm Store breakpoint positions in the WasmSharedModuleData in order to set them on new instantiations. Also redirect them to all live instances at the time the breakpoint is set. Inside the WasmDebugInfo, we store the BreakPointInfo objects to find hit breakpoints. R=titzer@chromium.org, yangguo@chromium.org BUG=v8:5822 Review-Url: https://codereview.chromium.org/2626253002 Cr-Commit-Position: refs/heads/master@{#42443} Committed: https://chromium.googlesource.com/v8/v8/+/2f3de27e1142aa0d5d1b5fe82c5c6327863... ==========
Message was sent while issue was closed.
Committed patchset #6 (id:100001) as https://chromium.googlesource.com/v8/v8/+/2f3de27e1142aa0d5d1b5fe82c5c6327863... |