Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lldb-mi does not implement gdb cwd interface causing vscode to debug from the wrong location #83

Closed
newdigate opened this issue Sep 18, 2021 · 1 comment

Comments

@newdigate
Copy link

I am running lldb via vscode's cppdbg. Although I am specifying the current working directory in my vscode settings, to debug from, when I use lldb, my application is debugged running from the path where the executable resides, instead of the directory I've specified.

I have raised this issue with vscode-cpptools. It is believed that this is potentially an issue/improvement with llvm mi, as per microsoft/vscode-cpptools#8052

when debugging using lldb and I run '-exec "show cwd"' in vscode's debug console, I get "error: 'show' is not a valid command. ", which indicates that lldb does not implement this feature.

Could you point me in the right direction so I could possibly implement this gdb MI interface to change cwd when debugging?

Many thanks.

@tkrasnukha
Copy link
Member

"show cwd" is not a correct LLDB command, the correct one is "platform shell pwd". You can set an alias for it to have the same caller code for GDB and LLDB:

However, users are free to customize lldb’s command set however they like, and since lldb reads the file ~/.lldbinit at startup, you can store all your aliases there and they will be generally available to you. Your aliases are also documented in the help command so you can remind yourself of what you’ve set up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants