Re: [rvm-research] Debugging with gdb
Dmitri Makarov <[email protected]>
| Newsgroups | gmane.comp.java.jikes.rvm.devel |
|---|---|
| Message-ID | <[email protected]> |
Actually if you run rvm -gdb it sets the initial breakpoint in sysCreateThreadSpecificDataKeys, and when the control enters the function, the boot image is already loaded. I usually set a breakpoint on the address of lazyMethodInvoker (found in RVM.map). The problem is that you can't set a software breakpoint on a method before it was compiled by JIT compiler, even if you know the address where the method's code will be placed in memory. You can, but when the method is actually compiled, the breakpoint will be overwritten with the code of the method. It may work to set a hardware breakpoint, but hardware breakpoints are not supported by gdb on some platforms, in particular on Mac OS X. So the algorithm is like that: 1. run rvm -gdb 2. start rvm from within gdb using 'run' command 3. wait until it stops in sysCreateThreadSpecificDataKeys 4. set a breakpoint on the address of lazyMethodInvoker 5. continue Admittedly, it's tedious to use GDB to debug Jikes RVM, and so we've been developing a debugger similar to Maxine Inspector, but for Jikes RVM. We plan to release the tool soon. If accepted there will be a tutorial on how to debug Jikes RVM in OOPSLA 2013. Regards, Dmitri On Apr 29, 2013, at 11:06 PM, Eliot Moss <[email protected]> wrote: > On 4/29/2013 5:00 PM, Chapple, Julia D wrote: >> Hello, >> >> I’m trying understand Jikes by tracing execution with gdb. However, I haven’t been able to set any >> breakpoints that would enable me to observe the functions I’m interested in. When I run it initially >> I hit a breakpoint in sys.C. I can then set breakpoints in sys.C and in files in the same folder but >> I can’t set breakpoints in other files. gdb always says there is no source file with that name and >> the break point is set to pending. The pending break points are never hit, even though the code is >> being executed. I’ve tried specifying the files in different ways (including the absolute file path) >> but none of them work. >> >> I’ve also tried using the memory address found in RVM.map. When I do this gdb states: “Error >> accessing memory address 0x5805b7bc: Input/output error.” > > You may need to wait on setting breakpoints until the > bootImageReader has read the image in. I find it convenient > to set a breakpoint where that happens, run to the breakpoint, > and then set additional breakpoints. > > People have developed (slightly) more sophisticated methods, > and gdb macros, that help. Maybe someone else can respond > about that. > > Eliot Moss > > ------------------------------------------------------------------------------ > Try New Relic Now & We'll Send You this Cool Shirt > New Relic is the only SaaS-based application performance monitoring service > that delivers powerful full stack analytics. Optimize and monitor your > browser, app, & servers with just a few lines of code. Try New Relic > and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr > _______________________________________________ > Jikesrvm-researchers mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/jikesrvm-researchers ------------------------------------------------------------------------------ Introducing AppDynamics Lite, a free troubleshooting tool for Java/.NET Get 100% visibility into your production application - at no cost. Code-level diagnostics for performance bottlenecks with <2% overhead Download for free and get started troubleshooting in minutes. http://p.sf.net/sfu/appdyn_d2d_ap1