|
|
|
@ -150,7 +150,7 @@ void Project::debug_update_stop() { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
//Add debug stop source mark
|
|
|
|
// Add debug stop source mark
|
|
|
|
debug_last_stop_file_path.clear(); |
|
|
|
debug_last_stop_file_path.clear(); |
|
|
|
for(size_t c = 0; c < Notebook::get().size(); c++) { |
|
|
|
for(size_t c = 0; c < Notebook::get().size(); c++) { |
|
|
|
auto view = Notebook::get().get_view(c); |
|
|
|
auto view = Notebook::get().get_view(c); |
|
|
|
@ -369,8 +369,8 @@ void Project::LLDB::debug_compile_and_start() { |
|
|
|
auto view = Notebook::get().get_current_view(); |
|
|
|
auto view = Notebook::get().get_current_view(); |
|
|
|
run_arguments = build->get_executable(view ? view->file_path : Directories::get().path).string(); |
|
|
|
run_arguments = build->get_executable(view ? view->file_path : Directories::get().path).string(); |
|
|
|
if(run_arguments.empty()) { |
|
|
|
if(run_arguments.empty()) { |
|
|
|
if(!build->is_valid()) |
|
|
|
if(!build->is_valid(default_build_path)) |
|
|
|
Terminal::get().print("\e[31mError\e[m: build folder no longer valid, please rebuild project.\n", true); |
|
|
|
Terminal::get().print("\e[31mError\e[m: build folder no longer valid, please recreate project.\n", true); |
|
|
|
else { |
|
|
|
else { |
|
|
|
Terminal::get().print("\e[33mWarning\e[m: could not find executable.\n"); |
|
|
|
Terminal::get().print("\e[33mWarning\e[m: could not find executable.\n"); |
|
|
|
Terminal::get().print("Either use Project Set Run Arguments, or open a source file within a directory where an executable is defined.\n"); |
|
|
|
Terminal::get().print("Either use Project Set Run Arguments, or open a source file within a directory where an executable is defined.\n"); |
|
|
|
@ -389,9 +389,12 @@ void Project::LLDB::debug_compile_and_start() { |
|
|
|
Terminal::get().clear(); |
|
|
|
Terminal::get().clear(); |
|
|
|
|
|
|
|
|
|
|
|
Terminal::get().print("\e[2mCompiling and debugging: " + run_arguments + "\e[m\n"); |
|
|
|
Terminal::get().print("\e[2mCompiling and debugging: " + run_arguments + "\e[m\n"); |
|
|
|
Terminal::get().async_process(build->get_compile_command(), debug_build_path, [self = this->shared_from_this(), run_arguments, project_path = build->project_path, remote_host](int exit_status) { |
|
|
|
Terminal::get().async_process(build->get_compile_command(), debug_build_path, [self = shared_from_this(), debug_build_path, run_arguments, project_path = build->project_path, remote_host](int exit_status) { |
|
|
|
if(exit_status != EXIT_SUCCESS) |
|
|
|
if(exit_status != 0) { |
|
|
|
debugging = false; |
|
|
|
debugging = false; |
|
|
|
|
|
|
|
if(!self->build->is_valid(debug_build_path)) |
|
|
|
|
|
|
|
Terminal::get().print("\e[31mError\e[m: build folder no longer valid, please recreate project.\n", true); |
|
|
|
|
|
|
|
} |
|
|
|
else { |
|
|
|
else { |
|
|
|
self->debug_start(run_arguments, project_path, remote_host); |
|
|
|
self->debug_start(run_arguments, project_path, remote_host); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -546,7 +549,7 @@ void Project::LLDB::debug_backtrace() { |
|
|
|
for(auto &frame : frames) { |
|
|
|
for(auto &frame : frames) { |
|
|
|
std::string row = "<i>" + frame.module_filename + "</i>"; |
|
|
|
std::string row = "<i>" + frame.module_filename + "</i>"; |
|
|
|
|
|
|
|
|
|
|
|
//Shorten frame.function_name if it is too long
|
|
|
|
// Shorten frame.function_name if it is too long
|
|
|
|
if(frame.function_name.size() > 120) { |
|
|
|
if(frame.function_name.size() > 120) { |
|
|
|
frame.function_name = frame.function_name.substr(0, 58) + "...." + frame.function_name.substr(frame.function_name.size() - 58); |
|
|
|
frame.function_name = frame.function_name.substr(0, 58) + "...." + frame.function_name.substr(frame.function_name.size() - 58); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -717,8 +720,10 @@ void Project::Clang::compile() { |
|
|
|
Terminal::get().clear(); |
|
|
|
Terminal::get().clear(); |
|
|
|
|
|
|
|
|
|
|
|
Terminal::get().print("\e[2mCompiling project: " + filesystem::get_short_path(build->project_path).string() + "\e[m\n"); |
|
|
|
Terminal::get().print("\e[2mCompiling project: " + filesystem::get_short_path(build->project_path).string() + "\e[m\n"); |
|
|
|
Terminal::get().async_process(build->get_compile_command(), default_build_path, [](int exit_status) { |
|
|
|
Terminal::get().async_process(build->get_compile_command(), default_build_path, [self = shared_from_this(), default_build_path](int exit_status) { |
|
|
|
compiling = false; |
|
|
|
compiling = false; |
|
|
|
|
|
|
|
if(exit_status != 0 && !self->build->is_valid(default_build_path)) |
|
|
|
|
|
|
|
Terminal::get().print("\e[31mError\e[m: build folder no longer valid, please recreate project.\n", true); |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -738,8 +743,8 @@ void Project::Clang::compile_and_run() { |
|
|
|
auto view = Notebook::get().get_current_view(); |
|
|
|
auto view = Notebook::get().get_current_view(); |
|
|
|
auto executable = build->get_executable(view ? view->file_path : Directories::get().path); |
|
|
|
auto executable = build->get_executable(view ? view->file_path : Directories::get().path); |
|
|
|
if(executable.empty()) { |
|
|
|
if(executable.empty()) { |
|
|
|
if(!build->is_valid()) |
|
|
|
if(!build->is_valid(default_build_path)) |
|
|
|
Terminal::get().print("\e[31mError\e[m: build folder no longer valid, please rebuild project.\n", true); |
|
|
|
Terminal::get().print("\e[31mError\e[m: build folder no longer valid, please recreate project.\n", true); |
|
|
|
else { |
|
|
|
else { |
|
|
|
Terminal::get().print("\e[33mWarning\e[m: could not find executable.\n"); |
|
|
|
Terminal::get().print("\e[33mWarning\e[m: could not find executable.\n"); |
|
|
|
Terminal::get().print("Either use Project Set Run Arguments, or open a source file within a directory where an executable is defined.\n"); |
|
|
|
Terminal::get().print("Either use Project Set Run Arguments, or open a source file within a directory where an executable is defined.\n"); |
|
|
|
@ -755,13 +760,15 @@ void Project::Clang::compile_and_run() { |
|
|
|
Terminal::get().clear(); |
|
|
|
Terminal::get().clear(); |
|
|
|
|
|
|
|
|
|
|
|
Terminal::get().print("\e[2mCompiling and running: " + arguments + "\e[m\n"); |
|
|
|
Terminal::get().print("\e[2mCompiling and running: " + arguments + "\e[m\n"); |
|
|
|
Terminal::get().async_process(build->get_compile_command(), default_build_path, [arguments, project_path](int exit_status) { |
|
|
|
Terminal::get().async_process(build->get_compile_command(), default_build_path, [self = shared_from_this(), arguments, project_path, default_build_path](int exit_status) { |
|
|
|
compiling = false; |
|
|
|
compiling = false; |
|
|
|
if(exit_status == 0) { |
|
|
|
if(exit_status == 0) { |
|
|
|
Terminal::get().async_process(arguments, project_path, [arguments](int exit_status) { |
|
|
|
Terminal::get().async_process(arguments, project_path, [arguments](int exit_status) { |
|
|
|
Terminal::get().print("\e[2m" + arguments + " returned: " + (exit_status == 0 ? "\e[32m" : "\e[31m") + std::to_string(exit_status) + "\e[m\n"); |
|
|
|
Terminal::get().print("\e[2m" + arguments + " returned: " + (exit_status == 0 ? "\e[32m" : "\e[31m") + std::to_string(exit_status) + "\e[m\n"); |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
else if(!self->build->is_valid(default_build_path)) |
|
|
|
|
|
|
|
Terminal::get().print("\e[31mError\e[m: build folder no longer valid, please recreate project.\n", true); |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|