mirror of
https://github.com/openjdk/jdk.git
synced 2026-05-21 19:08:31 +00:00
8201242: Include source file/line number when reporting native call stack on supported platforms
Added source file/line number to native call stack reporting on supported platforms Reviewed-by: adinn, stuefe, dcubed
This commit is contained in:
parent
d124c7d779
commit
a47dc291ae
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -24,6 +24,7 @@
|
||||
|
||||
#include "precompiled.hpp"
|
||||
#include "runtime/os.hpp"
|
||||
#include "utilities/decoder.hpp"
|
||||
#include "utilities/globalDefinitions.hpp"
|
||||
#include "utilities/nativeCallStack.hpp"
|
||||
|
||||
@ -102,6 +103,7 @@ void NativeCallStack::print_on(outputStream* out, int indent) const {
|
||||
address pc;
|
||||
char buf[1024];
|
||||
int offset;
|
||||
int line_no;
|
||||
if (is_empty()) {
|
||||
for (int index = 0; index < indent; index ++) out->print(" ");
|
||||
out->print("[BOOTSTRAP]");
|
||||
@ -112,10 +114,15 @@ void NativeCallStack::print_on(outputStream* out, int indent) const {
|
||||
// Print indent
|
||||
for (int index = 0; index < indent; index ++) out->print(" ");
|
||||
if (os::dll_address_to_function_name(pc, buf, sizeof(buf), &offset)) {
|
||||
out->print_cr("[" PTR_FORMAT "] %s+0x%x", p2i(pc), buf, offset);
|
||||
out->print("[" PTR_FORMAT "] %s+0x%x", p2i(pc), buf, offset);
|
||||
} else {
|
||||
out->print_cr("[" PTR_FORMAT "]", p2i(pc));
|
||||
out->print("[" PTR_FORMAT "]", p2i(pc));
|
||||
}
|
||||
|
||||
if (Decoder::get_source_info(pc, buf, sizeof(buf), &line_no)) {
|
||||
out->print(" (%s:%d)", buf, line_no);
|
||||
}
|
||||
out->cr();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user