Don't turn on breakpoints when library is added
- this likely breaks tracing from libraries on x86s, but fixes ppc base
binary tracing for non-secure ppc32 cases. We'll need to tweak this
to enable the library PLTs
diff --git a/proc.c b/proc.c
index 8c42c4a..7568a75 100644
--- a/proc.c
+++ b/proc.c
@@ -487,9 +487,20 @@
{
struct Process *proc = data;
- if (filter_matches_symbol(options.filter, libsym)
- && insert_breakpoint(proc, libsym->enter_addr, libsym) == NULL)
- return CBS_STOP;
+ if (!filter_matches_symbol(options.filter, libsym))
+ return CBS_CONT;
+
+ struct breakpoint *bp = malloc(sizeof(*bp));
+ if (bp == NULL
+ || breakpoint_init(bp, proc, libsym->enter_addr, libsym) < 0) {
+ fail:
+ free(bp);
+ return CBS_FAIL;
+ }
+ if (proc_add_breakpoint(proc, bp) < 0) {
+ breakpoint_destroy(bp);
+ goto fail;
+ }
return CBS_CONT;
}