diff --git a/scripts/dump_syms_macos.sh b/scripts/dump_syms_macos.sh new file mode 100755 index 00000000..81a70929 --- /dev/null +++ b/scripts/dump_syms_macos.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +if [ ! $# -eq 2 ]; then + echo "usage: $0 [Cutter.app] [dst]" + exit 1 +fi + +appbundle="$1" +dst="$2" +files="$appbundle/Contents/MacOS/Cutter.bin $appbundle/Contents/Frameworks/Python.framework/Python $(find "$appbundle" -type f -name '*.dylib')" + +mkdir -p "$dst" || exit 1 + +for file in $files; do + echo "Dumping syms from $file" + dump_syms "$file" > "$dst/tmp.sym" || echo "Failed to dump syms from $file" + infoline=($(head -n1 "$dst/tmp.sym")) + id=${infoline[3]} + name=${infoline[4]} + dir="$dst/$name/$id" + mkdir -p "$dir" + mv "$dst/tmp.sym" "$dir/$name.sym" +done + +echo "Done" +