gdb macro to ease debugging JIT

Alexandre Oliva oliva at
Wed Aug 5 21:32:12 PDT 1998


Some time ago, Patrick Tullmann posted a macro that would find a
method given a $pc.  Unfortunately, that macro was very slow because
it would loop on the classEntryPool looking for a method whose native
code interval contained the given address; furthermore, it wouldn't
always find the searched method, for some reason I don't completely

So I figured out it could be made much faster by using the function
findMethodFromPC provided by the Kaffe runtime.  Here's the macro,
(ab)use it as it pleases you.

define whereJIT
  set $meth = findMethodFromPC($pc)
  printf "%s.%s%s: %p %p\n", $meth.class->,$meth->, $meth->, $meth->c.ncode.ncode_start, $meth->c.ncode.ncode_end
document whereJIT
  Find information about the native method of the current PC
  By Alexandre Oliva <oliva at>
  Formatting stolen from macro by Patrick A Tullmann <tullmann at>

Alexandre Oliva
mailto:oliva at mailto:aoliva at
Universidade Estadual de Campinas, SP, Brasil

More information about the kaffe mailing list