Browse Source

Now also selects thread when going to a variable

merge-requests/365/head
eidheim 10 years ago
parent
commit
6068cc7774
  1. 7
      src/debug.cc
  2. 2
      src/debug.h
  3. 2
      src/window.cc

7
src/debug.cc

@ -361,11 +361,12 @@ std::vector<Debug::Variable> Debug::get_variables() {
return variables;
}
void Debug::select_frame(uint32_t index) {
void Debug::select_frame(uint32_t frame_index, uint32_t thread_index_id) {
event_mutex.lock();
if(state==lldb::StateType::eStateStopped) {
auto thread=process->GetSelectedThread();
thread.SetSelectedFrame(index);
if(thread_index_id!=0)
process->SetSelectedThreadByIndexID(thread_index_id);
process->GetSelectedThread().SetSelectedFrame(frame_index);;
}
event_mutex.unlock();
}

2
src/debug.h

@ -52,7 +52,7 @@ public:
std::pair<std::string, std::string> run_command(const std::string &command);
std::vector<Frame> get_backtrace();
std::vector<Variable> get_variables();
void select_frame(uint32_t index);
void select_frame(uint32_t frame_index, uint32_t thread_index_id=0);
void delete_debug(); //can't use delete as function name

2
src/window.cc

@ -960,7 +960,7 @@ void Window::set_menu_actions() {
if(notebook.get_current_page()!=-1) {
auto view=notebook.get_current_view();
Debug::get().select_frame(variable.frame_index);
Debug::get().select_frame(variable.frame_index, variable.thread_index_id);
view->get_buffer()->place_cursor(view->get_buffer()->get_iter_at_line_index(variable.line_nr-1, variable.line_index-1));

Loading…
Cancel
Save