mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
7051798: SA-JDI: NPE in Frame.addressOfStackSlot(Frame.java:244)
Reviewed-by: kvn
This commit is contained in:
parent
dece7fbfec
commit
edb7b9514a
36 changed files with 678 additions and 729 deletions
|
@ -2859,6 +2859,44 @@ void JavaThread::trace_frames() {
|
|||
}
|
||||
}
|
||||
|
||||
class PrintAndVerifyOopClosure: public OopClosure {
|
||||
protected:
|
||||
template <class T> inline void do_oop_work(T* p) {
|
||||
oop obj = oopDesc::load_decode_heap_oop(p);
|
||||
if (obj == NULL) return;
|
||||
tty->print(INTPTR_FORMAT ": ", p);
|
||||
if (obj->is_oop_or_null()) {
|
||||
if (obj->is_objArray()) {
|
||||
tty->print_cr("valid objArray: " INTPTR_FORMAT, (oopDesc*) obj);
|
||||
} else {
|
||||
obj->print();
|
||||
}
|
||||
} else {
|
||||
tty->print_cr("invalid oop: " INTPTR_FORMAT, (oopDesc*) obj);
|
||||
}
|
||||
tty->cr();
|
||||
}
|
||||
public:
|
||||
virtual void do_oop(oop* p) { do_oop_work(p); }
|
||||
virtual void do_oop(narrowOop* p) { do_oop_work(p); }
|
||||
};
|
||||
|
||||
|
||||
static void oops_print(frame* f, const RegisterMap *map) {
|
||||
PrintAndVerifyOopClosure print;
|
||||
f->print_value();
|
||||
f->oops_do(&print, NULL, (RegisterMap*)map);
|
||||
}
|
||||
|
||||
// Print our all the locations that contain oops and whether they are
|
||||
// valid or not. This useful when trying to find the oldest frame
|
||||
// where an oop has gone bad since the frame walk is from youngest to
|
||||
// oldest.
|
||||
void JavaThread::trace_oops() {
|
||||
tty->print_cr("[Trace oops]");
|
||||
frames_do(oops_print);
|
||||
}
|
||||
|
||||
|
||||
#ifdef ASSERT
|
||||
// Print or validate the layout of stack frames
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue