While learning CLR Runtime, I found it's hardly to understand how the context is switched between Managed and Nitave Code.
When I choose codelldb or cppdbg debugger to launch the app(in vscode), I can neither set the breakpoint on C# code, nor see the Managed CallStack.
You can not get Native frames if you are using coreclr debugger.
Sometimes I will use SOS plugin with lldb. but all the command was executed outside of the vscode. So why not bring codelldb and sos together?
- When initializing the lldb. SOS will be loaded.
- Check file's extention. use bpmd command instead if it's a cs file.
- Try find managed frame by IP2MD command if no source code is found when breakpoint is hit.
Here's a minimal debug configuration to get you started:
{
"lldb.launch.debugServer": 4711,
"lldb.launch.initCommands": [
"plugin load /home/path/to/sos/libsosplugin.so",
"setsymbolserver -ms"
],
}
- Initial Setup
- Debugging in VS Code - if you are new to VSCode debugging.
- CodeLLDB User's Manual - about this specific extension.
- Troubleshooting - known problems and solutions.
- Q & A - for when you are stuck.