Drop return_addr from struct process
- The only interesting use seems to be in output.c, but there we assume
we are working with top-of-callstack anyway, and store fetch context
there, so we can simply fetch the return address this way as well.
diff --git a/handle_event.c b/handle_event.c
index 3101847..8292e5a 100644
--- a/handle_event.c
+++ b/handle_event.c
@@ -622,7 +622,6 @@
calc_time_spent(event->proc);
}
}
- event->proc->return_addr = brk_addr;
struct library_symbol *libsym =
event->proc->callstack[i].c_un.libfunc;
@@ -678,8 +677,6 @@
if (event->proc->state != STATE_IGNORED
&& sbp->libsym != NULL) {
event->proc->stack_pointer = get_stack_pointer(event->proc);
- event->proc->return_addr =
- get_return_addr(event->proc, event->proc->stack_pointer);
callstack_push_symfunc(event->proc, sbp->libsym);
output_left(LT_TOF_FUNCTION, event->proc, sbp->libsym);
}
diff --git a/output.c b/output.c
index 0005242..57fc7d0 100644
--- a/output.c
+++ b/output.c
@@ -121,12 +121,15 @@
}
}
if (opt_i) {
- if (is_func)
+ if (is_func) {
+ struct callstack_element *stel
+ = &proc->callstack[proc->callstack_depth - 1];
current_column += fprintf(options.output, "[%p] ",
- proc->return_addr);
- else
+ stel->return_addr);
+ } else {
current_column += fprintf(options.output, "[%p] ",
proc->instruction_pointer);
+ }
}
if (options.indent > 0 && indent) {
output_indent(proc);
diff --git a/proc.h b/proc.h
index 1b5fe03..e46b235 100644
--- a/proc.h
+++ b/proc.h
@@ -65,7 +65,7 @@
struct library_symbol * libfunc;
} c_un;
int is_syscall;
- void * return_addr;
+ arch_addr_t return_addr;
struct timeval time_spent;
struct fetch_context *fetch_context;
struct value_dict *arguments;
@@ -104,7 +104,6 @@
/* Arch-dependent: */
void * instruction_pointer;
void * stack_pointer; /* To get return addr, args... */
- void * return_addr;
void * arch_ptr;
/* XXX We would like to replace this with a pointer to ABI