cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
ssh@sgi.com
Visitor
Visitor
2,114 Views
Registered: ‎03-28-2008

strace for microblaze+MMU

I now have a 2.6.35 mainline Microblaze+MMU system running
on our custom Spartan 3a board.    I saw that Microblaze
patches were added recently for 'strace', so I tried
to build strace (using the latest strace snapshot).

When I build, I get a compile error that I traced back to
a conflict related to the definition of the symbol PT_PC.
I'm using the Xilinx toolchain called out here:
     http://xilinx.wikidot.com/mb-gnu-tools


In the toolchain source, the file:
    microblaze-unknown-linux-gnu/microblaze-unknown-linux-gnu/sys-root/usr/include/sys/reg.h
has this definition:
      PT_PC = 18,
    #define PT_PC PT_PC


But in the Microblaze linux source, the file:
    arch/microblaze/include/asm/ptrace.h
has this definition:
    #define PT_PC           (32 * sizeof(microblaze_reg_t))


These two definitions collide when I am building
strace, specifically when building syscall.c in strace.


To work around this, I changed the asm/ptrace.h definition
of "PT_PC" and renamed it "PT_RPC", and I changed that
reference in strace/process.c.    When I did that, strace built
and ran on my platform.     (Interestingly, it segfaulted when
I tried to attach to a running PID, but it worked when I
ran an app under strace.)


Has anyone been trying to build and use strace in a similar
config?    I'd appreciate any pointers.

Thanks!
Steve

0 Kudos
Reply
0 Replies