aboutsummaryrefslogtreecommitdiff
path: root/handle_event.c
diff options
context:
space:
mode:
authorPetr Machata <pmachata@redhat.com>2013-01-30 23:09:02 +0100
committerPetr Machata <pmachata@redhat.com>2013-03-12 00:08:50 +0100
commitf9d93c50bd246ea7fd42e0c8ad24aa01467e76ac (patch)
tree317a6f33b6490d03c11a02f811439409b3de55d7 /handle_event.c
parente50355295eac26e15db259fbb7ff705487b501d0 (diff)
downloadltrace-f9d93c50bd246ea7fd42e0c8ad24aa01467e76ac.tar.gz
Fix tracing Thumb mode on ARM
- Drop what amounts to global variable thumb_mode from struct process - Thumb mode is encoded to address. That means that the code in callstack_push_symfunc and insert_breakpoint has to assume that what comes from get_return_address is mangled, and needs to go through creating the breakpoint and then looking at its address. That's awkward, and we should come up with a better API.
Diffstat (limited to 'handle_event.c')
-rw-r--r--handle_event.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/handle_event.c b/handle_event.c
index ea73785..3101847 100644
--- a/handle_event.c
+++ b/handle_event.c
@@ -737,9 +737,11 @@ callstack_push_symfunc(struct process *proc, struct library_symbol *sym)
elem->is_syscall = 0;
elem->c_un.libfunc = sym;
- elem->return_addr = proc->return_addr;
- if (elem->return_addr)
- insert_breakpoint(proc, elem->return_addr, NULL);
+ arch_addr_t return_addr = get_return_addr(proc, proc->stack_pointer);
+ struct breakpoint *rbp = NULL;
+ if (return_addr != 0)
+ rbp = insert_breakpoint(proc, return_addr, NULL);
+ elem->return_addr = rbp != NULL ? rbp->addr : 0;
if (opt_T || options.summary) {
struct timezone tz;