2020-06-07 14:37:48 +00:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
|
|
|
|
import argparse
|
2023-08-01 02:30:26 +00:00
|
|
|
from pathlib import Path
|
2020-06-07 14:37:48 +00:00
|
|
|
|
2023-08-01 02:30:26 +00:00
|
|
|
try:
|
|
|
|
import mapfile_parser
|
|
|
|
except ImportError:
|
|
|
|
print("Missing dependency mapfile_parser, install it with `python3 -m pip install 'mapfile-parser>=1.2.1,<2.0.0'`")
|
2020-06-07 14:37:48 +00:00
|
|
|
exit(1)
|
|
|
|
|
|
|
|
|
2023-08-01 02:30:26 +00:00
|
|
|
def symInfoMain():
|
|
|
|
parser = argparse.ArgumentParser(description="Display various information about a symbol or address.")
|
|
|
|
parser.add_argument("symname", help="symbol name or VROM/VRAM address to lookup")
|
|
|
|
parser.add_argument("-e", "--expected", dest="use_expected", action="store_true", help="use the map file in expected/build/ instead of build/")
|
2020-06-07 14:37:48 +00:00
|
|
|
|
2023-08-01 02:30:26 +00:00
|
|
|
args = parser.parse_args()
|
2020-06-07 14:37:48 +00:00
|
|
|
|
2023-08-01 02:30:26 +00:00
|
|
|
BUILTMAP = Path(f"build") / f"z64.map"
|
2020-06-07 14:37:48 +00:00
|
|
|
|
2023-08-01 02:30:26 +00:00
|
|
|
mapPath = BUILTMAP
|
|
|
|
if args.use_expected:
|
|
|
|
mapPath = "expected" / BUILTMAP
|
2020-06-07 14:37:48 +00:00
|
|
|
|
2023-08-01 02:30:26 +00:00
|
|
|
mapfile_parser.frontends.sym_info.doSymInfo(mapPath, args.symname)
|
2020-06-13 01:56:17 +00:00
|
|
|
|
2023-08-01 02:30:26 +00:00
|
|
|
if __name__ == "__main__":
|
|
|
|
symInfoMain()
|