Commit 696dad4b by David Daney Committed by David Daney

gcj.texi (libgcj Runtime Properties): Document gnu.gcj.runtime.NameFinder.show_raw and...

2006-06-05  David Daney  <ddaney@avtrex.com>

	* gcj.texi (libgcj Runtime Properties): Document
	gnu.gcj.runtime.NameFinder.show_raw and
	gnu.gcj.runtime.NameFinder.remove_unknown.

2006-06-05  David Daney  <ddaney@avtrex.com>

	* gnu/gcj/runtime/NameFinder.java (show_raw): New field.
	(showRaw): New method.
	* stacktrace.cc : Include gnu/gcj/runtime/StringBuffer.h.
	(getLineNumberForFrame): Show IP offset in trace if line number
	not available and show_raw true.

From-SVN: r114437
parent c02174ab
2006-06-06 David Daney <ddaney@avtrex.com>
* gcj.texi (libgcj Runtime Properties): Document
gnu.gcj.runtime.NameFinder.show_raw and
gnu.gcj.runtime.NameFinder.remove_unknown.
2006-06-06 Tom Tromey <tromey@redhat.com>
* jcf-dump.c (print_access_flags): Handle varargs, bridge,
......
......@@ -2793,6 +2793,21 @@ the java.util.logging infrastructure. However, performance may improve
significantly for applications that print stack traces or make logging calls
frequently.
@item gnu.gcj.runtime.NameFinder.show_raw
Whether the address of a stack frame should be printed when the line
number is unavailable. Setting this to @code{true} will cause the name
of the object and the offset within that object to be printed when no
line number is available. This allows for off-line decoding of
stack traces if necessary debug information is available. The default
is @code{false}, no raw addresses are printed.
@item gnu.gcj.runtime.NameFinder.remove_unknown
Whether stack frames for non-java code should be included in a stack
trace. The default value is @code{true}, stack frames for non-java
code are suppressed. Setting this to @code{false} will cause any
non-java stack frames to be printed in addition to frames for the java
code.
@item gnu.gcj.runtime.VMClassLoader.library_control
This controls how shared libraries are automatically loaded by the
built-in class loader. If this property is set to @samp{full}, a full
......
2006-06-06 David Daney <ddaney@avtrex.com>
* gnu/gcj/runtime/NameFinder.java (show_raw): New field.
(showRaw): New method.
* stacktrace.cc : Include gnu/gcj/runtime/StringBuffer.h.
(getLineNumberForFrame): Show IP offset in trace if line number
not available and show_raw true.
2006-06-06 Gary Benson <gbenson@redhat.com>
* java/io/natFilePosix.cc (getCanonicalPath): Rewritten.
......
......@@ -67,13 +67,29 @@ public class NameFinder
("gnu.gcj.runtime.NameFinder.use_addr2line", "true")
).booleanValue();
private static boolean show_raw
= Boolean.valueOf(System.getProperty
("gnu.gcj.runtime.NameFinder.show_raw", "false")
).booleanValue();
/**
* Return true if raw addresses should be printed in stacktraces
* when no line number information is available.
*/
static final boolean showRaw()
{
return show_raw;
}
private static final boolean remove_unknown
= Boolean.valueOf(System.getProperty
("gnu.gcj.runtime.NameFinder.remove_unknown", "true")
).booleanValue();
// Return true if non-Java frames should be removed from stack
// traces.
/**
* Return true if non-Java frames should be removed from stack
* traces.
*/
static final boolean removeUnknown()
{
return remove_unknown;
......
......@@ -27,6 +27,7 @@ details. */
#include <java/util/IdentityHashMap.h>
#include <gnu/java/lang/MainThread.h>
#include <gnu/gcj/runtime/NameFinder.h>
#include <gnu/gcj/runtime/StringBuffer.h>
#include <sysdep/backtrace.h>
#include <sysdep/descriptor.h>
......@@ -221,6 +222,17 @@ _Jv_StackTrace::getLineNumberForFrame(_Jv_StackFrame *frame, NameFinder *finder,
finder->lookup (binaryName, (jlong) offset);
*sourceFileName = finder->getSourceFile();
*lineNum = finder->getLineNum();
if (*lineNum == -1 && NameFinder::showRaw())
{
gnu::gcj::runtime::StringBuffer *t =
new gnu::gcj::runtime::StringBuffer(binaryName);
t->append ((jchar)' ');
t->append ((jchar)'[');
// + 1 to compensate for the - 1 adjustment above;
t->append (Long::toHexString (offset + 1));
t->append ((jchar)']');
*sourceFileName = t->toString();
}
}
#endif
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment