Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 163488
b: refs/heads/master
c: 5580e90
h: refs/heads/master
v: v3
  • Loading branch information
Matt Fleming committed Aug 21, 2009
1 parent d6033ca commit 7c5c13f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 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: 5480675dc60c7dda7146e506981b2b40a775cc1e
refs/heads/master: 5580e9044df9c0e87861739d8c527006ead92e52
3 changes: 3 additions & 0 deletions trunk/arch/sh/include/asm/dwarf.h
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,7 @@ struct dwarf_reg {
unsigned long flags;
#define DWARF_REG_OFFSET (1 << 0)
#define DWARF_VAL_OFFSET (1 << 1)
#define DWARF_UNDEFINED (1 << 2)
};

/*
Expand Down Expand Up @@ -370,6 +371,7 @@ extern struct dwarf_frame *dwarf_unwind_stack(unsigned long,
#define CFI_DEF_CFA .cfi_def_cfa
#define CFI_REGISTER .cfi_register
#define CFI_REL_OFFSET .cfi_rel_offset
#define CFI_UNDEFINED .cfi_undefined

#else

Expand All @@ -383,6 +385,7 @@ extern struct dwarf_frame *dwarf_unwind_stack(unsigned long,
#define CFI_DEF_CFA CFI_IGNORE
#define CFI_REGISTER CFI_IGNORE
#define CFI_REL_OFFSET CFI_IGNORE
#define CFI_UNDEFINED CFI_IGNORE

#ifndef __ASSEMBLY__
static inline void dwarf_unwinder_init(void)
Expand Down
13 changes: 11 additions & 2 deletions trunk/arch/sh/kernel/dwarf.c
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,8 @@ static int dwarf_cfa_execute_insns(unsigned char *insn_start,
case DW_CFA_undefined:
count = dwarf_read_uleb128(current_insn, &reg);
current_insn += count;
regp = dwarf_frame_alloc_reg(frame, reg);
regp->flags |= DWARF_UNDEFINED;
break;
case DW_CFA_def_cfa:
count = dwarf_read_uleb128(current_insn,
Expand Down Expand Up @@ -629,9 +631,16 @@ struct dwarf_frame * dwarf_unwind_stack(unsigned long pc,
UNWINDER_BUG();
}

/* If we haven't seen the return address reg, we're screwed. */
reg = dwarf_frame_reg(frame, DWARF_ARCH_RA_REG);
UNWINDER_BUG_ON(!reg);

/*
* If we haven't seen the return address register or the return
* address column is undefined then we must assume that this is
* the end of the callstack.
*/
if (!reg || reg->flags == DWARF_UNDEFINED)
goto bail;

UNWINDER_BUG_ON(reg->flags != DWARF_REG_OFFSET);

addr = frame->cfa + reg->addr;
Expand Down

0 comments on commit 7c5c13f

Please sign in to comment.