aboutsummaryrefslogtreecommitdiff
path: root/proc.h
diff options
context:
space:
mode:
authorPetr Machata <pmachata@redhat.com>2012-10-27 19:23:12 +0200
committerPetr Machata <pmachata@redhat.com>2012-10-27 19:23:12 +0200
commit165b566a50b2bd560af3bd9649e456915397066b (patch)
tree628db7a9bc75ef25d21f596dbea5ffe8bd1cb1bd /proc.h
parent45de1a24740e813ac10b981684a9b46814ddb38c (diff)
downloadltrace-165b566a50b2bd560af3bd9649e456915397066b.tar.gz
Add proc_find_symbol, use it to find corresponding symbols for clones
The code in breakpoint_clone was buggy--it looked through old_proc's symbols. It was also needlessly verbose, proc_find_symbol uses library key to find the right library. Instead use the new interface and call it on new_proc to find the new symbol. We also didn't relink symbols in stack elements of a cloned process in process_clone. Use proc_find_symbol for this as well.
Diffstat (limited to 'proc.h')
-rw-r--r--proc.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/proc.h b/proc.h
index ab8794b..68054b3 100644
--- a/proc.h
+++ b/proc.h
@@ -241,4 +241,12 @@ void *proc_each_breakpoint(struct Process *proc, void *start,
* If tag is not found, return a negative value. */
int proc_find_dynamic_entry_addr(struct Process *proc, arch_addr_t src_addr,
int d_tag, arch_addr_t *ret);
+
+/* Finds a symbol corresponding to LIBSYM in a process PROC. Returns
+ * 0 and sets *RETLIB and *RETSYM if the corresponding pointer is
+ * non-NULL. Returns a negative value when the symbols couldn't be
+ * found. */
+int proc_find_symbol(struct Process *proc, struct library_symbol *sym,
+ struct library **retlib, struct library_symbol **retsym);
+
#endif /* _PROC_H_ */