ScriptpointsThis extension can make breakpoints run JavaScript when hit. Just create a logpoint that begins with !, and the rest of the message is interpreted as JS. You can also start with !! to make execution pause when the scriptpoint is hit. EnvironmentThere are some useful functions available to your script:
Note that evaluate() and memory() are async functions, because they need to use async APIs for communicating with the debugger. So you need to use them with await. For example, you should write log(await evaluate('myVariable')), as log(evaluate('myVariable')) will not work. UsesScriptpoints let you write complex logging logic without needing to modify the code of the program you are debugging. For instance, you could use it to log a message if a list contains a particular item. Or you could log the square root of a variable instead of the variable itself. Or you could send 2D points to a command that adds them to a graph. Scriptpoints work even for debuggers that have not implemented logpoint support, like vscode-cpptools. So, you can write !log(await evaluate('myVariable')) to get the equivalent of the logpoint {myVariable}. Limitations
|