[Ltrace-devel] [PATCH v2 2/3] mipsel: Always add/remove breakpoints to/from the leader

edgar.iglesias at gmail.com edgar.iglesias at gmail.com
Mon Oct 1 10:06:45 UTC 2012


From: "Edgar E. Iglesias" <edgar at axis.com>

Signed-off-by: Edgar E. Iglesias <edgar at axis.com>
---
 sysdeps/linux-gnu/mipsel/plt.c   |   11 ++++++-----
 sysdeps/linux-gnu/mipsel/trace.c |    2 +-
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/sysdeps/linux-gnu/mipsel/plt.c b/sysdeps/linux-gnu/mipsel/plt.c
index 6e8dd9d..7513c28 100644
--- a/sysdeps/linux-gnu/mipsel/plt.c
+++ b/sysdeps/linux-gnu/mipsel/plt.c
@@ -181,6 +181,7 @@ void arch_symbol_ret(struct Process *proc, struct library_symbol *libsym)
 {
 	struct breakpoint *bp;
 	arch_addr_t resolved_addr;
+	struct Process *leader = proc->leader;
 
 	/* Only deal with unresolved symbols.  */
 	if (libsym->arch.type != MIPS_PLT_UNRESOLVED)
@@ -202,16 +203,16 @@ void arch_symbol_ret(struct Process *proc, struct library_symbol *libsym)
 		return;
 	}
 
-	if (breakpoint_init(bp, proc, resolved_addr, libsym) < 0)
+	if (breakpoint_init(bp, leader, resolved_addr, libsym) < 0)
 		goto err;
 
-	if (proc_add_breakpoint(proc, bp) < 0) {
+	if (proc_add_breakpoint(leader, bp) < 0) {
 		breakpoint_destroy(bp);
 		goto err;
 	}
 
-	if (breakpoint_turn_on(bp, proc) < 0) {
-		proc_remove_breakpoint(proc, bp);
+	if (breakpoint_turn_on(bp, leader) < 0) {
+		proc_remove_breakpoint(leader, bp);
 		breakpoint_destroy(bp);
 		goto err;
 	}
@@ -276,7 +277,7 @@ cb_enable_breakpoint_lib(struct Process *proc, struct library *lib, void *data)
 
 void arch_dynlink_done(struct Process *proc)
 {
-	proc_each_library(proc, NULL, cb_enable_breakpoint_lib, NULL);
+	proc_each_library(proc->leader, NULL, cb_enable_breakpoint_lib, NULL);
 }
 
 enum plt_status
diff --git a/sysdeps/linux-gnu/mipsel/trace.c b/sysdeps/linux-gnu/mipsel/trace.c
index 8094fb7..1f1a353 100644
--- a/sysdeps/linux-gnu/mipsel/trace.c
+++ b/sysdeps/linux-gnu/mipsel/trace.c
@@ -252,7 +252,7 @@ arch_atomic_singlestep(struct Process *proc, struct breakpoint *sbp,
 	while (nr-- > 0) {
 		arch_addr_t baddr = (arch_addr_t) newpcs[nr];
 		/* Not sure what to do here. We've already got a bp?  */
-		if (dict_find_entry(proc->breakpoints, baddr) != NULL) {
+		if (dict_find_entry(proc->leader->breakpoints, baddr) != NULL) {
 			fprintf(stderr, "skip %p %p\n", baddr, add_cb_data);
 			continue;
 		}
-- 
1.7.8.6




More information about the Ltrace-devel mailing list