This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: How to handle a NullPointerException
Dimiter Stamenov wrote:
>Dimiter Stamenov wrote:
>> >Do simple programs work?
>>
>> Hi Andrew, yes, all other programs I have compiled work fine, except this.
>> It is supposed just to take the text from a MS Word file, but until that
>> moment I have not succeed to do that with gcj compiled version...
>
>We'll have to take this in stages. Can you usually get a backtrace out of gdb?
>
>If not, we might have to try `-finstrument-functions'. You'll find
Thanks, `-finstrument-functions' seems very useful option. I have read the documentation but could not realize how to define __cyg_profile_func_enter and __cyg_profile_func_exit?
__cyg_profile_func_enter() is just a C function that takes two void* args
void __cyg_profile_func_enter( void *this, void *callsite )
Define it and link with your program.
Do *not* compile this C code with `-finstrument-functions'.
Andrew.
void __cyg_profile_func_enter( void *this, void *callsite )
{
/* Function Entry Address */
fprintf(fp, "E%p\n", (int *)this);
}
void __cyg_profile_func_exit( void *this, void *callsite )
{
/* Function Exit Address */
fprintf(fp, "X%p\n", (int *)this);
}