From 785de2abc30578a29b1b96597c2829a54168e202 Mon Sep 17 00:00:00 2001 From: Justin Hammond Date: Wed, 1 Jan 2020 18:27:40 +0800 Subject: [PATCH] add a file to get DebugInfo --- Docker/Dockerfile | 1 + tools/sentry-upload-debug.sh | 50 ++++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100755 tools/sentry-upload-debug.sh diff --git a/Docker/Dockerfile b/Docker/Dockerfile index c848423..5646fda 100644 --- a/Docker/Dockerfile +++ b/Docker/Dockerfile @@ -36,6 +36,7 @@ COPY --from=builder /usr/local/bin/* /usr/local/bin/ COPY --from=builder /usr/local/lib/libqt* /usr/local/lib/ COPY --from=builder /usr/local/lib*/libopenzwave* /usr/local/lib/ COPY --from=builder /usr/lib/*/libQt5Mqtt* /usr/local/lib/ +COPY --from=builder /opt/qt-openzwave/tools/* /usr/local/bin/ RUN mkdir -p /opt/ozw/config/crashes/ ENV LD_LIBRARY_PATH="/usr/local/lib:/usr/local/lib64:$LD_LIBRARY_PATH" ENV USBPATH="/dev/ttyUSB0" diff --git a/tools/sentry-upload-debug.sh b/tools/sentry-upload-debug.sh new file mode 100755 index 0000000..f469775 --- /dev/null +++ b/tools/sentry-upload-debug.sh @@ -0,0 +1,50 @@ +#!/bin/bash +EXECUTABLE=$1 + +if [ -z $EXECUTABLE ] +then + echo "Please Supply a Executable to process" + exit -1 +fi + +if [ -z $SENTRY_TOKEN ] +then + echo "Please Set the SENTRY_TOKEN enviroment variable" + exit -1 +fi + +function findDBGFile() { + local DBGFILE + DBGFILE=`ls /usr/lib/debug/usr/$1* 2> /dev/null` + if (( $? != 0)); then + return 1 + fi + echo $DBGFILE + return 0 +} + + + + +ldd $EXECUTABLE | awk '{print $3}' | + { + while IFS= read lib + do + if [ -f "$lib" ]; then + useable=`sentry-cli difutil check $lib | grep "Usable: yes"` + if [ ! -z "$useable" ]; then + RP=`realpath $lib` + DBGFILE=$(findDBGFile $lib) + if (( $? == 0)); then + LIBS+=" $DBGFILE" + fi + LIBS+=" $RP" + echo "Got Lib:" $RP " " $PKG " " $DBGFILE + fi + fi + + done + echo $LIBS + sentry-cli --auth-token $SENTRY_TOKEN upload-dif -o openzwave -p qt-openzwave $LIBS --wait + } +