aboutsummaryrefslogtreecommitdiff
path: root/src/share/vm/utilities/vmError.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/share/vm/utilities/vmError.cpp')
-rw-r--r--src/share/vm/utilities/vmError.cpp23
1 files changed, 17 insertions, 6 deletions
diff --git a/src/share/vm/utilities/vmError.cpp b/src/share/vm/utilities/vmError.cpp
index 4b0953ae4..e950d3386 100644
--- a/src/share/vm/utilities/vmError.cpp
+++ b/src/share/vm/utilities/vmError.cpp
@@ -592,13 +592,24 @@ void VMError::report(outputStream* st) {
st->cr();
// Compiled code may use EBP register on x86 so it looks like
// non-walkable C frame. Use frame.sender() for java frames.
- if (_thread && _thread->is_Java_thread() && fr.is_java_frame()) {
- RegisterMap map((JavaThread*)_thread, false); // No update
- fr = fr.sender(&map);
- continue;
+ if (_thread && _thread->is_Java_thread()) {
+ // Catch very first native frame by using stack address.
+ // For JavaThread stack_base and stack_size should be set.
+ if (!_thread->on_local_stack((address)(fr.sender_sp() + 1))) {
+ break;
+ }
+ if (fr.is_java_frame()) {
+ RegisterMap map((JavaThread*)_thread, false); // No update
+ fr = fr.sender(&map);
+ } else {
+ fr = os::get_sender_for_C_frame(&fr);
+ }
+ } else {
+ // is_first_C_frame() does only simple checks for frame pointer,
+ // it will pass if java compiled code has a pointer in EBP.
+ if (os::is_first_C_frame(&fr)) break;
+ fr = os::get_sender_for_C_frame(&fr);
}
- if (os::is_first_C_frame(&fr)) break;
- fr = os::get_sender_for_C_frame(&fr);
}
if (count > StackPrintLimit) {