This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: How to handle a NullPointerException
- From: Dimiter Stamenov <pamir at abv dot bg>
- To: java at gcc dot gnu dot org
- Date: Thu, 21 Feb 2008 16:07:39 +0200 (EET)
- Subject: Re: How to handle a NullPointerException
>__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);
>}
OK I have compiled successfully with -finstrument-functions and a new exception is thrown (not thrown when compiled without it)... I am wondering why everything is OK when running with JVM - if there is not an exception with it, then may be the problem is not in the java code?
The result from gdb is:
(gdb) run
Starting program: universal.exe
Loaded symbols for D:\WINDOWS\system32\ntdll.dll
Loaded symbols for D:\WINDOWS\system32\kernel32.dll
Loaded symbols for D:\WINDOWS\system32\advapi32.dll
Loaded symbols for D:\WINDOWS\system32\rpcrt4.dll
Loaded symbols for D:\WINDOWS\system32\msvcrt.dll
Loaded symbols for D:\WINDOWS\system32\user32.dll
Loaded symbols for D:\WINDOWS\system32\gdi32.dll
Loaded symbols for D:\WINDOWS\system32\ws2_32.dll
Loaded symbols for D:\WINDOWS\system32\ws2help.dll
java.io.IOException: Unable to read entire header; 1 byte read; expected 512 bytes
at org.apache.poi.poifs.storage.HeaderBlockReader.<init>(universal.exe)
at org.apache.poi.poifs.filesystem.POIFSFileSystem.<init>(universal.exe)
at org.apache.poi.hwpf.HWPFDocument.verifyAndBuildPOIFS(universal.exe)
at org.apache.poi.hwpf.extractor.WordExtractor.<init>(universal.exe)
at org.apache.poi.Universal.getWordFileText(universal.exe)
at org.apache.poi.Universal.main(universal.exe)
Dimiter