diff --git a/arch/x86/tools/eclair-dump-backtrace.exp.in b/arch/x86/tools/eclair-dump-backtrace.exp.in index 7ac9b771..f0555b5f 100755 --- a/arch/x86/tools/eclair-dump-backtrace.exp.in +++ b/arch/x86/tools/eclair-dump-backtrace.exp.in @@ -8,19 +8,36 @@ set state "init" set thread_id 0 expect { + "in ?? ()" { + switch -- $state { + "thread_chosen" { + set state "thread_skip" + } + "thread_bt" { + set state "thread_skip" + } + } + + exp_continue + } "(eclair) " { switch -- $state { "init" { - set state "threads" + set state "threads_list" send "info threads\r" } - "threads" { + "threads_list" { incr thread_id - set state "thread_bt" + set state "thread_chosen" send "thread $thread_id\r" } - "thread_bt" { - set state "threads" + "thread_skip" { + incr thread_id + set state "thread_chosen" + send "thread $thread_id\r" + } + "thread_chosen" { + set state "thread_bt" send "bt\r" } } @@ -28,7 +45,17 @@ expect { exp_continue } "Type to continue, or q to quit" { - send "\r" + switch -- $state { + "threads_list" { + send "\r" + } + "thread_bt" { + send "\r" + } + "thread_skip" { + send "q\r" + } + } exp_continue } " not known." {