From b812848a0eeb7c9e94199b26c852d637e5eb8aa3 Mon Sep 17 00:00:00 2001 From: Balazs Gerofi Date: Tue, 24 Jan 2017 14:47:10 +0900 Subject: [PATCH] eclair-dump-backtrace.exp: handle user space threads --- arch/x86/tools/eclair-dump-backtrace.exp.in | 39 +++++++++++++++++---- 1 file changed, 33 insertions(+), 6 deletions(-) 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." {