-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtestTrace.py
89 lines (60 loc) · 891 Bytes
/
testTrace.py
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
import bdb
import pdb
import inspect
import sys
import ast
node = ast.parse('')
# bdb.test()
# def lambdaHelper(x):
# id = x
#
#
# x = lambda x, y = lambdaHelper(1): lambda y, , x = lambdaHelper(1): x + y
# x(1)(2)
def f(x, h = None):
return x
def g(y):
return y + 1
def h(q):
return q - 1
#
pdb.run("f(h(g(2)))")
# pdb.run("f(g(2), h(3))")
# debug = bdb.Bdb()
# print(debug.run("f(g(2), h(3))", globals()))
# debug.run(globals(), "f(h(g(2)))")
f(g(2), h(3))
f(h(g(2)))
# q = 1 / 0
#
#
# def nop(f):
# return f
#
# nop(f(nop(g(2))))
#
# nop (g(2))
# nop(f(3))
# def createFlag(func):
# print(func)
#
# def f(x):
# return x + 2
#
# oldf = f
# def newf(param):
# createFlag(f)
# return f(param)
#
# f = newf
#
# f(2)
#
# def g(x):
# return x + 1
#
# def newg(param):
# createFlag(g)
# return g(param)
#
# g = newg