File tree Expand file tree Collapse file tree 2 files changed +13
-4
lines changed
Expand file tree Collapse file tree 2 files changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -1184,8 +1184,9 @@ def parse() -> argparse.Namespace:
11841184 report_patchcandidates .add_argument (
11851185 "--targets" ,
11861186 nargs = "*" ,
1187- default = [],
1188- help = "list of target library functions to include" )
1187+ default = ['all' ],
1188+ help = "list of target library functions to include. If not passed, all "
1189+ "library functions found will be included." )
11891190 report_patchcandidates .add_argument (
11901191 "--verbose" , "-v" ,
11911192 action = "store_true" ,
Original file line number Diff line number Diff line change 6666from chb .util .loggingutil import chklogger
6767
6868if TYPE_CHECKING :
69- from chb .api .CallTarget import StubTarget
69+ from chb .api .CallTarget import (
70+ StubTarget , CallTarget )
7071 from chb .api .FunctionStub import SOFunction
7172 from chb .app .AppAccess import AppAccess
7273 from chb .app .Instruction import Instruction
@@ -1156,14 +1157,21 @@ def report_patch_candidates(args: argparse.Namespace) -> NoReturn:
11561157 n_calls : int = 0
11571158 libcalls = LibraryCallCallsites ()
11581159
1160+ include_all = xtargets == ['all' ]
1161+
1162+ def include_target (target : 'CallTarget' ) -> bool :
1163+ if include_all :
1164+ return True
1165+ return target .name in xtargets
1166+
11591167 for (faddr , blocks ) in app .call_instructions ().items ():
11601168 fn = app .function (faddr )
11611169
11621170 for (baddr , instrs ) in blocks .items ():
11631171 for instr in instrs :
11641172 n_calls += 1
11651173 calltgt = instr .call_target
1166- if calltgt .is_so_target and calltgt . name in xtargets :
1174+ if calltgt .is_so_target and include_target ( calltgt ) :
11671175 libcalls .add_library_callsite (faddr , instr )
11681176
11691177 print ("Number of calls: " + str (n_calls ))
You can’t perform that action at this time.
0 commit comments