Skip to content

Commit 5e5b604

Browse files
committed
Expose internal python frames outside tracebacks
1 parent ac932be commit 5e5b604

File tree

4 files changed

+5
-6
lines changed

4 files changed

+5
-6
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules/SysModuleBuiltins.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -864,7 +864,7 @@ static PFrame counted(VirtualFrame frame, int depth,
864864
@Bind Node inliningTarget,
865865
@Cached ReadFrameNode readFrameNode,
866866
@Cached PRaiseNode raiseNode) {
867-
PFrame requested = readFrameNode.getFrameForReference(frame, PArguments.getCurrentFrameInfo(frame), ReadFrameNode.VisiblePythonFramesSelector.INSTANCE, depth, false);
867+
PFrame requested = readFrameNode.getFrameForReference(frame, PArguments.getCurrentFrameInfo(frame), ReadFrameNode.AllPythonFramesSelector.INSTANCE, depth, false);
868868
if (requested == null) {
869869
throw raiseNode.raise(inliningTarget, ValueError, ErrorMessages.CALL_STACK_NOT_DEEP_ENOUGH);
870870
}

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/nodes/bytecode/PBytecodeRootNode.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2932,7 +2932,7 @@ private int bytecodePrintExpr(VirtualFrame virtualFrame, boolean useCachedNodes,
29322932

29332933
@BytecodeInterpreterSwitch
29342934
private byte checkTracingAndProfilingEnabled(Assumption noTraceOrProfile, MutableLoopData mutableData) {
2935-
if (!noTraceOrProfile.isValid() && frameIsVisibleToPython()) {
2935+
if (!noTraceOrProfile.isValid()) {
29362936
PythonContext.PythonThreadState ts = mutableData.getThreadState(this);
29372937
Object profileFun = ts.getProfileFun();
29382938
if (ts.getTraceFun() != null) {

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/nodes/bytecode_dsl/PBytecodeDSLRootNode.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -516,8 +516,8 @@ void clearPastLine() {
516516

517517
@NonIdempotent
518518
public final boolean needsTraceAndProfileInstrumentation() {
519-
// We need instrumentation only if the assumption is invalid and the root node is visible.
520-
return !getLanguage().noTracingOrProfilingAssumption.isValid() && !isInternal();
519+
// We need instrumentation only if the assumption is invalid
520+
return !getLanguage().noTracingOrProfilingAssumption.isValid();
521521
}
522522

523523
@NonIdempotent
@@ -529,7 +529,6 @@ public final PythonThreadState getThreadState() {
529529
* Reparses with instrumentations for settrace and setprofile enabled.
530530
*/
531531
public final void ensureTraceAndProfileEnabled() {
532-
assert !isInternal();
533532
getRootNodes().update(TRACE_AND_PROFILE_CONFIG);
534533
}
535534

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/nodes/frame/ReadFrameNode.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ public final PFrame getCurrentPythonFrame(VirtualFrame frame, boolean needsLocal
140140
}
141141

142142
public final PFrame getFrameForReference(Frame frame, PFrame.Reference startFrameInfo, int level, boolean needsLocals) {
143-
return getFrameForReference(frame, startFrameInfo, VisiblePythonFramesSelector.INSTANCE, level, needsLocals);
143+
return getFrameForReference(frame, startFrameInfo, AllPythonFramesSelector.INSTANCE, level, needsLocals);
144144
}
145145

146146
public final PFrame getFrameForReference(Frame frame, PFrame.Reference startFrameInfo, FrameSelector selector, int level, boolean needsLocals) {

0 commit comments

Comments
 (0)