From 5fcbe0a483123b30d3a59f0c27e6c85bbca87ae0 Mon Sep 17 00:00:00 2001 From: rozlette Date: Thu, 8 Nov 2018 20:58:39 -0600 Subject: [PATCH] Add slightly better diffing tool --- .gitignore | 3 ++- asmdiff.sh | 12 ++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 asmdiff.sh diff --git a/.gitignore b/.gitignore index cbe2e08126..22955a9aad 100644 --- a/.gitignore +++ b/.gitignore @@ -14,4 +14,5 @@ __pychahe__/* *.pyc test.txt *.xlsx -src/test.c \ No newline at end of file +src/test.c +*.dump \ No newline at end of file diff --git a/asmdiff.sh b/asmdiff.sh new file mode 100644 index 0000000000..2a7845e8bb --- /dev/null +++ b/asmdiff.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +MIPS_BINUTILS="mips-linux-gnu-" + +OBJDUMP="${MIPS_BINUTILS}objdump -D -z -mmips -EB -j .text" + +FORMATTER="sed '/^0/!s/.*://'" + +$OBJDUMP build/src/test.o | sed '1,6d; /^0/!s/.*://' > test.dump +$OBJDUMP $1 | sed '1,6d; /^0/!s/.*://' > comp.dump +diff -y test.dump comp.dump > diff.dump +rm test.dump comp.dump \ No newline at end of file