Browse Source

Now uses lldb API for stepping

merge-requests/365/head
eidheim 10 years ago
parent
commit
ce7567fe29
  1. 24
      src/debug.cc
  2. 3
      src/debug.h
  3. 21
      src/window.cc

24
src/debug.cc

@ -217,6 +217,30 @@ void Debug::kill() {
event_mutex.unlock();
}
void Debug::step_over() {
event_mutex.lock();
if(state==lldb::StateType::eStateStopped) {
process->GetSelectedThread().StepOver();
}
event_mutex.unlock();
}
void Debug::step_into() {
event_mutex.lock();
if(state==lldb::StateType::eStateStopped) {
process->GetSelectedThread().StepInto();
}
event_mutex.unlock();
}
void Debug::step_out() {
event_mutex.lock();
if(state==lldb::StateType::eStateStopped) {
process->GetSelectedThread().StepOut();
}
event_mutex.unlock();
}
std::pair<std::string, std::string> Debug::run_command(const std::string &command) {
std::pair<std::string, std::string> command_return;
event_mutex.lock();

3
src/debug.h

@ -26,6 +26,9 @@ public:
void continue_debug(); //can't use continue as function name
void stop();
void kill();
void step_over();
void step_into();
void step_out();
std::pair<std::string, std::string> run_command(const std::string &command);
void delete_debug(); //can't use delete as function name

21
src/window.cc

@ -872,25 +872,16 @@ void Window::set_menu_actions() {
}
});
menu.add_action("debug_step_over", [this]() {
if(debugging) {
auto command_return=Debug::get().run_command("thread step-over");
Terminal::get().async_print(command_return.first);
Terminal::get().async_print(command_return.second, true);
}
if(debugging)
Debug::get().step_over();
});
menu.add_action("debug_step_into", [this]() {
if(debugging) {
auto command_return=Debug::get().run_command("thread step-in");
Terminal::get().async_print(command_return.first);
Terminal::get().async_print(command_return.second, true);
}
if(debugging)
Debug::get().step_into();
});
menu.add_action("debug_step_out", [this]() {
if(debugging) {
auto command_return=Debug::get().run_command("thread step-out");
Terminal::get().async_print(command_return.first);
Terminal::get().async_print(command_return.second, true);
}
if(debugging)
Debug::get().step_out();
});
menu.add_action("debug_run_command", [this]() {
entry_box.clear();

Loading…
Cancel
Save