简体   繁体   中英

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM