Workaround for debugging Go tests

This commit is contained in:
Dmitry Sharshakov 2021-08-24 21:28:51 +03:00
parent 8cc6d68160
commit 2c3e2b979b
No known key found for this signature in database
GPG key ID: 471FD32E15FD8473

View file

@ -273,11 +273,14 @@ impl Application {
..
}) => {
debugger.is_running = false;
let main = debugger
.threads()
.await
.ok()
.and_then(|threads| threads.get(0).cloned());
let main = debugger.threads().await.ok().and_then(|threads| {
// Workaround for debugging Go tests. Main thread has * in beginning of its name
let mut main = threads.iter().find(|t| t.name.starts_with('*')).cloned();
if main.is_none() {
main = threads.get(0).cloned();
}
main
});
if let Some(main) = main {
let (bt, _) = debugger.stack_trace(main.id).await.unwrap();