diff options
| author | Isghj <42048411+isghj5@users.noreply.github.com> | 2025-12-05 04:06:54 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-12-05 09:06:54 -0300 |
| commit | cc4a063e0cf2073cb4b11e15928a014b070c452d (patch) | |
| tree | 93d627d66dc1a0a76d946ddb2b462c570e94c18e | |
| parent | 92be14f00e26dd4411e8a52c7ebe16c5713c3b10 (diff) | |
Fix `rename_sym.sh` tool: functions.txt/variables.txt (#1829)
* rename_sym: fixed to work with new disasm functions/variables locations
* rename_sym: re-enabled asm
| -rwxr-xr-x | tools/rename_sym.sh | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/tools/rename_sym.sh b/tools/rename_sym.sh index 9604d6291..5c8262fea 100755 --- a/tools/rename_sym.sh +++ b/tools/rename_sym.sh @@ -2,12 +2,19 @@ shopt -s globstar +FUNCTIONS_FILES="tools/disasm/**/functions.txt" +VARIABLES_FILES="tools/disasm/**/variables.txt" +ASM_FILES="extracted/**/asm/**/*s" + if [ "$#" -ne "2" ]; then echo "usage: $0 old_name new_name" exit 1 fi -#echo "Replace $1 with $2?" -#read -grep -rl "$1" asm/**/*.s src/**/*.{c,h} include/**/*.h assets/xml/* tools/disasm/functions.txt tools/disasm/variables.txt tools/sizes/*.csv | xargs sed -i "s/\b$1\b/$2/g" +echo "Replacing symbol in most files ..." +grep -rl "$1" src/**/*.{c,h} include/**/*.h assets/xml/* $FUNCTIONS_FILES $VARIABLES_FILES tools/sizes/*.csv | xargs sed -i "s/\b$1\b/$2/g" + +# so many files it overloads xargs, and takes much longer +echo "Replacing symbol in asm files ..." +grep -rl "$1" $ASM_FILES | xargs sed -i "s/\b$1\b/$2/g" |
