This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Threads and co


Andreas Tobler wrote:

> What I do not understand is this code from 
> libjava/gnu/gcj/runtime/natFirstThread.cc:46
>
>   main_func *real_main = (main_func *) meth->ncode;
>   (*real_main) (args);
>
> The meth->ncode contains a reasonable value (see below), but the 
> real_main contains rubbish.
>
> (gdb) p args
> $5 = 0x7 <Address 0x7 out of bounds>
> (gdb) p *args
> Cannot access memory at address 0x7
> (gdb)
> (gdb) p *meth
> $6 = {
>   name = 0x7c0802a6,
>   signature = 0x7d800026,
>   accflags = 55745,
>   index = 65392,
>   ncode = 0xd9e1ff78,
>   throws = 0xda01ff80
> }
> (gdb)



Did you build libgcj without optimization? You can expect degbugging to 
give confusing results if its an optimized build. It should be 
sufficient here to just touch natFirstThread.cc and "make CXXFLAGS=-g" 
or something like that.

regards

Bryce.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]