File tree 3 files changed +11
-9
lines changed
3 files changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,9 @@ python_version = 3.6
4
4
[mypy-undodb.debugger_extensions]
5
5
ignore_missing_imports = True
6
6
7
+ [mypy-undodb.debugger_extensions.debugger_io]
8
+ ignore_missing_imports = True
9
+
7
10
[mypy-undodb.udb_launcher]
8
11
ignore_missing_imports = True
9
12
Original file line number Diff line number Diff line change 14
14
from undo .udb_launcher import REDIRECTION_COLLECT , UdbLauncher
15
15
16
16
17
- def main (argv ) :
17
+ def main (argv : list [ str ]) -> None :
18
18
# Get the arguments from the command line.
19
19
try :
20
20
recording = argv [1 ]
@@ -34,7 +34,7 @@ def main(argv):
34
34
# to the user but, in case of errors, we want to display it.
35
35
res = launcher .run_debugger (redirect_debugger_output = REDIRECTION_COLLECT )
36
36
37
- if res .exit_code == 0 :
37
+ if not res .exit_code :
38
38
# All good as UDB exited with exit code 0 (i.e. no errors).
39
39
# The result_data attribute is used to pass information from the extension to this script.
40
40
unmatched = res .result_data ["unmatched" ]
Original file line number Diff line number Diff line change 16
16
from undodb .debugger_extensions .debugger_io import redirect_to_launcher_output
17
17
18
18
19
- def leak_check ():
19
+ def leak_check () -> None :
20
20
"""
21
21
Implements breakpoints and stops on all calls to malloc() and free(), capturing the
22
22
timestamp, size and returned pointer for malloc(), then confirms the address pointer is later
@@ -83,15 +83,14 @@ def leak_check():
83
83
else :
84
84
print ("--- INFO: Free called with null address" )
85
85
86
- #with redirect_to_launcher_output():
86
+ # with redirect_to_launcher_output():
87
87
print (f"{ time } : free() called for { int (addr ):#x} " )
88
88
89
-
90
89
# If Allocations has any entries remaining, they were not released.
91
90
with redirect_to_launcher_output ():
92
- print ()
93
- print (f"{ len (allocations )} unmatched memory allocation(s):" )
94
- print ()
91
+ print ()
92
+ print (f"{ len (allocations )} unmatched memory allocation(s):" )
93
+ print ()
95
94
96
95
total = 0
97
96
@@ -124,7 +123,7 @@ def leak_check():
124
123
125
124
# UDB will automatically load the modules passed to UdbLauncher.add_extension and, if present,
126
125
# automatically execute any function (with no arguments) called "run".
127
- def run ():
126
+ def run () -> None :
128
127
# Needed to allow GDB to fixup breakpoints properly after glibc has been loaded
129
128
gdb .Breakpoint ("main" )
130
129
You can’t perform that action at this time.
0 commit comments