Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 173390
b: refs/heads/master
c: ed4fe7f
h: refs/heads/master
v: v3
  • Loading branch information
Matt Fleming committed Oct 11, 2009
1 parent 43d1ce9 commit d5ff689
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 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: a6a2f2ad67506090e332f440457553c0ec011d68
refs/heads/master: ed4fe7f488008f38d5f423f0bcc736b1779d6ddc
1 change: 1 addition & 0 deletions trunk/arch/sh/include/asm/dwarf.h
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,7 @@ static inline unsigned int DW_CFA_operand(unsigned long insn)

extern struct dwarf_frame *dwarf_unwind_stack(unsigned long,
struct dwarf_frame *);
extern void dwarf_free_frame(struct dwarf_frame *);
extern int dwarf_parse_section(char *, char *, struct module *);
extern void dwarf_module_unload(struct module *);

Expand Down
22 changes: 16 additions & 6 deletions trunk/arch/sh/kernel/dwarf.c
Original file line number Diff line number Diff line change
Expand Up @@ -529,6 +529,16 @@ static int dwarf_cfa_execute_insns(unsigned char *insn_start,
return 0;
}

/**
* dwarf_free_frame - free the memory allocated for @frame
* @frame: the frame to free
*/
void dwarf_free_frame(struct dwarf_frame *frame)
{
dwarf_frame_free_regs(frame);
mempool_free(frame, dwarf_frame_pool);
}

/**
* dwarf_unwind_stack - recursively unwind the stack
* @pc: address of the function to unwind
Expand Down Expand Up @@ -649,8 +659,7 @@ struct dwarf_frame * dwarf_unwind_stack(unsigned long pc,
return frame;

bail:
dwarf_frame_free_regs(frame);
mempool_free(frame, dwarf_frame_pool);
dwarf_free_frame(frame);
return NULL;
}

Expand Down Expand Up @@ -837,10 +846,8 @@ static void dwarf_unwinder_dump(struct task_struct *task,
while (1) {
frame = dwarf_unwind_stack(return_addr, _frame);

if (_frame) {
dwarf_frame_free_regs(_frame);
mempool_free(_frame, dwarf_frame_pool);
}
if (_frame)
dwarf_free_frame(_frame);

_frame = frame;

Expand All @@ -850,6 +857,9 @@ static void dwarf_unwinder_dump(struct task_struct *task,
return_addr = frame->return_addr;
ops->address(data, return_addr, 1);
}

if (frame)
dwarf_free_frame(frame);
}

static struct unwinder dwarf_unwinder = {
Expand Down

0 comments on commit d5ff689

Please sign in to comment.