Commit 05dc16d6 authored by Randolph Chung's avatar Randolph Chung Committed by Kyle McMartin

[PARISC] unwinder improvements

Add special-case handling for "handle_interruption" so that we can rewind
past the interruption. This is useful for seeing what caused a BUG() or
WARN_ON(); otherwise the unwind stops at the interruption.
Signed-off-by: default avatarRandolph Chung <tausq@debian.org>
Signed-off-by: default avatarKyle McMartin <kyle@parisc-linux.org>
parent e036306a
...@@ -16,6 +16,8 @@ ...@@ -16,6 +16,8 @@
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <asm/assembly.h> #include <asm/assembly.h>
#include <asm/asm-offsets.h>
#include <asm/ptrace.h>
#include <asm/unwind.h> #include <asm/unwind.h>
...@@ -199,6 +201,29 @@ static int unwind_init(void) ...@@ -199,6 +201,29 @@ static int unwind_init(void)
return 0; return 0;
} }
#ifdef CONFIG_64BIT
#define get_func_addr(fptr) fptr[2]
#else
#define get_func_addr(fptr) fptr[0]
#endif
static int unwind_special(struct unwind_frame_info *info, unsigned long pc, int frame_size)
{
void handle_interruption(int, struct pt_regs *);
static unsigned long *hi = (unsigned long)&handle_interruption;
if (pc == get_func_addr(hi)) {
struct pt_regs *regs = (struct pt_regs *)(info->sp - frame_size - PT_SZ_ALGN);
dbg("Unwinding through handle_interruption()\n");
info->prev_sp = regs->gr[30];
info->prev_ip = regs->iaoq[0];
return 1;
}
return 0;
}
static void unwind_frame_regs(struct unwind_frame_info *info) static void unwind_frame_regs(struct unwind_frame_info *info)
{ {
const struct unwind_table_entry *e; const struct unwind_table_entry *e;
...@@ -312,6 +337,7 @@ static void unwind_frame_regs(struct unwind_frame_info *info) ...@@ -312,6 +337,7 @@ static void unwind_frame_regs(struct unwind_frame_info *info)
} }
} }
if (!unwind_special(info, e->region_start, frame_size)) {
info->prev_sp = info->sp - frame_size; info->prev_sp = info->sp - frame_size;
if (e->Millicode) if (e->Millicode)
info->rp = info->r31; info->rp = info->r31;
...@@ -319,6 +345,7 @@ static void unwind_frame_regs(struct unwind_frame_info *info) ...@@ -319,6 +345,7 @@ static void unwind_frame_regs(struct unwind_frame_info *info)
info->rp = *(unsigned long *)(info->prev_sp - rpoffset); info->rp = *(unsigned long *)(info->prev_sp - rpoffset);
info->prev_ip = info->rp; info->prev_ip = info->rp;
info->rp = 0; info->rp = 0;
}
dbg("analyzing func @ %lx, setting prev_sp=%lx " dbg("analyzing func @ %lx, setting prev_sp=%lx "
"prev_ip=%lx npc=%lx\n", info->ip, info->prev_sp, "prev_ip=%lx npc=%lx\n", info->ip, info->prev_sp,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment