On the 0x208 day of Apache Harmony Geir Magnusson, Jr. wrote: > Egor Pasko wrote: > > 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? :) > > How about a patch, Egor? :)
The best patch is HARMONY-803 from Ivan. AFAIR, the only reason it is not committed is the lack on windows support (doors are ok). If nobody volunteers to make the windows, I am afraid, I will have to. We need to have full debug build everywhere. Being not the greatest expert in windows, I am warning you :) There is one more limitation to overcome here. We need to fix a number of Jitrino bugs that are reproducible on classlib tests with Jitrino in debug mode (thanks to Alexey Varlamov for reporting them). That's what I am doing now. > BTW, this is a good faq entry... I hope to have a better FAQ entry -- "options" instead of the "patch". Now it's the best place in .. ehm, "build troubleshooting" > > 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! ;) > > > > --------------------------------------------------------------------- > Terms of use : http://incubator.apache.org/harmony/mailing.html > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- Egor Pasko, Intel Managed Runtime Division