aboutsummaryrefslogtreecommitdiff
path: root/lib/nmi_backtrace.c
diff options
context:
space:
mode:
authorDoug Anderson <armlinux@m.disordat.com>2015-09-02 03:39:19 +0100
committerRussell King <rmk+kernel@arm.linux.org.uk>2015-10-03 16:36:45 +0100
commit001bf455d20645190beb98ff4ee450dfea1b7eb2 (patch)
tree00a39cbb4fff12bc55a9d9822275406ad6bd5cd7 /lib/nmi_backtrace.c
parent7e31210349e9e03a9a4dff31ab5f2bc83e8e84f5 (diff)
ARM: 8428/1: kgdb: Fix registers on sleeping tasks
Dumping registers from other sleeping tasks in KGDB was totally failing for me. All registers were reported as 0 in many cases. The code was using task_pt_regs(task) to try to get other thread registers. This doesn't appear to be the right place to look. From my tests, I saw non-zero values in this structure when we were looking at a kernel thread that had a userspace task associated with it, but it contained the register values from the userspace task. So even in the cases where registers weren't reported as 0 we were still not showing the right thing. Instead of using task_pt_regs(task) let's use task_thread_info(task). This is the same place that is referred to when doing a dump of all sleeping task stacks (kdb_show_stack() -> show_stack() -> dump_backtrace() -> unwind_backtrace() -> thread_saved_sp()). As further evidence that this is the right thing to do, you can find the following comment in "gdbstub.c" right before it calls sleeping_thread_to_gdb_regs(): Pull stuff saved during switch_to; nothing else is accessible (or even particularly relevant). This should be enough for a stack trace. ...and if you look at switch_to() it only saves r4-r11, sp and lr. Those are the same registers that I'm getting out of the task_thread_info(). With this change you can use "info thread" to see all tasks in the kernel and you can switch to other tasks and examine them in gdb. Signed-off-by: Doug Anderson <dianders@chromium.org> Tested-by: Stephen Boyd <sboyd@codeurora.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'lib/nmi_backtrace.c')
0 files changed, 0 insertions, 0 deletions