harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Egor Pasko <egor.pa...@gmail.com>
Subject Re: [drlvm] How to debug the drlvm with gdb?
Date Fri, 20 Oct 2006 12:15:46 GMT
On the 0x208 day of Apache Harmony Nadezhda Morozova wrote:
> Egor, 
> You're a treasure keeper, so many useful tips :) 

Actually, I am not any more :)

> As you mentioned yourself, this info should be on the website, and I
> side with you on this.

thank you for helping!

> We actually have some debugging tips already:
> http://incubator.apache.org/harmony/subcomponents/drlvm/debugging_VM_and
> _JIT.html 
> However, they don't mention the launcher and all those tiny little
> things you mentioned, like the format of paths, etc. the doc is also
> partially outdated (mentions ij). 

To sum up my thoughts:

* debugging_VM_and_JIT 
  + is outdated
  + covers both linux and windows debugging tips intermixed
  + has instructions for JET tracing (quite valid)

* Let's make make it 2 separate docs: "Linux debugging" and "Windows
  debugging". A new guy reading one of these two docs will most likely
  not want to read another. The interection between the two would be
  rather small (promise)

* I listed a number of linux quickstart HOWTOs which, I think, is a
  good base for the "Linux debugging" part.

* Mikhail supports the MSVC project file(s) and can add something to
  "Windows debugging" doc (Mikhail, do you love technical writing?:)

* Let's make the 3rd doc "DRLVM Advanced Debugging and Bug Isolation"
  (Some people around are having good ideas on it). JET traceing would
  move here.

* there are some shortcomings (in both classlib and DRLVM) that do not
  allow us to enable a usable debug build quickly. And description
  falls into a category like "hack here and there if you like". That's
  not what the ideal instructions should be. Maybe, it makes sense to
  postpone the task until we enable default debug builds everywhere.

* Thaking the one above into account, I would suggest to start "Linux
  debugging" on Wiki. Does it make sense to put it in the FAQ? How do
  you like the idea of Harmony_Debug_Troubleshooting on Wiki?

did I forget something?

> Do you think we can use this doc as the basis for storing more content?

yes, as the basis to "Linux debugging" or for something that we find better.

> Thank you, 
> Nadya Morozova
>  
> -----Original Message-----
> From: news [mailto:news@sea.gmane.org] On Behalf Of Egor Pasko
> Sent: Friday, October 20, 2006 1:34 PM
> To: harmony-dev@incubator.apache.org
> Subject: Re: [drlvm] How to debug the drlvm with gdb?
> 
> 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/ja
> va"
> > 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: harmony-dev-unsubscribe@incubator.apache.org
> For additional commands, e-mail: harmony-dev-help@incubator.apache.org
> 
> ---------------------------------------------------------------------
> Terms of use : http://incubator.apache.org/harmony/mailing.html
> To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
> For additional commands, e-mail: harmony-dev-help@incubator.apache.org
> 
> 

-- 
Egor Pasko, Intel Managed Runtime Division


---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Mime
View raw message