diff options
author | Dmitry Sharshakov | 2021-09-05 13:09:38 +0000 |
---|---|---|
committer | Dmitry Sharshakov | 2021-09-05 13:09:38 +0000 |
commit | c9cd06e90400969285eb8ecbb4cfb7abeeef59ca (patch) | |
tree | 0dc8734225ec45cc7b35e3d654d6276f3b7c84ac /helix-term/src/commands | |
parent | bdd636d8ee415d2cf40df9794ad40d27fc1c1432 (diff) |
Fetch stack traces for all threads when debugger sets all_thread_stopped flag
Diffstat (limited to 'helix-term/src/commands')
-rw-r--r-- | helix-term/src/commands/dap.rs | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/helix-term/src/commands/dap.rs b/helix-term/src/commands/dap.rs index 14c040df..61b1f438 100644 --- a/helix-term/src/commands/dap.rs +++ b/helix-term/src/commands/dap.rs @@ -45,20 +45,21 @@ pub async fn select_thread_id(editor: &mut Editor, thread_id: isize, force: bool } debugger.thread_id = Some(thread_id); + fetch_stack_trace(debugger, thread_id).await; - // fetch stack trace - // TODO: handle requesting more total frames + let frame = debugger.stack_frames[&thread_id].get(0).cloned(); + if let Some(frame) = &frame { + jump_to_stack_frame(editor, frame); + } +} + +pub async fn fetch_stack_trace(debugger: &mut Client, thread_id: isize) { let (frames, _) = match debugger.stack_trace(thread_id).await { Ok(frames) => frames, Err(_) => return, }; debugger.stack_frames.insert(thread_id, frames); - debugger.active_frame = Some(0); // TODO: check how to determine this - - let frame = debugger.stack_frames[&thread_id].get(0).cloned(); - if let Some(frame) = &frame { - jump_to_stack_frame(editor, frame); - } + debugger.active_frame = Some(0); } pub fn jump_to_stack_frame(editor: &mut Editor, frame: &helix_dap::StackFrame) { |