Skip to content

Add variable names and values to stacktrace#2

Open
xardazz wants to merge 14 commits into
apangin:masterfrom
xardazz:master
Open

Add variable names and values to stacktrace#2
xardazz wants to merge 14 commits into
apangin:masterfrom
xardazz:master

Conversation

@xardazz

@xardazz xardazz commented Apr 21, 2018

Copy link
Copy Markdown

No description provided.

Comment thread src/one/helfy/VMThreadCache.java Outdated
public static Frame currentFrame() {
return JavaThread.topFrame(current());
}
}

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this class for?
VMThread::of is a rather light operation - probably even simpler than computeIfAbsent.

Comment thread src/one/helfy/vmstruct/Frame.java Outdated
private static final int slot_interp_sender_sp = -1;
private static final int slot_link = 0;
private static final int slot_return_addr = 1;
private static final int slot_sender_sp = 2;

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These constants are platform-dependent.
It's OK to have them in a sample that works only on a particular platform, but if you are implementing a general-purpose struct, this would require pd subclasses, e.g. FrameX64 extends Frame etc.

boolean isArray = vmType.startsWith("[");
if (isArray) {
vmType = vmType.substring(1);
}

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about multidimensional arrays?

Comment thread src/one/helfy/vmstruct/Frame.java Outdated
ObjRef strRef = new ObjRef();
// if we have -XX:-UseCompressedOops specified base and offset will be 0
strRef.ptr = (int) ((localVarVal - _narrow_oop_base) >> _narrow_oop_shift);
Object val = jvm.getObject(strRef, jvm.fieldOffset(ObjRef.ptrField));

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This operation is inherently unsafe, since GC may happen between strRef.ptr and jvm.getObject.

@serkan-ozal

Copy link
Copy Markdown

Is there any progress on this pull request?

@ghost

ghost commented Jul 11, 2022

Copy link
Copy Markdown

i think no

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants