[Ltrace-devel] ltrace: Try to fix MIPS arch (tested against git-fcf256c)

Petr Machata pmachata at redhat.com
Sat Sep 1 00:15:11 UTC 2012

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

> My experiments were done on a Ubuntu/precise AMD64 host.
> The MIPSEL toolchain consists of binutils-2.22, gcc-4.6.3 and
> uClibc- and was provided as a so-called download-toolchain
> provided by the Freetz project.
> So a quick walk-trough my "patch" (it is compile-tested but not tested
> on bare metal!!!):

It's a first step.  It will at least save whoever will do the actual
porting a bit of trouble.

> [ breakpoints.c ]
> MIPS arch has no own "breakpoints.c".
> IIRC sth, was wrong with "list_of_symbols" in
> enable_all_breakpoints()... "Process" has no member "list_of_symbols",
> so cut off the mips-ifdef part.
> Just testing compiles or not.

Cutting this actually seems reasonable.  There was a similar ifdef for
PPC, and that is now gone as well (and PPC works fine).  I believe
ltrace now handles delaying breakpoint enablement.

> [ handle_event.c ]
> Fix "pred" uninitialized in pending_new_remove().

That should go into a separate patch.  It's a good catch, but
conceptually has nothing to do with cleaning up MIPS.

> Same as for breakpoints.c cut off the mips-ifdef, seen
> "list_of_symbols" errors in handle_breakpoint().

Hmm, that seems like an implementation of the delayed start.  I think
this can be removed as well, with the same rationale as above.

> [ ltrace-elf.h ]
> Unfortunately, the ARCH_HAVE_LTELF_DATA defined in
> "sysdeps/linux-gnu/mipsel/arch.h" is somehow not recognized.
> Restore the mips-ifdef part thrown out in struct ltelf {}.
> See commit e67635d6dcec ("Move arch-specific bits from ltrace-elf.c to
> PPC and MIPS back ends") for more details.

This is not acceptable.  If what you are seeing is redefinition error,
then arch.h might be included twice.  Note that it has no inclusion
guard.  The proper way to fix this is to put inclusion guards to that

> [ sysdeps/linux-gnu/mipsel/plt.c ]
> Add missing "library.h" include
> [ sysdeps/linux-gnu/mipsel/trace.c ]
> Add missing "backend.h" include
> Furthermore, I added the diff to original ltrace.mk and outputs of
> "make dirclean|unpacked|precompiled" of libelf and ltrace (depends on
> libelf) packages.

ltrace.mk is not part of ltrace distribution, so this is out of scope.

> As a bonbon I added syscallent.h.diff (signalent.h.diff was empty).

That should also go to a separate patch.

Would you please split your work into three patches as indicated, format
them using git format-patch, and post them to the list so that I can
include them in the distribution?

Thank you,

More information about the Ltrace-devel mailing list