Skip to content

Commit

Permalink
Added switching between thread and stack frame in debugger
Browse files Browse the repository at this point in the history
  • Loading branch information
Nimaoth committed Jun 15, 2024
1 parent 11b4c20 commit 9c615e1
Show file tree
Hide file tree
Showing 8 changed files with 392 additions and 135 deletions.
18 changes: 12 additions & 6 deletions config/default_config.nim
Original file line number Diff line number Diff line change
Expand Up @@ -254,12 +254,18 @@ proc loadDefaultKeybindings*(clearExisting: bool = false) =
addCommand "debugger", "<C-k>", "prev-debugger-view"
addCommand "debugger", "<C-h>", "next-debugger-view"

addCommand "debugger", "<UP>", "prev-variable"
addCommand "debugger", "<DOWN>", "next-variable"
addCommand "debugger", "<RIGHT>", "expand-variable"
addCommand "debugger", "<LEFT>", "collapse-variable"
addCommand "debugger", "<HOME>", "select-first-variable"
addCommand "debugger", "<END>", "select-last-variable"
addCommand "debugger.variables", "<UP>", "prev-variable"
addCommand "debugger.variables", "<DOWN>", "next-variable"
addCommand "debugger.variables", "<RIGHT>", "expand-variable"
addCommand "debugger.variables", "<LEFT>", "collapse-variable"
addCommand "debugger.variables", "<HOME>", "select-first-variable"
addCommand "debugger.variables", "<END>", "select-last-variable"

addCommand "debugger.threads", "<UP>", "prev-thread"
addCommand "debugger.threads", "<DOWN>", "next-thread"

addCommand "debugger.stacktrace", "<UP>", "prev-stack-frame"
addCommand "debugger.stacktrace", "<DOWN>", "next-stack-frame"

addCommandBlock "debugger", "<C-u>":
for i in 0..10:
Expand Down
32 changes: 32 additions & 0 deletions scripting/debugger_api_wasm.nim
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,38 @@ proc selectLastVariable*() =
argsJsonString.cstring)


proc debugger_prevThread_void_Debugger_wasm(arg: cstring): cstring {.importc.}
proc prevThread*() =
var argsJson = newJArray()
let argsJsonString = $argsJson
let res {.used.} = debugger_prevThread_void_Debugger_wasm(
argsJsonString.cstring)


proc debugger_nextThread_void_Debugger_wasm(arg: cstring): cstring {.importc.}
proc nextThread*() =
var argsJson = newJArray()
let argsJsonString = $argsJson
let res {.used.} = debugger_nextThread_void_Debugger_wasm(
argsJsonString.cstring)


proc debugger_prevStackFrame_void_Debugger_wasm(arg: cstring): cstring {.importc.}
proc prevStackFrame*() =
var argsJson = newJArray()
let argsJsonString = $argsJson
let res {.used.} = debugger_prevStackFrame_void_Debugger_wasm(
argsJsonString.cstring)


proc debugger_nextStackFrame_void_Debugger_wasm(arg: cstring): cstring {.importc.}
proc nextStackFrame*() =
var argsJson = newJArray()
let argsJsonString = $argsJson
let res {.used.} = debugger_nextStackFrame_void_Debugger_wasm(
argsJsonString.cstring)


proc debugger_prevVariable_void_Debugger_wasm(arg: cstring): cstring {.importc.}
proc prevVariable*() =
var argsJson = newJArray()
Expand Down
Loading

0 comments on commit 9c615e1

Please sign in to comment.