forked from bloomberg/pystack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathframe.h
More file actions
129 lines (113 loc) Β· 2.69 KB
/
frame.h
File metadata and controls
129 lines (113 loc) Β· 2.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
#pragma once
#include "code.h"
#include "object.h"
namespace pystack {
constexpr int MAXBLOCKS = 20;
typedef struct
{
int b_type;
int b_handler;
int b_level;
} PyTryBlock;
namespace Python2 {
typedef struct _pyframeobject
{
PyObject_VAR_HEAD struct _pyframeobject* f_back;
PyCodeObject* f_code;
PyObject* f_builtins;
PyObject* f_globals;
PyObject* f_locals;
PyObject** f_valuestack;
PyObject** f_stacktop;
PyObject* f_trace;
PyObject *f_exc_type, *f_exc_value, *f_exc_traceback;
void* f_tstate;
int f_lasti;
int f_lineno;
int f_iblock;
PyTryBlock f_blockstack[MAXBLOCKS];
PyObject* f_localsplus[1];
} PyFrameObject;
} // namespace Python2
namespace Python3_7 {
typedef struct _pyframeobject
{
PyObject_VAR_HEAD struct _pyframeobject* f_back;
PyObject* f_code;
PyObject* f_builtins;
PyObject* f_globals;
PyObject* f_locals;
PyObject** f_valuestack;
PyObject** f_stacktop;
PyObject* f_trace;
char f_trace_lines;
char f_trace_opcodes;
PyObject* f_gen;
int f_lasti;
int f_lineno;
int f_iblock;
char f_executing;
PyTryBlock f_blockstack[MAXBLOCKS];
PyObject* f_localsplus[1];
} PyFrameObject;
} // namespace Python3_7
namespace Python3_10 {
typedef signed char PyFrameState;
typedef struct _pyframeobject
{
PyObject_VAR_HEAD struct _pyframeobject* f_back;
PyObject* f_code;
PyObject* f_builtins;
PyObject* f_globals;
PyObject* f_locals;
PyObject** f_valuestack;
PyObject* f_trace;
int f_stackdepth;
char f_trace_lines;
char f_trace_opcodes;
PyObject* f_gen;
int f_lasti;
int f_lineno;
int f_iblock;
PyFrameState f_state;
PyTryBlock f_blockstack[MAXBLOCKS];
PyObject* f_localsplus[1];
} PyFrameObject;
} // namespace Python3_10
namespace Python3_11 {
typedef signed char PyFrameState;
typedef struct _interpreter_frame
{
PyObject* f_func;
PyObject* f_globals;
PyObject* f_builtins;
PyObject* f_locals;
PyObject* f_code;
PyObject* frame_obj;
struct _PyInterpreterFrame* previous;
_Py_CODEUNIT* prev_instr;
int stacktop;
bool is_entry;
char owner;
PyObject* localsplus[1];
} PyFrameObject;
} // namespace Python3_11
namespace Python3_12 {
typedef signed char PyFrameState;
typedef struct _interpreter_frame
{
PyCodeObject* f_code;
struct _interpreter_frame* previous;
PyObject* f_funcobj;
PyObject* f_globals;
PyObject* f_builtins;
PyObject* f_locals;
PyObject* frame_obj;
_Py_CODEUNIT* prev_instr;
int stacktop;
uint16_t return_offset;
char owner;
PyObject* localsplus[1];
} PyFrameObject;
} // namespace Python3_12
} // namespace pystack