Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 91984
b: refs/heads/master
c: 77c664f
h: refs/heads/master
v: v3
  • Loading branch information
David S. Miller committed Apr 24, 2008
1 parent 4d6024a commit 0fb3bbb
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7697daaa894ca2bc5cd652269c316bcdc3ec441b
refs/heads/master: 77c664fa58624079f7a0fc29b46e8a32883633a5
16 changes: 13 additions & 3 deletions trunk/arch/sparc64/kernel/stacktrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,28 @@ void save_stack_trace(struct stack_trace *trace)
thread_base = (unsigned long) tp;
do {
struct reg_window *rw;
struct pt_regs *regs;
unsigned long pc;

/* Bogus frame pointer? */
if (fp < (thread_base + sizeof(struct thread_info)) ||
fp >= (thread_base + THREAD_SIZE))
break;

rw = (struct reg_window *) fp;
regs = (struct pt_regs *) (rw + 1);

if ((regs->magic & ~0x1ff) == PT_REGS_MAGIC) {
pc = regs->tpc;
fp = regs->u_regs[UREG_I6] + STACK_BIAS;
} else {
pc = rw->ins[7];
fp = rw->ins[6] + STACK_BIAS;
}

if (trace->skip > 0)
trace->skip--;
else
trace->entries[trace->nr_entries++] = rw->ins[7];

fp = rw->ins[6] + STACK_BIAS;
trace->entries[trace->nr_entries++] = pc;
} while (trace->nr_entries < trace->max_entries);
}
19 changes: 15 additions & 4 deletions trunk/arch/sparc64/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -2091,9 +2091,8 @@ static void user_instruction_dump(unsigned int __user *pc)

void show_stack(struct task_struct *tsk, unsigned long *_ksp)
{
unsigned long pc, fp, thread_base, ksp;
unsigned long fp, thread_base, ksp;
struct thread_info *tp;
struct reg_window *rw;
int count = 0;

ksp = (unsigned long) _ksp;
Expand All @@ -2117,15 +2116,27 @@ void show_stack(struct task_struct *tsk, unsigned long *_ksp)
printk("\n");
#endif
do {
struct reg_window *rw;
struct pt_regs *regs;
unsigned long pc;

/* Bogus frame pointer? */
if (fp < (thread_base + sizeof(struct thread_info)) ||
fp >= (thread_base + THREAD_SIZE))
break;
rw = (struct reg_window *)fp;
pc = rw->ins[7];
regs = (struct pt_regs *) (rw + 1);

if ((regs->magic & ~0x1ff) == PT_REGS_MAGIC) {
pc = regs->tpc;
fp = regs->u_regs[UREG_I6] + STACK_BIAS;
} else {
pc = rw->ins[7];
fp = rw->ins[6] + STACK_BIAS;
}

printk(" [%016lx] ", pc);
print_symbol("%s\n", pc);
fp = rw->ins[6] + STACK_BIAS;
} while (++count < 16);
#ifndef CONFIG_KALLSYMS
printk("\n");
Expand Down

0 comments on commit 0fb3bbb

Please sign in to comment.