Debugging a linux application and library in freebsd

Mateusz Guzik mjguzik at gmail.com
Fri Jan 4 14:30:09 UTC 2013


On Fri, Jan 04, 2013 at 02:28:35PM +0100, Martin Laabs wrote:
> Hi,
> 
> I'm currently searching a bug in the linuxulator concerning a libc
> function. Therefore it would be very helpful using gdb to trace the program
> not only instruction for instruction but also with the source code and full
> symbols.
> Building the linux binary that reproduce the bug is done in a VM running an
> somewhat old debian. Building it with debugging symbols is also no problem.
> I could also imagine to build the libc with debugging symbols (if not
> available in some binary packages)
> Would you suggest to do this with a cross compiler under the linuxulator
> enviroment or in the debian VM?
> 
> But anyway - the native gdb does not support linux binaries very well. So
> did anyone tried to run a linux gdb inside the linuxulator enviroment to
> trace the bug down into the library? Obviously the linux gdb does not know
> anything about the linux-call translation but this should be transparent to it.
> 

Afair linuxolator on amd64 does not support ptrace, therefore no gdb for
you.

However if this is still about
http://www.freebsd.org/cgi/query-pr.cgi?pr=174933 I don't think you need
it at this stage. You should be able to easly decipher arguments in
socketcall and check what these mean in Linux kernel. Also reading glibc
sources may be helpful.

-- 
Mateusz Guzik <mjguzik gmail.com>


More information about the freebsd-emulation mailing list