truss - minor fix for mips

C. Jayachandran c.jayachandran at gmail.com
Wed Feb 3 07:21:16 UTC 2010


The current truss crashes even after the ptrace fix (I'd mailed
earlier) is applied.  The fsc.args needs to be allocated before it can
be filled from the registers. The following patch will fix that.
Truss output still seems to have issues (too many sigprocmask calls,
no tracing shown for static executables) which I am looking at - but
the change below seems to be needed.

Comments welcome,
JC.

Index: usr.bin/truss/mips-fbsd.c
===================================================================
--- usr.bin/truss/mips-fbsd.c   (revision 203379)
+++ usr.bin/truss/mips-fbsd.c   (working copy)
@@ -155,8 +155,8 @@
   if (nargs == 0)
     return;

+  fsc.args = malloc((1+nargs) * sizeof(unsigned long));
 #if 0 // XXX
-  fsc.args = malloc((1+nargs) * sizeof(unsigned long));
   iorequest.piod_op = PIOD_READ_D;
   iorequest.piod_offs = (void *)parm_offset;
   iorequest.piod_addr = fsc.args;


More information about the freebsd-mips mailing list