diff options
author | Randolph Chung <tausq@debian.org> | 2007-06-12 02:27:32 -0400 |
---|---|---|
committer | Kyle McMartin <kyle@minerva.i.cabal.ca> | 2007-06-21 17:46:22 -0400 |
commit | 05dc16d6a175139a5872d08db56ee277ec90df5b (patch) | |
tree | fd705746e7778c1f77ec812c82c7e33da75adb30 /arch | |
parent | e036306aa1832963cd147849b282259a32f5ac08 (diff) |
[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: Randolph Chung <tausq@debian.org>
Signed-off-by: Kyle McMartin <kyle@parisc-linux.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/parisc/kernel/unwind.c | 41 |
1 files changed, 34 insertions, 7 deletions
diff --git a/arch/parisc/kernel/unwind.c b/arch/parisc/kernel/unwind.c index cad9d78312e0..322167737de7 100644 --- a/arch/parisc/kernel/unwind.c +++ b/arch/parisc/kernel/unwind.c | |||
@@ -16,6 +16,8 @@ | |||
16 | 16 | ||
17 | #include <asm/uaccess.h> | 17 | #include <asm/uaccess.h> |
18 | #include <asm/assembly.h> | 18 | #include <asm/assembly.h> |
19 | #include <asm/asm-offsets.h> | ||
20 | #include <asm/ptrace.h> | ||
19 | 21 | ||
20 | #include <asm/unwind.h> | 22 | #include <asm/unwind.h> |
21 | 23 | ||
@@ -199,6 +201,29 @@ static int unwind_init(void) | |||
199 | return 0; | 201 | return 0; |
200 | } | 202 | } |
201 | 203 | ||
204 | #ifdef CONFIG_64BIT | ||
205 | #define get_func_addr(fptr) fptr[2] | ||
206 | #else | ||
207 | #define get_func_addr(fptr) fptr[0] | ||
208 | #endif | ||
209 | |||
210 | static int unwind_special(struct unwind_frame_info *info, unsigned long pc, int frame_size) | ||
211 | { | ||
212 | void handle_interruption(int, struct pt_regs *); | ||
213 | static unsigned long *hi = (unsigned long)&handle_interruption; | ||
214 | |||
215 | if (pc == get_func_addr(hi)) { | ||
216 | struct pt_regs *regs = (struct pt_regs *)(info->sp - frame_size - PT_SZ_ALGN); | ||
217 | dbg("Unwinding through handle_interruption()\n"); | ||
218 | info->prev_sp = regs->gr[30]; | ||
219 | info->prev_ip = regs->iaoq[0]; | ||
220 | |||
221 | return 1; | ||
222 | } | ||
223 | |||
224 | return 0; | ||
225 | } | ||
226 | |||
202 | static void unwind_frame_regs(struct unwind_frame_info *info) | 227 | static void unwind_frame_regs(struct unwind_frame_info *info) |
203 | { | 228 | { |
204 | const struct unwind_table_entry *e; | 229 | const struct unwind_table_entry *e; |
@@ -312,13 +337,15 @@ static void unwind_frame_regs(struct unwind_frame_info *info) | |||
312 | } | 337 | } |
313 | } | 338 | } |
314 | 339 | ||
315 | info->prev_sp = info->sp - frame_size; | 340 | if (!unwind_special(info, e->region_start, frame_size)) { |
316 | if (e->Millicode) | 341 | info->prev_sp = info->sp - frame_size; |
317 | info->rp = info->r31; | 342 | if (e->Millicode) |
318 | else if (rpoffset) | 343 | info->rp = info->r31; |
319 | info->rp = *(unsigned long *)(info->prev_sp - rpoffset); | 344 | else if (rpoffset) |
320 | info->prev_ip = info->rp; | 345 | info->rp = *(unsigned long *)(info->prev_sp - rpoffset); |
321 | info->rp = 0; | 346 | info->prev_ip = info->rp; |
347 | info->rp = 0; | ||
348 | } | ||
322 | 349 | ||
323 | dbg("analyzing func @ %lx, setting prev_sp=%lx " | 350 | dbg("analyzing func @ %lx, setting prev_sp=%lx " |
324 | "prev_ip=%lx npc=%lx\n", info->ip, info->prev_sp, | 351 | "prev_ip=%lx npc=%lx\n", info->ip, info->prev_sp, |