harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Simon Zhou <simon.harm...@gmail.com>
Subject Re: How to use gdb to debug interpreter?
Date Thu, 19 Feb 2009 08:16:33 GMT
Hi YiXun
 I think gdb scripts may help you for this problem
 you can define a macro in .gdbinit file like this:

define hsbreak main
run -Xem:interpreter $arg0
break hysl_open_shared_library
continue
finish
disable
break jni.cpp:CallStaticVoidMethod
continue
break interpreter.cpp:Opcode_NEW  #functions whatever you like
continue
dis
end

then, you can use this macro "hs" in your gdb command to set the breakpoint
and debug.

Thanks
Simon

2009/2/19 YixunZhou <seanny2003@gmail.com>

> Hi all,
>
>   I modified harmony to make it support ClassRedefine, but I got a
> segmentation fault when called new to create an instance of
> the new version class. I changed to interpreter mode, and found the problem
> happened when executing OPCODE_INVOKESPECIAL.
>
> case OPCODE_INVOKESPECIAL:
>                              // Next line marks the
> "P_TLS_vmthread->thread_exception" that an exception happened.
>                               Opcode_INVOKESPECIAL(frame);
>                               // get_current_thread_exception  can not
> handle the exception properly and cause the segment fault.
>                               frame.exc = get_current_thread_exception();
>
> I was using "printf" to locate the bug, but it is too complicated here. But
> when I use gdb to trace the execution, it cannot follow the function
> pointer "(*env)->CallStaticVoidMethod (env, cls, mid, args);" in main.c.
>
> So, how can I use gdb to debug the interpreter? Thanks.
>
>
> --
>
> Best regard,
> Yixun Zhou
> seanny2003@gmail.com
>
>
>


-- 
>From : Simon.Zhou@MRTL China Lab, Intel

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message