On the 0x208 day of Apache Harmony Tonny Lau wrote:
> Hi,
> 
> I checked out the latest drlvm, and failed to set breakpoint when I used
> gdb. It seems the
> "harmony/enhanced/drlvm/trunk/build/lnx_ia32_gcc_debug/deploy/jre/bin/java"
> is copied from "harmony/enhanced/classlib/trunk/deploy/jdk/jre/bin/java",
> i.e., it is not a debug version. Does anyone know how to debug it? Thanks!

Oh! should be on the site!! some day .. some day ..

Yes, it's the launcher. It is taken from classlib (which is not built
in debug mode even if DRLVM is built in debug (=default)). If you want
to build the launcher in debug mode, change:
working_classlib/depends/build/makefile.include
(put -O0 -g instead of -O1)

pretty, huh? :)

to debug on linux you should export LD_LIBRARY_PATH for GDB:

export LD_LIBRARY_PATH=$jre/bin:$jre/bin/default
(you know what $jre is:)
(news is that tere should be no slashess at the end of each path, and no
soft links inside, surprize, surprize:)

then you can run GDB and, at least, see threads created, etc..

DRLVM is quite distributed between shared libraries, so it is not easy
to set breakpoints somewhere in libraries' code. There are 2
approaches: 
1. drop asm("int3") in your code, rebuild and catch it via an
   ordinary run from within GDB
2. stop at position when nothing interesting happend, but all
   libraries are loaded (my favourite)

for (2) I use 2 custom GDB scripts "hstart" and "hrun". "hstart" makes
the first stop on my favourite start point. "hrun" uses those
breakpoints to stop on the point with further runs in the GDB session.

To get these two, drop these lines into your ~/.gdbinit:
---------------------------------------
define hstart
break main
run
break hysl_open_shared_library
continue
finish
disable
break compile_jit_a_method
continue
disable
end

define hrun
en 1
run
en 2
continue
finish
disable
en 3
continue
disable
end
---------------------------------------

good luck! ;)

-- 
Egor Pasko, Intel Managed Runtime Division


---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to