Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 167893
b: refs/heads/master
c: 60339fa
h: refs/heads/master
i:
  167891: d0abd17
v: v3
  • Loading branch information
Matt Fleming authored and Paul Mundt committed Oct 26, 2009
1 parent c349857 commit 837a3d8
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 26fadd3672964596d33548490b9756014ae0f414
refs/heads/master: 60339fad5c68c9c533cd14e67194ff8f727c41d9
22 changes: 22 additions & 0 deletions trunk/arch/sh/kernel/dwarf.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include <linux/list.h>
#include <linux/mempool.h>
#include <linux/mm.h>
#include <linux/ftrace.h>
#include <asm/dwarf.h>
#include <asm/unwinder.h>
#include <asm/sections.h>
Expand Down Expand Up @@ -557,6 +558,27 @@ struct dwarf_frame * dwarf_unwind_stack(unsigned long pc,
if (!pc && !prev)
pc = (unsigned long)current_text_addr();

#ifdef CONFIG_FUNCTION_GRAPH_TRACER
/*
* If our stack has been patched by the function graph tracer
* then we might see the address of return_to_handler() where we
* expected to find the real return address.
*/
if (pc == (unsigned long)&return_to_handler) {
int index = current->curr_ret_stack;

/*
* We currently have no way of tracking how many
* return_to_handler()'s we've seen. If there is more
* than one patched return address on our stack,
* complain loudly.
*/
WARN_ON(index > 0);

pc = current->ret_stack[index].ret;
}
#endif

frame = mempool_alloc(dwarf_frame_pool, GFP_ATOMIC);
if (!frame) {
printk(KERN_ERR "Unable to allocate a dwarf frame\n");
Expand Down

0 comments on commit 837a3d8

Please sign in to comment.