mcansado mcansado -4 years ago 67
C++ Question

Making a C++ file from within lldb

When debugging with lldb and understanding what the root of a bug is, you change the file and save it. It would then be convenient to be able to make the file from within lldb. Is there a way of doing this (like you would in gdb)? Not sure if it's relevant but I'm talking about C++ file specifically.

Currently I just

quit
, make the file again, and launch lldb again but this is time consuming.

Answer Source

By "make" do you mean run the shell command "make" in some directory? lldb doesn't have any explicit support for the make tool, but you can run any shell command from lldb with the platform shell command. So for instance:

(lldb) platform shell make

If you need to change the current working directory to the one where you would run make, you can do that with:

(lldb) platform set -w <directory>

BTW, if you do this often, you can put:

command alias -h "Run make in the CWD" -- make platform shell make

in your .lldbinit file, and then you can just do:

(lldb) make
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download