From 71e99abbcf2a3555acdfd11bc57c78c1f1c09ae9 Mon Sep 17 00:00:00 2001 From: Chris PeBenito Date: Tue, 7 Apr 2015 14:43:17 -0400 Subject: [PATCH] sedta: add limit for transition output --- sedta | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sedta b/sedta index b274389..4ee4f6c 100755 --- a/sedta +++ b/sedta @@ -89,6 +89,8 @@ alg.add_argument("-A", "--all_paths", type=int, metavar="MAX_STEPS", opts = parser.add_argument_group("Analysis options") opts.add_argument("-r", "--reverse", action="store_true", default=False, help="Perform a reverse DTA.") +opts.add_argument("-l", "--limit_trans", default=0, type=int, + help="Limit to the specified number of transitions. Default is unlimited.") opts.add_argument("exclude", help="List of excluded types in the analysis.", nargs="*") args = parser.parse_args() @@ -127,6 +129,9 @@ try: print("Step {0}: {1} -> {2}\n".format(step, src, tgt)) print_transition(trans, entrypoints, setexec, dyntrans, setcur) + if args.limit_trans and i >= args.limit_trans: + break + print(i, "domain transition path(s) found.") else: # single transition @@ -138,6 +143,9 @@ try: print("Transition {0}: {1} -> {2}\n".format(i, src, tgt)) print_transition(trans, entrypoints, setexec, dyntrans, setcur) + if args.limit_trans and i >= args.limit_trans: + break + print(i, "domain transition(s) found.") if args.stats: