|
JavaFAQ Home » General Java

Question: How can I use the new error-reporting mechanism in JVM?
Answer: When the Java Virtual Machine (JVM) detects a crash in native
code such as JNI code written by the developer or when the JVM itself crashes,
it will print debug information about the crash. This error message normally
will include information such as the function name, library name, source-file
name and line number at which the error occurred. (Currently, information about
file name and line number are available only available on Microsoft Windows
platforms.) For an example of a message emitted by the error handler, see JNI
Error example.
The information provided
by the new error-reporting mechanism will allow developers to more easily and
efficiently debug their applications. If an error message indicates a problem in
the JVM code itself, it will allow a developer to submit a more accurate and
helpful bug report.
Sometimes the
error-reporting mechanism won't be able to determine the information that might
be helpful in locating the source of a crash. To get the most out of the error
handler, developers should be aware of the following guidelines and limitations.
Compile in debug mode
In some circumstances,
the error-reporting mechanism won't be able to determine symbol names. The most
common reason for this is that the binary code that crashed was not compiled in
debug mode and therefore doesn't have symbol tables. Developers should compile
their code in debug mode to ensure that it contains the necessary debug
information. In Visual Studio, for example, this means choosing "Debug" rather
than "Release" as the project's build mode. When using gcc or cc on Linux or on
the SolarisTM operating environment, compile using the -g command-line option.
More limitations are
described
in the article here
*******************************************
Our older tips: March 22, 2001 - October 21, 2002
READ
HERE
All published and not published on the site tips read
HERE
Printer Friendly Page
Send to a Friend
..
Search here again if you need more info!
|