mm/tools/asm-differ
Anghelo Carvajal 97e066f23f
Update asm-processor and diff.py (#278)
* fix asm differ branch

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

subrepo:
  subdir:   "tools/asm-differ"
  merged:   "fd0984c97"
upstream:
  origin:   "https://github.com/simonlindholm/asm-differ.git"
  branch:   "main"
  commit:   "fd0984c97"
git-subrepo:
  version:  "0.4.3"
  origin:   "???"
  commit:   "???"

* delete asm-processor

* git subrepo clone git@github.com:simonlindholm/asm-processor.git tools/asm-processor

subrepo:
  subdir:   "tools/asm-processor"
  merged:   "755f734fb"
upstream:
  origin:   "git@github.com:simonlindholm/asm-processor.git"
  branch:   "main"
  commit:   "755f734fb"
git-subrepo:
  version:  "0.4.3"
  origin:   "???"
  commit:   "???"

* re-add build.py

* remove subrepo

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

subrepo:
  subdir:   "tools/asm-differ"
  merged:   "1dfba80e1"
upstream:
  origin:   "https://github.com/simonlindholm/asm-differ.git"
  branch:   "main"
  commit:   "1dfba80e1"
git-subrepo:
  version:  "0.4.3"
  origin:   "???"
  commit:   "???"
2021-08-25 01:11:41 -04:00
..
.gitignore Update asm-processor and diff.py (#278) 2021-08-25 01:11:41 -04:00
.gitrepo Update asm-processor and diff.py (#278) 2021-08-25 01:11:41 -04:00
LICENSE Update asm-processor and diff.py (#278) 2021-08-25 01:11:41 -04:00
README.md Update asm-processor and diff.py (#278) 2021-08-25 01:11:41 -04:00
diff-stylesheet.css Update asm-processor and diff.py (#278) 2021-08-25 01:11:41 -04:00
diff.py Update asm-processor and diff.py (#278) 2021-08-25 01:11:41 -04:00
diff_settings.py Update asm-processor and diff.py (#278) 2021-08-25 01:11:41 -04:00
mypy.ini Update asm-processor and diff.py (#278) 2021-08-25 01:11:41 -04:00
screenshot.png Update asm-processor and diff.py (#278) 2021-08-25 01:11:41 -04:00

README.md

asm-differ

Nice differ for assembly code (MIPS and AArch64; 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.