Skip to content

Commit 1b8df0e

Browse files
committed
Support PyThreadState.use_tracing
1 parent 82f4b02 commit 1b8df0e

File tree

1 file changed

+10
-1
lines changed
  • graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/cext/capi

1 file changed

+10
-1
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/cext/capi/PThreadState.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ public class PThreadState extends PythonNativeWrapper {
100100
public static final String RECURSION_DEPTH = "recursion_depth";
101101
public static final String OVERFLOWED = "overflowed";
102102
public static final String INTERP = "interp";
103+
public static final String USE_TRACING = "use_tracing";
103104

104105
private final PythonThreadState threadState;
105106

@@ -139,6 +140,7 @@ protected boolean isMemberReadable(String member) {
139140
case RECURSION_DEPTH:
140141
case OVERFLOWED:
141142
case INTERP:
143+
case USE_TRACING:
142144
return true;
143145
default:
144146
return false;
@@ -147,7 +149,8 @@ protected boolean isMemberReadable(String member) {
147149

148150
@ExportMessage
149151
protected Object getMembers(@SuppressWarnings("unused") boolean includeInternal) {
150-
return new PythonAbstractObject.Keys(new Object[]{CUR_EXC_TYPE, CUR_EXC_VALUE, CUR_EXC_TRACEBACK, EXC_TYPE, EXC_VALUE, EXC_TRACEBACK, DICT, PREV, RECURSION_DEPTH, OVERFLOWED, INTERP});
152+
return new PythonAbstractObject.Keys(
153+
new Object[]{CUR_EXC_TYPE, CUR_EXC_VALUE, CUR_EXC_TRACEBACK, EXC_TYPE, EXC_VALUE, EXC_TRACEBACK, DICT, PREV, RECURSION_DEPTH, OVERFLOWED, INTERP, USE_TRACING});
151154
}
152155

153156
@ImportStatic(PThreadState.class)
@@ -289,6 +292,12 @@ static Object doInterpreterState(PThreadState receiver, String key) {
289292
return 0xDEADBEEF;
290293
}
291294

295+
@Specialization(guards = "eq(key, USE_TRACING)")
296+
@SuppressWarnings("unused")
297+
static long doUseTracing(PThreadState receiver, String key) {
298+
return 0;
299+
}
300+
292301
protected static boolean eq(String key, String expected) {
293302
return expected.equals(key);
294303
}

0 commit comments

Comments
 (0)