WebAssembly text generation on debugger side#3238
Conversation
1a0fbaa to
c7fd37c
Compare
Codecov Report
@@ Coverage Diff @@
## next #3238 +/- ##
==========================================
- Coverage 50.41% 50.03% -0.39%
==========================================
Files 106 107 +1
Lines 4336 4457 +121
Branches 897 920 +23
==========================================
+ Hits 2186 2230 +44
- Misses 2150 2227 +77
Continue to review full report at Codecov.
|
c7fd37c to
4fb5921
Compare
| const { line, column } = getTokenLocation(editor.codeMirror, target); | ||
|
|
||
| this.toggleBreakpoint(line + 1, column - 2); | ||
| this.toggleBreakpoint( |
There was a problem hiding this comment.
i suppose we can't use a similar toSourceLocation method here because of the strange column offset...
| key: index, | ||
| callSite, | ||
| editor, | ||
| sourceId, |
There was a problem hiding this comment.
lets pass the selectedSource down if possible. I think that would be a little more useful
| let sourceLine = toSourceLine(selectedSource.get("id"), line); | ||
| const bp = breakpointAtLocation(breakpoints, selectedLocation, { | ||
| line: sourceLine | ||
| }); |
There was a problem hiding this comment.
this is going to move after a rebase
| const sourceText = source.get("text"); | ||
| const sourceNumLines = typeof sourceText === "string" | ||
| ? sourceText.split("\n").length | ||
| : sourceText.get("binary").length; |
There was a problem hiding this comment.
- can we look at
source.isWasmhere instead oftypeof sourceText === "string" - perhaps move this to a helper
utils/source
| updateLineNumberFormat(editor, sourceId); | ||
| } | ||
|
|
||
| function renderWasmText(editor, sourceId: string, wasm: any) { |
There was a problem hiding this comment.
can we move much of this to utils/editor/wasm
function renderWasmText(editor, sourceId: string, wasm: any) {
const lines = getWasmLines(souceId, wasm)
let text = { split: () => lines, match: () => false };
editor.setText(text);
}| editor.setText(text); | ||
| } | ||
| updateLineNumberFormat(editor, sourceId); | ||
| editor.setMode(isSourceWasm ? { name: "text" } : getMode(source.toJS())); |
There was a problem hiding this comment.
can we move isSourceWasm ? { name: "text" } to getMode?
4fb5921 to
c572053
Compare
jasonLaster
left a comment
There was a problem hiding this comment.
couple of small comments, but otherwise looks good.
| if (prevProps.selectedLocation !== selectedLocation) { | ||
| if (selectedLocation && selectedLocation.line != undefined) { | ||
| this.pendingJumpLine = selectedLocation.line; | ||
| this.pendingJumpLine = selectedLocation; |
There was a problem hiding this comment.
lets change pendingJumpLine to pendingJumpLocation
|
|
||
| if (gutter !== "CodeMirror-foldgutter") { | ||
| toggleBreakpoint(line + 1); | ||
| const sourceId = selectedSource ? selectedSource.get("id") : ""; |
There was a problem hiding this comment.
Lets move the selectedSource higher up.
if (! selectedSource) {
return
}we can do the same thing in onToggleBreakpoint
7f78c27 to
412d1a7
Compare
…s#3387) * move editor to state to ensure that re-layouts are still ok * make flow happy / fix tests * remove editor state
…html/fix-shortcut Fix source search shortcut
* Adding VueJS logo Via https://github.com/vuejs/vuejs.org/blob/master/assets/logo.ai * Add support for VueJS frame collapsing
412d1a7 to
76487fd
Compare
Associated Issue: n/a
Summary of Changes
Test Plan
Example test plan (for original source):
Alternative test plan (for wasm):
3a. Find/open "wasm:https://devtools-html.github.io/debugger-examples/examples/wasm/fib/fib.index.html:d65901927dbe8357"
4a. Set breakpoint at the beginnig of $func5 @0000027D
5a. Refresh refresh fib.index.html page
Expected results: stop at set breakpoint(s).
Some other defects found: