summaryrefslogtreecommitdiff
path: root/libjava/gnu
diff options
context:
space:
mode:
authoraph <aph@138bc75d-0d04-0410-961f-82ee72b054a4>2002-12-05 11:35:11 +0000
committeraph <aph@138bc75d-0d04-0410-961f-82ee72b054a4>2002-12-05 11:35:11 +0000
commit023970d589380e7cd68aae47ac652c3a0b135497 (patch)
treebeb9a681e04eb34ae7465e8012c20e90dbe09129 /libjava/gnu
parent309fccaf04fc6363cd7f7017e7347a8a065b5c79 (diff)
downloadgcc-023970d589380e7cd68aae47ac652c3a0b135497.tar.gz
2002-12-05 Andrew Haley <aph@redhat.com>
* gnu/gcj/runtime/natStackTrace.cc (fillInStackTrace): Throw #ifdef (HAVE_BACKTRACE) around the whole function body. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@59855 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/gnu')
-rw-r--r--libjava/gnu/gcj/runtime/natStackTrace.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/libjava/gnu/gcj/runtime/natStackTrace.cc b/libjava/gnu/gcj/runtime/natStackTrace.cc
index 5cd89e31a6f..e977f356638 100644
--- a/libjava/gnu/gcj/runtime/natStackTrace.cc
+++ b/libjava/gnu/gcj/runtime/natStackTrace.cc
@@ -44,16 +44,15 @@ details. */
#include <unwind.h>
-// Fill in this stack trace with N elements starting at offset.
+// Fill in this stack trace with MAXLEN elements starting at offset.
void
gnu::gcj::runtime::StackTrace::fillInStackTrace (jint maxlen, jint offset)
{
-#if defined (HAVE_BACKTRACE)
+#ifdef HAVE_BACKTRACE
offset += 1;
void *_p[maxlen + offset];
len = backtrace (_p, maxlen + offset) - offset;
void **p = _p + offset;
-#endif
_Jv_frame_info *frame;
if (len > 0)
{
@@ -86,6 +85,10 @@ gnu::gcj::runtime::StackTrace::fillInStackTrace (jint maxlen, jint offset)
frame = NULL;
addrs = reinterpret_cast<gnu::gcj::RawData *> (frame);
+#else // HAVE_BACKTRACE
+ (void)maxlen;
+ (void)offset;
+#endif // HAVE_BACKTRACE
}
/* Obtain the next power-of-2 of some integer. */