Re: [PATCH] i386: Do backtrace fallback too

Erik Mouw
2006-07-29T10:28:13Z

On Sat, Jul 29, 2006 at 03:54:14AM -0400, Dave Jones wrote:
> On Sat, Jul 29, 2006 at 03:00:06AM +0000, Linux Kernel wrote:
> > commit c97d20a6c51067a38f53680d9609b4cf2867d077

[...]

> Hmm, this breaks the build for me..
>
> arch/i386/kernel/traps.c: In function 'show_trace_log_lvl':
> arch/i386/kernel/traps.c:195: error: invalid type argument of '->'
> arch/i386/kernel/traps.c:198: error: invalid type argument of '->'
> arch/i386/kernel/traps.c:199: error: invalid type argument of '->'
> make[1]: *** [arch/i386/kernel/traps.o] Error 1
>
> (The line numbers are different to mainline due to some unrelated
> patches, they point to the UNW_PC/UNW_SP usages),
>
>
> Also, shouldn't this..
>
> print_symbol("DWARF2 unwinder stuck at %s\n",
> UNW_PC(info.regs));
>
> be using %p ?

It should be UNWP_PC(&info), just like in the functions above. Here's a
patch:

Signed-off-by: Erik Mouw <erik@harddisk-recovery.com>

diff --git a/arch/i386/kernel/traps.c b/arch/i386/kernel/traps.c
index 3facc8f..017c015 100644
--- a/arch/i386/kernel/traps.c
+++ b/arch/i386/kernel/traps.c
@@ -190,11 +190,11 @@ static void show_trace_log_lvl(struct ta
if (unw_ret > 0 && !arch_unw_user_mode(&info)) {
#ifdef CONFIG_STACK_UNWIND
print_symbol("DWARF2 unwinder stuck at %s\n",
- UNW_PC(info.regs));
+ UNW_PC(&info));
if (call_trace == 1) {
printk("Leftover inexact backtrace:\n");
- if (UNW_SP(info.regs))
- stack = (void *)UNW_SP(info.regs);
+ if (UNW_SP(&info))
+ stack = (void *)UNW_SP(&info);
} else if (call_trace > 1)
return;
else

Erik

--
+-- Erik Mouw -- www.harddisk-recovery.com -- +31 70 370 12 90 --
| Lab address: Delftechpark 26, 2628 XH, Delft, The Netherlands