mm/tools/asm-differ
Anghelo Carvajal b2747aa8b4
Subrepos updates (#360)
* git subrepo pull tools/asm-differ --force

subrepo:
  subdir:   "tools/asm-differ"
  merged:   "d218cdf0"
upstream:
  origin:   "https://github.com/simonlindholm/asm-differ.git"
  branch:   "main"
  commit:   "d218cdf0"
git-subrepo:
  version:  "0.4.3"
  origin:   "https://github.com/ingydotnet/git-subrepo.git"
  commit:   "2f68596"

* git subrepo pull tools/graphovl --force

subrepo:
  subdir:   "tools/graphovl"
  merged:   "f5fe93d7"
upstream:
  origin:   "https://github.com/AngheloAlf/graphovl.git"
  branch:   "master"
  commit:   "f5fe93d7"
git-subrepo:
  version:  "0.4.3"
  origin:   "https://github.com/ingydotnet/git-subrepo.git"
  commit:   "2f68596"

* git subrepo pull tools/ZAPD --force

subrepo:
  subdir:   "tools/ZAPD"
  merged:   "e7a8a48c"
upstream:
  origin:   "https://github.com/zeldaret/ZAPD.git"
  branch:   "master"
  commit:   "e7a8a48c"
git-subrepo:
  version:  "0.4.3"
  origin:   "https://github.com/ingydotnet/git-subrepo.git"
  commit:   "2f68596"

* git subrepo pull tools/graphovl --force

subrepo:
  subdir:   "tools/graphovl"
  merged:   "d14ea084"
upstream:
  origin:   "https://github.com/AngheloAlf/graphovl.git"
  branch:   "master"
  commit:   "d14ea084"
git-subrepo:
  version:  "0.4.3"
  origin:   "https://github.com/ingydotnet/git-subrepo.git"
  commit:   "2f68596"

* git subrepo pull tools/ZAPD --force

subrepo:
  subdir:   "tools/ZAPD"
  merged:   "e243634e"
upstream:
  origin:   "https://github.com/zeldaret/ZAPD.git"
  branch:   "master"
  commit:   "e243634e"
git-subrepo:
  version:  "0.4.3"
  origin:   "https://github.com/ingydotnet/git-subrepo.git"
  commit:   "2f68596"

* git subrepo pull tools/decomp-permuter --force

subrepo:
  subdir:   "tools/decomp-permuter"
  merged:   "d1294dfa0"
upstream:
  origin:   "https://github.com/simonlindholm/decomp-permuter.git"
  branch:   "main"
  commit:   "d1294dfa0"
git-subrepo:
  version:  "0.4.3"
  origin:   "https://github.com/ingydotnet/git-subrepo.git"
  commit:   "2f68596"

* git subrepo pull tools/graphovl --force

subrepo:
  subdir:   "tools/graphovl"
  merged:   "f5fe93d75"
upstream:
  origin:   "https://github.com/AngheloAlf/graphovl.git"
  branch:   "master"
  commit:   "f5fe93d75"
git-subrepo:
  version:  "0.4.3"
  origin:   "https://github.com/ingydotnet/git-subrepo.git"
  commit:   "2f68596"

* git subrepo pull tools/ZAPD --force

subrepo:
  subdir:   "tools/ZAPD"
  merged:   "d0cd6b397"
upstream:
  origin:   "https://github.com/zeldaret/ZAPD.git"
  branch:   "master"
  commit:   "d0cd6b397"
git-subrepo:
  version:  "0.4.3"
  origin:   "https://github.com/ingydotnet/git-subrepo.git"
  commit:   "2f68596"

* add ExternalXMLFolder config

* git subrepo pull --force tools/decomp-permuter

subrepo:
  subdir:   "tools/decomp-permuter"
  merged:   "a20bac942"
upstream:
  origin:   "https://github.com/simonlindholm/decomp-permuter.git"
  branch:   "main"
  commit:   "a20bac942"
git-subrepo:
  version:  "0.4.3"
  origin:   "https://github.com/ingydotnet/git-subrepo.git"
  commit:   "2f68596"

* git subrepo pull --force tools/ZAPD

subrepo:
  subdir:   "tools/ZAPD"
  merged:   "4f7b8393e"
upstream:
  origin:   "https://github.com/zeldaret/ZAPD.git"
  branch:   "master"
  commit:   "4f7b8393e"
git-subrepo:
  version:  "0.4.3"
  origin:   "https://github.com/ingydotnet/git-subrepo.git"
  commit:   "2f68596"

* git subrepo pull --force tools/asm-differ

subrepo:
  subdir:   "tools/asm-differ"
  merged:   "f30d43ace"
upstream:
  origin:   "https://github.com/simonlindholm/asm-differ.git"
  branch:   "main"
  commit:   "f30d43ace"
git-subrepo:
  version:  "0.4.3"
  origin:   "https://github.com/ingydotnet/git-subrepo.git"
  commit:   "2f68596"

* Remove Segment="128"
2021-10-24 13:04:36 -03:00
..
.gitignore Update asm-processor and diff.py (#278) 2021-08-25 01:11:41 -04:00
.gitrepo Subrepos updates (#360) 2021-10-24 13:04:36 -03:00
.pre-commit-config.yaml Update subrepos (#281) 2021-09-21 20:13:03 -04:00
diff_settings.py Update subrepos (#281) 2021-09-21 20:13:03 -04:00
diff-stylesheet.css Update subrepos (#281) 2021-09-21 20:13:03 -04:00
diff.py Subrepos updates (#360) 2021-10-24 13:04:36 -03:00
LICENSE Update asm-processor and diff.py (#278) 2021-08-25 01:11:41 -04:00
mypy.ini Update subrepos (#281) 2021-09-21 20:13:03 -04:00
README.md Update subrepos (#281) 2021-09-21 20:13:03 -04:00
screenshot.png Update asm-processor and diff.py (#278) 2021-08-25 01:11:41 -04:00

asm-differ

Nice differ for assembly code. Currently supports MIPS, PPC, AArch64, and ARM32; should be easy to hack to support other instruction sets.

Dependencies

  • Python >= 3.6
  • python3 -m pip install --user colorama watchdog python-Levenshtein (also dataclasses if on 3.6)

Usage

Create a file diff_settings.sh in some directory (see the one in this repo for an example). Then from that directory, run

/path/to/diff.sh [flags] (function|rom addr)

Recommended flags are -mwo (automatically run make on source file changes, and include symbols in diff). See --help for more details.

Tab completion

argcomplete can be optionally installed (with python3 -m pip install argcomplete) to enable tab completion in a bash shell, completing options and symbol names using the linker map. It also requires a bit more setup:

If invoking the script exactly as ./diff.py, the following should be added to the .bashrc according to argcomplete's instructions:

eval "$(register-python-argcomplete ./diff.py)"

If that doesn't work, run register-python-argcomplete ./diff.py in your terminal and copy the output to .bashrc.

If setup correctly (don't forget to restart the shell), complete | grep ./diff.py should output:

complete -o bashdefault -o default -o nospace -F _python_argcomplete ./diff.py

Note for developers or for general troubleshooting: run export _ARC_DEBUG= to enable debug output during tab-completion, it may show otherwise silenced errors. Use unset _ARC_DEBUG or restart the terminal to disable.

Contributing

Contributions are very welcome! Some notes on workflow:

black is used for code formatting. You can either run black diff.py manually, or set up a pre-commit hook:

pip install pre-commit black
pre-commit install

Type annotations are used for all Python code. mypy should pass without any errors.

PRs that skip the above are still welcome, however.

The targeted Python version is 3.6. There are currently no tests.