From 2b20e837389ae443e13e8aa3ae1392fcb56e2144 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=A4rkl?= Date: Mon, 4 Nov 2019 12:49:14 +0100 Subject: [PATCH] Add dump_syms_macos.sh Script for Breakpad Dumps (#1871) --- scripts/dump_syms_macos.sh | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100755 scripts/dump_syms_macos.sh 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" +