visual-studio-code - 使用 lldb 在 VS Code 中调试,如何在没有源代码的符号上设置断点?

标签 visual-studio-code lldb vscode-debugger

我有某种内存管理错误,当然,在 100% 负载下,该错误大约每 3 天左右随机发生一次。这是在 OSX 上,但都是简单的、可移植的 C++11:

code(12404,0x70000aace000) malloc: *** error for object 0x105088e00: pointer being freed was not allocated
                         *** set a breakpoint in malloc_error_break to debug
  Abort trap: 6

我使用的是 Visual Studio Code,调试器是 lldb;我不知道的是 - 如何 - 在 malloc_error_break 上设置断点,以便我可以在发生这种情况时查看调用堆栈。

VS Code 允许您在源代码行设置断点,但我没有该系统库代码的源代码,只有符号。但如果我可以在那里中断,无论没有该函数的源代码,我都可以检查调用堆栈。

那么,如何在 OSX High Sierra 上的 Visual Studio Code 下的 lldb 中在没有源代码的任意符号处设置断点?

谢谢!

最佳答案

如果进入“调试”->“新建断点”->“函数断点”,则可以通过输入函数名称(malloc_error_break)来添加此断点。

关于visual-studio-code - 使用 lldb 在 VS Code 中调试,如何在没有源代码的符号上设置断点?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53875285/

相关文章:

xcode - 内存地址上的监视点

ios - 在 Swift 中为 DebugPrintable 实现 debugDescription

visual-studio - QNX gdb 与 VS 或 VSCode 集成

javascript - 如何在 VSCode 中设置 pathMapping 以调试 Snowpack 应用程序

visual-studio-code - 如何在 Visual Studio Code 的突出显示匹配标签扩展中更改匹配标签的下划线?

html - 如何设置 Visual Studio Code 的 Emmet 优先级?

visual-studio-code - VSCode : Is it possible to suppress experimental decorator warnings

objective-c - 如何向 lldb 控制台中的对象发送消息?

character-encoding - 在 Visual Studio Code 中更改文件的编码

visual-studio-code - Visual Studio Code 调试控制台颜色