FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
daScript/daslib/debugger.das at master · feiyunwill/daScript · GitHub
feiyunwill
/
daScript
Public
forked from
GaijinEntertainment/daScript
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
daScript
/
daslib
/
debugger.das
Copy path
More file actions
More file actions
Latest commit
History
History
History
254 lines (237 loc) · 12.3 KB
Breadcrumbs
daScript
/
daslib
/
debugger.das
Copy path
File metadata and controls
254 lines (237 loc) · 12.3 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
options
gen2
options
indenting
=
4
options
remove_unused_symbols
=
false
options
no_aot
=
true
options
strict_smart_pointers
=
true
module
debugger
shared
public
require
debugapi
public
require
daslib
/
rtti
public
class
DapiDebugAgent
{
def
abstract
onInstall
(
agent
:
DebugAgent
?) :
void
def
abstract
onUninstall
(
agent
:
DebugAgent
?) :
void
def
abstract
onCreateContext
(
var
ctx
:
Context
) :
void
def
abstract
onDestroyContext
(
var
ctx
:
Context
) :
void
def
abstract
onSimulateContext
(
var
ctx
:
Context
) :
void
def
abstract
onSingleStep
(
var
ctx
:
Context
;
at
:
LineInfo
) :
void
def
abstract
onInstrument
(
var
ctx
:
Context
;
at
:
LineInfo
) :
void
def
abstract
onInstrumentFunction
(
var
ctx
:
Context
;
fn
:
SimFunction
?;
entering
:
bool
;
userData
:
uint64
) :
void
def
abstract
onBreakpoint
(
var
ctx
:
Context
;
at
:
LineInfo
;
reason
,
text
:
string
) :
void
def
abstract
onVariable
(
var
ctx
:
Context
;
category
,
name
:
string
;
info
:
TypeInfo
;
data
:
void
?) :
void
def
abstract
onBreakpointsReset
(
file
:
string
;
breakpointsNum
:
int
) :
void
def
abstract
onTick
:
void
def
abstract
onCollect
(
var
ctx
:
Context
;
at
:
LineInfo
) :
void
def
abstract
onLog
(
context
:
Context
?;
at
:
LineInfo
const
?;
level
:
int
;
text
:
string
#) :
bool
def
abstract
onBeforeGC
(
var
ctx
:
Context
) :
void
def
abstract
onAfterGC
(
var
ctx
:
Context
) :
void
def
abstract
onUserCommand
(
command
:
string
#) :
bool
def
abstract
onAllocate
(
var
ctx
:
Context
;
data
:
void
?;
size
:
uint64
;
at
:
LineInfo
) :
void
def
abstract
onReallocate
(
var
ctx
:
Context
;
data
:
void
?;
size
:
uint64
;
newData
:
void
?;
newSize
:
uint64
;
at
:
LineInfo
) :
void
def
abstract
onFree
(
var
ctx
:
Context
;
data
:
void
?;
at
:
LineInfo
) :
void
def
abstract
onAllocateString
(
var
ctx
:
Context
;
data
:
void
?;
size
:
uint64
;
tempString
:
bool
,
at
:
LineInfo
) :
void
def
abstract
onFreeString
(
var
ctx
:
Context
;
data
:
void
?;
tempString
:
bool
,
at
:
LineInfo
) :
void
@
do_not_delete thisAgent : DebugAgent ?
}
var
private
g_installed_agents
:
array
<
DapiDebugAgent
?
>
def
install_new_debug_agent
(
var
agentPtr
;
category
:
string
) {
static_if
(
typeinfo
is_class
(
*
agentPtr
)) {
let
agentInfo
=
class_info
(
*
agentPtr
)
var
inscope
agentAdapter
<
-
make_debug_agent
(
agentPtr
,
agentInfo
)
agentPtr
.
thisAgent
=
unsafe
(
reinterpret
<
DebugAgent
?
>
(
agentAdapter
))
g_installed_agents
|
>
push
(
unsafe
(
reinterpret
<
DapiDebugAgent
?
>
(
agentPtr
)))
install_debug_agent
(
agentAdapter
,
category
)
this_context
().
name
:=
"debug agent
{
category
}
"
}
else
{
concept_assert
(
false
,
"can't make debug agent of non-class"
)
}
}
def
install_new_thread_local_debug_agent
(
var
agentPtr
) {
static_if
(
typeinfo
is_class
(
*
agentPtr
)) {
let
agentInfo
=
class_info
(
*
agentPtr
)
var
inscope
agentAdapter
<
-
make_debug_agent
(
agentPtr
,
agentInfo
)
agentPtr
.
thisAgent
=
unsafe
(
reinterpret
<
DebugAgent
?
>
(
agentAdapter
))
g_installed_agents
|
>
push
(
unsafe
(
reinterpret
<
DapiDebugAgent
?
>
(
agentPtr
)))
install_debug_agent_thread_local
(
agentAdapter
)
this_context
().
name
:=
"thread local debug agent"
}
else
{
concept_assert
(
false
,
"can't make debug agent of non-class"
)
}
}
struct
DapiArray
{
data : void?
size : uint64
capacity : uint64
lock : uint
magic : uint
flags : bitfield<_shared; _hopeless; _forego_lock_check; _tableNoHash; _borrowed; _scratch>
_pad_after_flags : uint
}
struct
DapiTable
:
DapiArray
{
keys : void?
hashes : uint?
tombstones : uint64
}
struct
DapiBlock
{
stackOffset : uint
argumentsOffset : uint
body : void?
aotFunction : void?
functionArguments : float4?
info : FuncInfo?
}
struct
DapiFunc
{
index : int
}
struct
DapiLambda
{
captured : void?
}
struct
DapiSequence
{
iter : void?
}
class
DapiDataWalker
{
def
abstract
canVisitHandle
(
ps
:
void
?;
ti
:
TypeInfo
) :
bool
def
abstract
canVisitStructure
(
ps
:
void
?;
si
:
StructInfo
) :
bool
def
abstract
canVisitDim
(
ps
:
void
?;
ti
:
TypeInfo
) :
bool
def
abstract
canVisitArray
(
pa
:
void
?;
ti
:
TypeInfo
) :
bool
def
abstract
canVisitArrayData
(
ti
:
TypeInfo
;
count
:
uint64
) :
bool
def
abstract
canVisitTuple
(
ps
:
void
?;
ti
:
TypeInfo
) :
bool
def
abstract
canVisitVariant
(
ps
:
void
?;
ti
:
TypeInfo
) :
bool
def
abstract
canVisitTable
(
ps
:
void
?;
ti
:
TypeInfo
) :
bool
def
abstract
canVisitTableData
(
ti
:
TypeInfo
) :
bool
def
abstract
canVisitPointer
(
ti
:
TypeInfo
) :
bool
def
abstract
canVisitLambda
(
ti
:
TypeInfo
) :
bool
def
abstract
canVisitIterator
(
ti
:
TypeInfo
) :
bool
def
abstract
beforeStructure
(
ps
:
void
?;
si
:
StructInfo
) :
void
def
abstract
afterStructure
(
ps
:
void
?;
si
:
StructInfo
) :
void
def
abstract
afterStructureCancel
(
ps
:
void
?;
si
:
StructInfo
) :
void
def
abstract
beforeStructureField
(
ps
:
void
?;
si
:
StructInfo
;
pv
:
void
?;
vi
:
VarInfo
;
last
:
bool
) :
void
def
abstract
afterStructureField
(
ps
:
void
?;
si
:
StructInfo
;
pv
:
void
?;
vi
:
VarInfo
;
last
:
bool
) :
void
def
abstract
beforeTuple
(
ps
:
void
?;
ti
:
TypeInfo
) :
void
def
abstract
afterTuple
(
ps
:
void
?;
ti
:
TypeInfo
) :
void
def
abstract
beforeTupleEntry
(
ps
:
void
?;
ti
:
TypeInfo
;
pv
:
void
?;
idx
:
int
;
last
:
bool
) :
void
def
abstract
afterTupleEntry
(
ps
:
void
?;
ti
:
TypeInfo
;
pv
:
void
?;
idx
:
int
;
last
:
bool
) :
void
def
abstract
beforeVariant
(
ps
:
void
?;
ti
:
TypeInfo
) :
void
def
abstract
afterVariant
(
ps
:
void
?;
ti
:
TypeInfo
) :
void
def
abstract
beforeArrayData
(
ps
:
void
?;
stride
:
uint
;
count
:
uint64
;
ti
:
TypeInfo
) :
void
def
abstract
afterArrayData
(
ps
:
void
?;
stride
:
uint
;
count
:
uint64
;
ti
:
TypeInfo
) :
void
def
abstract
beforeArrayElement
(
ps
:
void
?;
ti
:
TypeInfo
;
pe
:
void
?;
index
:
uint64
;
last
:
bool
) :
void
def
abstract
afterArrayElement
(
ps
:
void
?;
ti
:
TypeInfo
;
pe
:
void
?;
index
:
uint64
;
last
:
bool
) :
void
def
abstract
beforeDim
(
ps
:
void
?;
ti
:
TypeInfo
) :
void
def
abstract
afterDim
(
ps
:
void
?;
ti
:
TypeInfo
) :
void
def
abstract
beforeArray
(
pa
:
DapiArray
;
ti
:
TypeInfo
) :
void
def
abstract
afterArray
(
pa
:
DapiArray
;
ti
:
TypeInfo
) :
void
def
abstract
beforeTable
(
pa
:
DapiTable
;
ti
:
TypeInfo
) :
void
def
abstract
beforeTableKey
(
pa
:
DapiTable
;
ti
:
TypeInfo
;
pk
:
void
?;
ki
:
TypeInfo
;
index
:
uint64
;
last
:
bool
) :
void
def
abstract
afterTableKey
(
pa
:
DapiTable
;
ti
:
TypeInfo
;
pk
:
void
?;
ki
:
TypeInfo
;
index
:
uint64
;
last
:
bool
) :
void
def
abstract
beforeTableValue
(
pa
:
DapiTable
;
ti
:
TypeInfo
;
pv
:
void
?;
kv
:
TypeInfo
;
index
:
uint64
;
last
:
bool
) :
void
def
abstract
afterTableValue
(
pa
:
DapiTable
;
ti
:
TypeInfo
;
pv
:
void
?;
kv
:
TypeInfo
;
index
:
uint64
;
last
:
bool
) :
void
def
abstract
afterTable
(
pa
:
DapiTable
;
ti
:
TypeInfo
) :
void
def
abstract
beforeRef
(
ps
:
void
?;
ti
:
TypeInfo
) :
void
def
abstract
afterRef
(
ps
:
void
?;
ti
:
TypeInfo
) :
void
def
abstract
beforePtr
(
ps
:
void
?;
ti
:
TypeInfo
) :
void
def
abstract
afterPtr
(
ps
:
void
?;
ti
:
TypeInfo
) :
void
def
abstract
beforeHandle
(
ps
:
void
?;
ti
:
TypeInfo
) :
void
def
abstract
afterHandle
(
ps
:
void
?;
ti
:
TypeInfo
) :
void
def
abstract
afterHandleCancel
(
ps
:
void
?;
ti
:
TypeInfo
) :
void
def
abstract
beforeLambda
(
var
value
:
DapiLambda
;
ti
:
TypeInfo
) :
void
def
abstract
afterLambda
(
var
value
:
DapiLambda
;
ti
:
TypeInfo
) :
void
def
abstract
beforeIterator
(
var
value
:
DapiSequence
;
ti
:
TypeInfo
) :
void
def
abstract
afterIterator
(
var
value
:
DapiSequence
;
ti
:
TypeInfo
) :
void
def
abstract
Null
(
ti
:
TypeInfo
) :
void
def
abstract
VoidPtr
(
var
value
:
void
?
&
) :
void
def
abstract
Bool
(
var
value
:
bool
&
) :
void
def
abstract
Int8
(
var
value
:
int8
&
) :
void
def
abstract
UInt8
(
var
value
:
uint8
&
) :
void
def
abstract
Int16
(
var
value
:
int16
&
) :
void
def
abstract
UInt16
(
var
value
:
uint16
&
) :
void
def
abstract
Int64
(
var
value
:
int64
&
) :
void
def
abstract
UInt64
(
var
value
:
uint64
&
) :
void
def
abstract
String
(
var
value
:
string
&
) :
void
def
abstract
Double
(
var
value
:
double
&
) :
void
def
abstract
Float
(
var
value
:
float
&
) :
void
def
abstract
Int
(
var
value
:
int
&
) :
void
def
abstract
UInt
(
var
value
:
uint
&
) :
void
def
abstract
Bitfield
(
var
value
:
uint
&
;
ti
:
TypeInfo
) :
void
def
abstract
Bitfield8
(
var
value
:
uint8
&
;
ti
:
TypeInfo
) :
void
def
abstract
Bitfield16
(
var
value
:
uint16
&
;
ti
:
TypeInfo
) :
void
def
abstract
Bitfield64
(
var
value
:
uint64
&
;
ti
:
TypeInfo
) :
void
def
abstract
Int2
(
var
value
:
int2
&
) :
void
def
abstract
Int3
(
var
value
:
int3
&
) :
void
def
abstract
Int4
(
var
value
:
int4
&
) :
void
def
abstract
UInt2
(
var
value
:
uint2
&
) :
void
def
abstract
UInt3
(
var
value
:
uint3
&
) :
void
def
abstract
UInt4
(
var
value
:
uint4
&
) :
void
def
abstract
Float2
(
var
value
:
float2
&
) :
void
def
abstract
Float3
(
var
value
:
float3
&
) :
void
def
abstract
Float4
(
var
value
:
float4
&
) :
void
def
abstract
Range
(
var
value
:
range
&
) :
void
def
abstract
URange
(
var
value
:
urange
&
) :
void
def
abstract
Range64
(
var
value
:
range64
&
) :
void
def
abstract
URange64
(
var
value
:
urange64
&
) :
void
def
abstract
Float16
(
var
value
:
float16
&
) :
void
def
abstract
Half2
(
var
value
:
half2
&
) :
void
def
abstract
Half3
(
var
value
:
half3
&
) :
void
def
abstract
Half4
(
var
value
:
half4
&
) :
void
def
abstract
Half8
(
var
value
:
half8
&
) :
void
def
abstract
Short2
(
var
value
:
short2
&
) :
void
def
abstract
Short3
(
var
value
:
short3
&
) :
void
def
abstract
Short4
(
var
value
:
short4
&
) :
void
def
abstract
Short8
(
var
value
:
short8
&
) :
void
def
abstract
UShort2
(
var
value
:
ushort2
&
) :
void
def
abstract
UShort3
(
var
value
:
ushort3
&
) :
void
def
abstract
UShort4
(
var
value
:
ushort4
&
) :
void
def
abstract
UShort8
(
var
value
:
ushort8
&
) :
void
def
abstract
Byte2
(
var
value
:
byte2
&
) :
void
def
abstract
Byte3
(
var
value
:
byte3
&
) :
void
def
abstract
Byte4
(
var
value
:
byte4
&
) :
void
def
abstract
Byte8
(
var
value
:
byte8
&
) :
void
def
abstract
Byte16
(
var
value
:
byte16
&
) :
void
def
abstract
UByte2
(
var
value
:
ubyte2
&
) :
void
def
abstract
UByte3
(
var
value
:
ubyte3
&
) :
void
def
abstract
UByte4
(
var
value
:
ubyte4
&
) :
void
def
abstract
UByte8
(
var
value
:
ubyte8
&
) :
void
def
abstract
UByte16
(
var
value
:
ubyte16
&
) :
void
def
abstract
WalkBlock
(
var
value
:
DapiBlock
) :
void
def
abstract
WalkFunction
(
var
value
:
DapiFunc
) :
void
def
abstract
WalkEnumeration
(
var
value
:
int
&
;
ei
:
EnumInfo
) :
void
def
abstract
WalkEnumeration8
(
var
value
:
int8
&
;
ei
:
EnumInfo
) :
void
def
abstract
WalkEnumeration16
(
var
value
:
int16
&
;
ei
:
EnumInfo
) :
void
def
abstract
WalkEnumeration64
(
var
value
:
int64
&
;
ei
:
EnumInfo
) :
void
def
abstract
FakeContext
(
var
value
:
Context
) :
void
def
abstract
InvalidData
:
void
}
def
make_data_walker
(
classPtr
;
blk
:
block
<
(
var
adapter
:
DataWalker
?) :
void
>) {
static_if
(
typeinfo
is_class
(
*
classPtr
)) {
unsafe
{
let
classInfo
=
class_info
(
*
classPtr
)
make_data_walker
(
classPtr
,
classInfo
,
blk
)
}
}
else
{
concept_assert
(
false
,
"can't make data walker of non-class"
)
}
}
class
DapiStackWalker
{
def
abstract
canWalkArguments
:
bool
def
abstract
canWalkVariables
:
bool
def
abstract
canWalkOutOfScopeVariables
:
bool
def
abstract
onBeforeCall
(
pp
:
Prologue
;
sp
:
void
?) :
void
def
abstract
onCallAOT
(
pp
:
Prologue
;
fileName
:
string
#) :
void
def
abstract
onCallJIT
(
pp
:
Prologue
;
fileName
:
string
#) :
void
def
abstract
onCallAt
(
pp
:
Prologue
;
info
:
FuncInfo
;
at
:
LineInfo
) :
void
def
abstract
onCall
(
pp
:
Prologue
;
info
:
FuncInfo
) :
void
def
abstract
onAfterPrologue
(
pp
:
Prologue
;
sp
:
void
?) :
void
def
abstract
onArgument
(
info
:
FuncInfo
;
index
:
int
;
vinfo
:
VarInfo
;
arg
:
float4
) :
void
def
abstract
onBeforeVariables
:
void
def
abstract
onVariable
(
inf
:
FuncInfo
;
vinfo
:
LocalVariableInfo
;
arg
:
void
?;
inScope
:
bool
) :
void
def
abstract
onAfterCall
(
pp
:
Prologue
) :
bool
def
abstract
onCorruptStack
(
pp
:
Prologue
) :
void
}
def
make_stack_walker
(
classPtr
;
blk
:
block
<
(
var
adapter
:
StackWalker
?) :
void
>) {
static_if
(
typeinfo
is_class
(
*
classPtr
)) {
unsafe
{
let
classInfo
=
class_info
(
*
classPtr
)
make_stack_walker
(
classPtr
,
classInfo
,
blk
)
}
}
else
{
concept_assert
(
false
,
"can't make stack walker of non-class"
)
}
}
Back
|
FazBrowse Home
|
New Git URL