Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
Signed-off-by: Kemal Akkoyun <[email protected]>
  • Loading branch information
kakkoyun committed Mar 1, 2024
1 parent c0a1ceb commit b973109
Show file tree
Hide file tree
Showing 25 changed files with 216 additions and 255 deletions.
10 changes: 0 additions & 10 deletions pkg/datamap/dwarf.go
Original file line number Diff line number Diff line change
Expand Up @@ -276,16 +276,6 @@ func attrs(entry *dwarf.Entry) map[dwarf.Attr]any {
return attrs
}

func printAttrs(attrs map[dwarf.Attr]any) {
for k, v := range attrs {
fmt.Printf("%s: %v\n", k, v)
}
}

func printEntryAttrs(entry *dwarf.Entry) {
printAttrs(attrs(entry))
}

func nameAttr(attrs map[dwarf.Attr]any) string {
nameAttr, ok := attrs[dwarf.AttrName]
if !ok {
Expand Down
3 changes: 1 addition & 2 deletions pkg/python/datamap.go
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,6 @@ type python312 struct {
PyInterpreterFrameOwner int64 `offsetof:"_PyInterpreterFrame.owner"`
PyCodeObjectCoFilename int64 `offsetof:"PyCodeObject.co_filename"`
PyCodeObjectCoName int64 `offsetof:"PyCodeObject.co_name"`
PyCodeObjectCoVarNames int64 `offsetof:"PyCodeObject.co_varnames"`
PyCodeObjectCoFirstlineno int64 `offsetof:"PyCodeObject.co_firstlineno"`
PyTupleObjectObItem int64 `offsetof:"PyTupleObject.ob_item"`
}
Expand Down Expand Up @@ -380,7 +379,7 @@ func (p python312) Layout() runtimedata.RuntimeData {
PyCodeObject: PyCodeObject{
CoFilename: p.PyCodeObjectCoFilename,
CoName: p.PyCodeObjectCoName,
CoVarnames: p.PyCodeObjectCoVarNames,
CoVarnames: doesNotExist,
CoFirstlineno: p.PyCodeObjectCoFirstlineno,
},
PyTupleObject: PyTupleObject{
Expand Down
1 change: 1 addition & 0 deletions tests/integration/python_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ var pythonVersions = []string{
"3.9.5",
"3.10.0",
"3.11.0",
"3.12.0",
}

func TestPythonIntegration(t *testing.T) {
Expand Down
39 changes: 18 additions & 21 deletions tests/integration/testdata/python_2_7_15.yaml
Original file line number Diff line number Diff line change
@@ -1,37 +1,34 @@
major_version: 2
minor_version: 7
patch_version: 15
py_cframe:
current_frame: 0
py_code_object:
co_filename: 80
co_name: 88
co_varnames: 56
co_firstlineno: 96
py_frame_object:
f_back: 24
f_code: 32
f_lineno: 124
f_localsplus: 376
py_interpreter_state:
tstate_head: 8
py_object:
ob_type: 8
py_runtime_state:
interp_main: -1
py_string:
data: 36
size: 16
py_type_object:
tp_name: 24
py_thread_state:
next: 0
interp: 8
frame: 16
thread_id: 144
native_thread_id: -1
cframe: -1
py_cframe:
current_frame: 0
py_interpreter_state:
tstate_head: 8
py_runtime_state:
interp_main: -1
py_frame_object:
f_back: 24
f_code: 32
f_lineno: 124
f_localsplus: 376
py_code_object:
co_filename: 80
co_name: 88
co_varnames: 56
co_firstlineno: 96
py_tuple_object:
ob_item: 24
py_type_object:
tp_name: 24
py_interpreter_frame:
owner: -1
39 changes: 18 additions & 21 deletions tests/integration/testdata/python_3_10_0.yaml
Original file line number Diff line number Diff line change
@@ -1,37 +1,34 @@
major_version: 3
minor_version: 10
patch_version: 0
py_cframe:
current_frame: 0
py_code_object:
co_filename: 104
co_name: 112
co_varnames: 72
co_firstlineno: 40
py_frame_object:
f_back: 24
f_code: 32
f_lineno: 100
f_localsplus: 352
py_interpreter_state:
tstate_head: 8
py_object:
ob_type: 8
py_runtime_state:
interp_main: -1
py_string:
data: 48
size: -1
py_type_object:
tp_name: 24
py_thread_state:
next: 8
interp: 16
frame: 24
thread_id: 176
native_thread_id: -1
cframe: -1
py_cframe:
current_frame: 0
py_interpreter_state:
tstate_head: 8
py_runtime_state:
interp_main: -1
py_frame_object:
f_back: 24
f_code: 32
f_lineno: 100
f_localsplus: 352
py_code_object:
co_filename: 104
co_name: 112
co_varnames: 72
co_firstlineno: 40
py_tuple_object:
ob_item: 24
py_type_object:
tp_name: 24
py_interpreter_frame:
owner: -1
39 changes: 18 additions & 21 deletions tests/integration/testdata/python_3_11_0.yaml
Original file line number Diff line number Diff line change
@@ -1,37 +1,34 @@
major_version: 3
minor_version: 11
patch_version: 0
py_cframe:
current_frame: 8
py_code_object:
co_filename: 112
co_name: 120
co_varnames: 96
co_firstlineno: 72
py_frame_object:
f_back: 48
f_code: 32
f_lineno: -1
f_localsplus: 72
py_interpreter_state:
tstate_head: 16
py_object:
ob_type: 8
py_runtime_state:
interp_main: 48
py_string:
data: 48
size: -1
py_type_object:
tp_name: 24
py_thread_state:
next: 8
interp: 16
frame: -1
thread_id: 152
native_thread_id: 160
cframe: 56
py_cframe:
current_frame: 8
py_interpreter_state:
tstate_head: 16
py_runtime_state:
interp_main: 48
py_frame_object:
f_back: 48
f_code: 32
f_lineno: -1
f_localsplus: 72
py_code_object:
co_filename: 112
co_name: 120
co_varnames: 96
co_firstlineno: 72
py_tuple_object:
ob_item: 24
py_type_object:
tp_name: 24
py_interpreter_frame:
owner: 69
34 changes: 34 additions & 0 deletions tests/integration/testdata/python_3_12_0.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
py_cframe:
current_frame: 0
py_code_object:
co_filename: 112
co_name: 120
co_varnames: -1
co_firstlineno: 68
py_frame_object:
f_back: 8
f_code: 0
f_lineno: -1
f_localsplus: 72
py_interpreter_state:
tstate_head: 72
py_object:
ob_type: 8
py_runtime_state:
interp_main: 48
py_string:
data: 40
size: -1
py_thread_state:
next: 8
interp: 16
frame: -1
thread_id: 136
native_thread_id: 144
cframe: 56
py_tuple_object:
ob_item: 24
py_type_object:
tp_name: 24
py_interpreter_frame:
owner: 70
39 changes: 18 additions & 21 deletions tests/integration/testdata/python_3_3_7.yaml
Original file line number Diff line number Diff line change
@@ -1,37 +1,34 @@
major_version: 3
minor_version: 3
patch_version: 7
py_cframe:
current_frame: 0
py_code_object:
co_filename: 96
co_name: 104
co_varnames: 64
co_firstlineno: 112
py_frame_object:
f_back: 24
f_code: 32
f_lineno: 124
f_localsplus: 376
py_interpreter_state:
tstate_head: 8
py_object:
ob_type: 8
py_runtime_state:
interp_main: -1
py_string:
data: 48
size: 16
py_type_object:
tp_name: 24
py_thread_state:
next: 0
interp: 8
frame: 16
thread_id: 144
native_thread_id: -1
cframe: -1
py_cframe:
current_frame: 0
py_interpreter_state:
tstate_head: 8
py_runtime_state:
interp_main: -1
py_frame_object:
f_back: 24
f_code: 32
f_lineno: 124
f_localsplus: 376
py_code_object:
co_filename: 96
co_name: 104
co_varnames: 64
co_firstlineno: 112
py_tuple_object:
ob_item: 24
py_type_object:
tp_name: 24
py_interpreter_frame:
owner: -1
39 changes: 18 additions & 21 deletions tests/integration/testdata/python_3_4_8.yaml
Original file line number Diff line number Diff line change
@@ -1,37 +1,34 @@
major_version: 3
minor_version: 4
patch_version: 8
py_cframe:
current_frame: 0
py_code_object:
co_filename: 96
co_name: 104
co_varnames: 64
co_firstlineno: 112
py_frame_object:
f_back: 24
f_code: 32
f_lineno: 124
f_localsplus: 376
py_interpreter_state:
tstate_head: 8
py_object:
ob_type: 8
py_runtime_state:
interp_main: -1
py_string:
data: 48
size: 16
py_type_object:
tp_name: 24
py_thread_state:
next: 8
interp: 16
frame: 24
thread_id: 152
native_thread_id: -1
cframe: -1
py_cframe:
current_frame: 0
py_interpreter_state:
tstate_head: 8
py_runtime_state:
interp_main: -1
py_frame_object:
f_back: 24
f_code: 32
f_lineno: 124
f_localsplus: 376
py_code_object:
co_filename: 96
co_name: 104
co_varnames: 64
co_firstlineno: 112
py_tuple_object:
ob_item: 24
py_type_object:
tp_name: 24
py_interpreter_frame:
owner: -1
Loading

0 comments on commit b973109

Please sign in to comment.