Skip to content

Commit

Permalink
Change config to make example debuggable
Browse files Browse the repository at this point in the history
  • Loading branch information
thetarnav committed Jan 5, 2025
1 parent 2004ed0 commit 4202d70
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
10 changes: 9 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,15 @@
"request": "launch",
"type": "chrome",
"url": "http://localhost:3000",
"webRoot": "${workspaceFolder}/example"
"webRoot": "${workspaceFolder}/example",
/*
Requires "C/C++ DevTools Support (DWARF)" Chrome extension
https://chromewebstore.google.com/detail/cc++-devtools-support-dwa/pdcpmagijalfljmkmjngeonclgbbannb

And "WebAssembly DWARF Debugging" Vscode extension
https://marketplace.visualstudio.com/items?itemName=ms-vscode.wasm-dwarf-debugging
*/
"userDataDir": false,
},
{
"type": "lldb",
Expand Down
4 changes: 3 additions & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const ODIN_ARGS_SHARED = [
]
/** @type {string[]} */
const ODIN_ARGS_DEV = [
"-o:none",
"-debug",
"-use-separate-modules",
]
/** @type {string[]} */
Expand Down Expand Up @@ -331,6 +331,8 @@ async function build_wasm(is_dev) {

const args = ODIN_ARGS_SHARED.concat(is_dev ? ODIN_ARGS_DEV : ODIN_ARGS_RELESE)

console.log("\x1b[90m"+"odin "+args.join(' ')+"\x1b[0m")

const child = child_process.execFile("odin", args, {cwd: dirname})
child.stderr?.on("data", data => {
console.error(data.toString())
Expand Down

0 comments on commit 4202d70

Please sign in to comment.