eclair-dump-backtrace.exp: dump full backtrace of all mckernel threads
This commit is contained in:
40
arch/x86/tools/eclair-dump-backtrace.exp.in
Executable file
40
arch/x86/tools/eclair-dump-backtrace.exp.in
Executable file
@ -0,0 +1,40 @@
|
||||
#!/usr/bin/expect
|
||||
|
||||
set INST_DIR "@prefix@"
|
||||
|
||||
spawn $INST_DIR/bin/eclair -d /tmp/mckernel.dump -k $INST_DIR/smp-x86/kernel/mckernel.img -i
|
||||
|
||||
set state "init"
|
||||
set thread_id 0
|
||||
|
||||
expect {
|
||||
"(eclair) " {
|
||||
switch -- $state {
|
||||
"init" {
|
||||
set state "threads"
|
||||
send "info threads\r"
|
||||
}
|
||||
"threads" {
|
||||
incr thread_id
|
||||
set state "thread_bt"
|
||||
send "thread $thread_id\r"
|
||||
}
|
||||
"thread_bt" {
|
||||
set state "threads"
|
||||
send "bt\r"
|
||||
}
|
||||
}
|
||||
|
||||
exp_continue
|
||||
}
|
||||
"Type <return> to continue, or q <return> to quit" {
|
||||
send "\r"
|
||||
exp_continue
|
||||
}
|
||||
" not known." {
|
||||
expect "(eclair) " { send "quit\r" }
|
||||
expect "Quit anyway? (y or n) " { send "y\r" }
|
||||
exit 0
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user