Skip to content

Commit

Permalink
Change to --no-debug by default, remove --no-node-comments
Browse files Browse the repository at this point in the history
  • Loading branch information
simonlindholm committed Dec 12, 2018
1 parent bf2d67e commit 881ce8b
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 8 deletions.
2 changes: 1 addition & 1 deletion run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ for D in tests/{irix-g,irix-o2}; do
for T in $D/*.s; do
C_FILE=$D/output/$(basename $T .s).c
FN_NAME=test
python3 src/main.py --no-debug --no-node-comments --stop-on-error $T $FN_NAME >.stdout 2>.stderr
python3 src/main.py --stop-on-error $T $FN_NAME >.stdout 2>.stderr
if [[ $? != 0 ]]; then
EXPECTED=$(cat $C_FILE 2>/dev/null)
echo CRASHED > $C_FILE
Expand Down
2 changes: 1 addition & 1 deletion src/if_statements.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ def build_flowgraph_between(
level of indentation.
"""
curr_start = start
body = Body(print_node_comment=context.options.node_comments)
body = Body(print_node_comment=context.options.debug)

# We will split this graph into subgraphs, where the entrance and exit nodes
# of that subgraph are at the same indentation level. "curr_start" will
Expand Down
7 changes: 2 additions & 5 deletions src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,8 @@ def main(options: Options, function_index_or_name: str) -> None:
parser = argparse.ArgumentParser(description="Decompile MIPS assembly to C.")
parser.add_argument('filename', help="input filename")
parser.add_argument('function', help="function index or name", type=str)
parser.add_argument('--no-debug', dest='debug',
help="don't print any debug info", action='store_false')
parser.add_argument('--no-node-comments', dest='node_comments',
help="don't print comments about node numbers", action='store_false')
parser.add_argument('--debug', dest='debug',
help="print debug info", action='store_true')
parser.add_argument('--stop-on-error', dest='stop_on_error',
help="stop when encountering any error", action='store_true')
parser.add_argument('--print-assembly', dest='print_assembly',
Expand All @@ -64,7 +62,6 @@ def main(options: Options, function_index_or_name: str) -> None:
filename=args.filename,
debug=args.debug,
stop_on_error=args.stop_on_error,
node_comments=args.node_comments,
print_assembly=args.print_assembly,
visualize_flowgraph=args.visualize,
)
Expand Down
1 change: 0 additions & 1 deletion src/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@ class Options:
filename: str = attr.ib()
debug: bool = attr.ib()
stop_on_error: bool = attr.ib()
node_comments: bool = attr.ib()
print_assembly: bool = attr.ib()
visualize_flowgraph: bool = attr.ib()

0 comments on commit 881ce8b

Please sign in to comment.