···3838 help3939 This option allows you to set the stack depth that the kernel4040 prints in stack traces.4141+4242+config PRINT_USER_CODE_ON_UNHANDLED_EXCEPTION4343+ bool "Dump user code around unhandled exception address"4444+ help4545+ Enable this option to display user code around PC of the unhandled4646+ exception (starting at address aligned on 16 byte boundary).4747+ This may simplify finding faulting code in the absence of other4848+ debug facilities.
+18
arch/xtensa/kernel/traps.c
···175175 die(str, regs, err);176176}177177178178+#ifdef CONFIG_PRINT_USER_CODE_ON_UNHANDLED_EXCEPTION179179+static inline void dump_user_code(struct pt_regs *regs)180180+{181181+ char buf[32];182182+183183+ if (copy_from_user(buf, (void __user *)(regs->pc & -16), sizeof(buf)) == 0) {184184+ print_hex_dump(KERN_INFO, " ", DUMP_PREFIX_NONE,185185+ 32, 1, buf, sizeof(buf), false);186186+187187+ }188188+}189189+#else190190+static inline void dump_user_code(struct pt_regs *regs)191191+{192192+}193193+#endif194194+178195/*179196 * Unhandled Exceptions. Kill user task or panic if in kernel space.180197 */···207190 "\tEXCCAUSE is %ld\n",208191 current->comm, task_pid_nr(current), regs->pc,209192 regs->exccause);193193+ dump_user_code(regs);210194 force_sig(SIGILL);211195}212196