Skip to content

Commit a24e5ce

Browse files
[gdb] resolve symbolic link
This is better to have a nicer 'Reading symbols from...' message in GDB
1 parent d7e6ac3 commit a24e5ce

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

gdb/linuxdeploy-plugin-gdb.sh

100644100755
+6-6
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,15 @@ echo "Copying source files"
5858
cp --recursive $verbose "$LINUXDEPLOY_PLUGIN_GDB_SRC" "$appdir/usr/"
5959

6060
echo "Installing new AppRun wrapper"
61-
mv $verbose "$appdir/AppRun.wrapped" "$appdir/AppRun.wrapped.real"
62-
cat > "$appdir/AppRun.wrapped" <<\EOF
61+
exe="$(readlink -f "$appdir/AppRun.wrapped")"
62+
rm $verbose "$appdir/AppRun.wrapped"
63+
cat > "$appdir/AppRun.wrapped" <<EOF
6364
#! /bin/bash
6465
65-
if [[ -n "$APPIMAGE_USE_GDB" ]]; then
66-
gdb --cd "$APPDIR/usr/@SRCDIR@" --args "$APPDIR/AppRun.wrapped.real" "$@"
66+
if [[ -n "\$APPIMAGE_USE_GDB" ]]; then
67+
gdb --cd "\$APPDIR/usr/$(basename "$LINUXDEPLOY_PLUGIN_GDB_SRC")" --args "\$APPDIR/${exe#$appdir}" "\$@"
6768
else
68-
exec "$APPDIR/AppRun.wrapped.real" "$@"
69+
exec "\$APPDIR/${exe#$appdir}" "\$@"
6970
fi
7071
EOF
71-
sed -i "s|@SRCDIR@|$(basename "$LINUXDEPLOY_PLUGIN_GDB_SRC")|" "$appdir/AppRun.wrapped"
7272
chmod $verbose 755 "$appdir/AppRun.wrapped"

0 commit comments

Comments
 (0)