open jdk debug options
jameswang99 at yahoo.com
Tue Oct 7 21:15:40 PDT 2008
I went into the ALT_OUTPUTDIR/bin
start dbx with :
For information about new features see `help changes'
To remove this message, put `dbxenv suppress_startup_message 7.6' in your .dbxrc
then I map the src file foler into the current folder, using pathmap
after the pathmap, I try to find the function using
there is no output.
But I know that function is in
I use the following to load the shared library:
loadobject -load /scratch/wang/java_tm_7/lib/sparc/server/libjvm.so
Loaded loadobject: /scratch/wang/java_tm_7/lib/sparc/server/libjvm.so
now, when I use whereis to find compiler_lock_object, I got:
[non -g, demangles to:
Then, I set a break point using:
stop in compiler_lock_object
dbx: warning: 'compiler_lock_object' has no debugger info -- will
trigger on first instruction
(2) stop in MacroAssembler::compiler_lock_object(RegisterImpl*,RegisterImpl*,RegisterImpl*,RegisterImpl*,BiasedLockingCounters*)
So, I run my application in the debugger
run -server -Xcomp -Xbatch -Xss128k -XX:NewSize=256m -Xnoclassgc
-verbose:gc -classpath /scratch/wang/java_tm_7/bin/
(process id 25142)
dbx: process 25142 about to exec("/scratch/wang/java_tm_7/bin/java")
dbx: program "/scratch/wang/java_tm_7/bin/java" just exec'ed
dbx: to go back to the original program use "debug $oprog"
t at 1 (l at 1) stopped in main at 0x00010d30
0x00010d30: main : save %sp, -128, %sp
t at 2 (l at 2) signal SEGV (no mapping at the fault address) in (unknown)
0xfc063710: ld [%o0 + 4], %l0
Current function is jni_invoke_nonstatic (optimized)
1084 JavaCalls::call(result, method, &java_args, CHECK);
I will never get to my break point. But if I run this outside dbx,
everything works fine.
SynchronizedCounter is a small multi-threaed java program I wrote to
test the jvm. It has two threads try to grab a lock and increment a
It works fine but I want to change how the jvm manages the lock, so I
want to stop the program when jvm creates a lock and acquires it.
Thanks for any comment you may have in advance.
On Tue, Oct 7, 2008 at 10:03 PM, Jon Masamitsu <Jon.Masamitsu at sun.com> wrote:
> How do you start dbx on java? And what is dbx saying
> Cong Wang wrote:
>> Hi all:
>> I am trying to modify some part of the hotspot runtime interpreter
>> and I would like to debug that using either dbx or gdb. I have compile
>> the file using the following options:
>> I am not able to use dbx to debug java in the ALT_OUTPUTDIR/bin
>> directory. I would like to set a break point at
>> MacroAssembler::compiler_lock_object function. I have tried to use the
>> dbx pathmap command but it doesn't seem to help dbx to locate the
>> source file or the function definition.
>> Any suggestions? Thanks in advance for any comment.
More information about the hotspot-dev