Always use the kdb_thr_ctx() for db_trace_thread() as on other
architectures. Initialize pcb_ra to be the sepc from the saved
trapframe rather than the saved ra to avoid skipping a frame.
Details
Details
- Reviewers
mhorne br - Commits
- rS357632: Use the context created in makectx() for stack traces.
- compared traces from ddb
Diff Detail
Diff Detail
- Lint
Lint Skipped - Unit
Tests Skipped - Build Status
Buildable 29177 Build 27109: arc lint + arc unit
Event Timeline
Comment Actions
Before:
KDB: enter: sysctl debug.kdb.enter [ thread pid 690 tid 100049 ] Stopped at kdb_trap+0x42a: sd zero,0(a0) db> tr Tracing pid 690 tid 100049 td 0xffffffd001a26560 db_trace_self() at db_trace_self db_hex2dec() at db_hex2dec+0x1d2 db_command_loop() at db_command_loop+0x2c6 db_command_loop() at db_command_loop+0x6a db_fetch_ksymtab() at db_fetch_ksymtab+0x2c8 kdb_trap() at kdb_trap+0x156 do_trap_supervisor() at do_trap_supervisor+0xaa cpu_exception_handler_supervisor() at cpu_exception_handler_supervisor+0x6a --- exception 3, tval = 0 kdb_trap() at kdb_trap+0x42a sbuf_new_for_sysctl() at sbuf_new_for_sysctl+0x11a kernel_sysctl() at kernel_sysctl+0x376 userland_sysctl() at userland_sysctl+0x150 sys___sysctl() at sys___sysctl+0x54 do_trap_user() at do_trap_user+0x3d6 cpu_exception_handler_user() at cpu_exception_handler_user+0x74 --- exception 8, tval = 0 db> c
vs after:
KDB: enter: sysctl debug.kdb.enter [ thread pid 700 tid 100063 ] Stopped at kdb_trap+0x42a: sd zero,0(a0) db> tr Tracing pid 700 tid 100063 td 0xffffffd03e80c560 kdb_trap() at kdb_trap+0x428 sbuf_new_for_sysctl() at sbuf_new_for_sysctl+0x11a kernel_sysctl() at kernel_sysctl+0x376 userland_sysctl() at userland_sysctl+0x150 sys___sysctl() at sys___sysctl+0x54 do_trap_user() at do_trap_user+0x3d6 cpu_exception_handler_user() at cpu_exception_handler_user+0x74 --- exception 8, tval = 0 db> c
Mostly it means stack traces don't show the internals of being in ddb itself but start at the time of entering the debugger.
Comment Actions
Yes, it was probably copied from arm64 originally. Fixing it on those platforms requires auditing makectx() to make sure it DTRT however.