microsoft / vscode-cpptools

Official repository for the Microsoft C/C++ extension for VS Code.
Other
5.51k stars 1.55k forks source link

[macOs] Unable to trace execution on application #3066

Open pieandcakes opened 5 years ago

pieandcakes commented 5 years ago

Copied from #890 (https://github.com/Microsoft/vscode-cpptools/issues/890#issuecomment-456277596)

@helloravi says: It works with lldb but I am not able to trace the execution path of commands executed through CLI. Let me elaborate. I am trying to trace the path of a transaction in BItcoin. bitcoind runs the server. bitcoin-cli creates the transaction and sends it to bitcoind server. When I launch bitcoind with lldb. The debugger panel that appears at the top left disappears after a few seconds. This prevents me from tracing the execution path. Here are lot more details. What do you think can be done to trace the path?

pieandcakes commented 5 years ago

@helloravi So it looks like lldb doesn't support what gdb has in set follow-fork-mode child (https://sourceware.org/gdb/onlinedocs/gdb/Forks.html).

If you set that in your setupCommands in gdb does it start working?

Relevant lldb bug: https://bugs.llvm.org/show_bug.cgi?id=17972

helloravi commented 5 years ago

@pieandcakes There is a bug in the latest update of MacOS(Mojave) which is preventing the GDB from working. People are working on fixing this. Until that point there is no fix for this.

I am able to debug on command line using lldb. I have to do a process attach --pid 1405 (1405 should be replaced with the process id of the running executable). VSCode works with lldb on a linux machine of a colleague.