[kaffe] Re: MIPS remote debugging support

Atsushi Nemoto anemo at mba.ocn.ne.jp
Wed Dec 10 08:59:02 PST 2003


>>>>> On Wed, 10 Dec 2003 14:08:47 +0100, Dalibor Topic <robilad at kaffe.org> said:
>> Do you mean track back to kaffe from where the kernel generates the
>> SIGSEGV?
robilad> Yes, but it might be a little complicated. I don't really
robilad> know how convenient it would be. Especially since you're
robilad> trying to debug a stripped kaffe binary in kgdb ... so I
robilad> doubt the stacktrace would be very useful, even if you
robilad> managed to get it to work.

If you can use kgdb and have some kernel knowledge, finding which
instruction causes SIGSEGV is not so difficult.  You will have to set
some breakpoints at lines which calling functions such as
send_siginfo/force_siginfo, etc. with SIGSEGV.  If gdb stopped, you
can inspect siginfo structure to find out an address of the
instruction.  Of course you must have disassemble list of kaffe-bin to
find corresponding source codes.

It is easier to modify your kernel to print this information (just
enabling '#if 0' block in arch/mips/mm/fault.c:do_page_fault()).

You can even create stacktrace from stack-dump from kernel and the
disassemble list, but it will be hard work.

>> b) Adding support for gdb stubs for mips to kaffe. There is a 
>> mips-stub.c in the linux kernel sources [1] and there is some 
>> documentation on using remote stubs [2].

I do not think it is easy.  For example, how to implement breakpoint,
single-step, etc?  The ptrace system call can not be used to debug
itself.

I think the gdbserver is the best way.  The gdbserver will be not so
large (comparing with rt.jar).

robilad> Kevin Kissel would be the one to ask. I've CC:ed him as
robilad> well. Atsushi Nemoto contributed some fixes for mipsel as
robilad> well recently (that I still have to check in, I believe), so
robilad> I've CC:ed him, too.

Yes, I'm running kaffe on mipsel (Debian).  I'm using NFS root and
build kaffe natively (not cross-compile).  I believe native compiling
and debugging is the best way (if possible :-)) I want to make JIT
work, but currently no time ...

---
Atsushi Nemoto




More information about the kaffe mailing list