[Ltrace-devel] 0.7.0 released

Petr Machata pmachata at redhat.com
Fri Nov 9 23:10:46 UTC 2012


Sedat Dilek <sedat.dilek at gmail.com> writes:

> Just to mention... On MIPS(EL) I need to apply Edgar's patch from [1]
> or this "brutal" one:
>
> --- proc.c
> +++ proc.c
> @@ -752,8 +752,10 @@ breakpoint_for_symbol(struct library_sym
>         struct breakpoint *bp = dict_find_entry(proc->breakpoints,
>                                                 bp_addr);
>         if (bp != NULL) {
> +#if defined (host_mips)
>                 assert(bp->libsym == NULL);
>                 bp->libsym = libsym;
> +#endif
>                 return 0;
>         }
>
> Dunno why "#ifdef __mips__" fails here... Just checked the config(ure)* logs.
>
> Should this be "make ... ARCH=mips ..." or can I use "ARCH=mipsel"?

Does the following excerpt from your [1] fix the problem?

diff --git a/sysdeps/linux-gnu/mipsel/plt.c b/sysdeps/linux-gnu/mipsel/plt.c
index 7799dfa..7bb00e0 100644
--- a/sysdeps/linux-gnu/mipsel/plt.c
+++ b/sysdeps/linux-gnu/mipsel/plt.c
@@ -251,6 +251,13 @@ void arch_symbol_ret(struct Process *proc, struct library_symbol *libsym)
 		return;
 	}
 
+	/* For multiple symbols that resolve to the same address, we need
+	 * to avoid adding multiple breakpoints.  */
+	if (dict_find_entry(proc->leader->breakpoints, resolved_addr) != NULL) {
+		fprintf(stderr, "%s: skip %p %s\n", __func__, resolved_addr, libsym->name);
+		return;
+	}
+
 	bp = malloc(sizeof (*bp));
 	if (bp == NULL) {
 		fprintf(stderr, "Failed to allocate bp for %s\n",

If yes, and if you can fix coding style in that (probably call debug
instead of fprintf, keep line length <=80), then I'd be happy to apply
such patch.

Thanks,
PM



More information about the Ltrace-devel mailing list