Try fixing analyze_calls

This commit is contained in:
sozud 2024-10-02 21:23:07 -07:00
parent 98b784a592
commit 3ac5786db0
2 changed files with 9 additions and 3 deletions

View File

@ -189,7 +189,8 @@ jobs:
run: |
make force_symbols
make force_extract
.venv/bin/python3 tools/analyze_calls.py
rm -rf gh-duplicates/function_calls/ || true
.venv/bin/python3 tools/analyze_calls.py --output_dir=gh-duplicates/function_calls
git clean -fdx asm/
- name: Generate duplicates report
run: |
@ -204,8 +205,6 @@ jobs:
rm -rf build/us/weapon.ld
make -j extract
.venv/bin/python3 tools/function_finder/function_finder_psx.py --use-call-trees > gh-duplicates/functions.md
rm -rf gh-duplicates/function_calls/ || true
mv function_calls gh-duplicates/
mv function_graphs.md gh-duplicates
- name: Commit all reports
run: |

View File

@ -32,6 +32,11 @@ parser.add_argument(
action="store_true",
help="Perform a dry run. Calculate call hierarchy, but skip generating SVGs",
)
parser.add_argument(
"--output_dir",
action="store_true",
help="Output directory",
)
output_dir = "function_calls"
# All functions I've found that are used in a 'jalr' instruction in the game
callable_registers = ["$v0", "$v1", "$a0", "$a1", "$t2"]
@ -460,6 +465,8 @@ if __name__ == "__main__":
analyze(function)
print(f"Calculated call relations in {time.perf_counter() - timer} seconds")
args = parser.parse_args()
if args.output_dir:
output_dir = args.output_dir
if not args.ultradry:
print(f"Rendering in {'dry' if args.dry else 'full output'} mode")