Fix gdb on archlinux based distros

Something is VERY VERY broken with this gdb. Don't care, let's use our precompiled GDB (from binary mode) in the mean time!
This commit is contained in:
TotallyNotElite 2021-02-11 21:36:21 +01:00 committed by TotallyNotElite
parent 8f33d775c6
commit 7bdb0d3577
4 changed files with 20 additions and 3 deletions

7
attach
View File

@ -35,7 +35,12 @@ cp "bin/libcathook.so" "$FILENAME"
echo loading "$FILENAME" to "$proc"
gdb -n -q -batch \
gdbbin="gdb"
if [ -x "./bin/gdb-arch-2021-02" ]; then
gdbbin="./bin/gdb-arch-2021-02"
fi
$gdbbin -n -q -batch \
-ex "attach $proc" \
-ex "echo \033[1mCalling dlopen\033[0m\n" \
-ex "call ((void*(*)(const char*, int))dlopen)(\"$FILENAME\", 1)" \

View File

@ -35,7 +35,12 @@ cp "bin/libcathook.so" "$FILENAME"
echo loading "$FILENAME" to "$proc"
gdb -n -q -batch \
gdbbin="gdb"
if [ -x "./bin/gdb-arch-2021-02" ]; then
gdbbin="./bin/gdb-arch-2021-02"
fi
$gdbbin -n -q -batch \
-ex "attach $proc" \
-ex "echo \033[1mCalling dlopen\033[0m\n" \
-ex "call ((void*(*)(const char*, int))dlopen)(\"$FILENAME\", 1)" \

View File

@ -44,7 +44,12 @@ sudo cp "bin/libcathook.so" "/lib/i386-linux-gnu/${FILENAME}"
echo loading "$FILENAME" to "$proc"
gdb -n -q -batch \
gdbbin="gdb"
if [ -x "./bin/gdb-arch-2021-02" ]; then
gdbbin="./bin/gdb-arch-2021-02"
fi
$gdbbin -n -q -batch \
-ex "attach $proc" \
-ex "echo \033[1mCalling dlopen\033[0m\n" \
-ex "call ((void*(*)(const char*, int))dlopen)(\"/lib/i386-linux-gnu/$FILENAME\", 1)" \

View File

@ -97,6 +97,8 @@ case "$OS" in
requestPermissions "${arch_packages[@]}"
$SUDO pacman -S --noconfirm --needed "${arch_packages[@]}"
fi
# Arch's shipped GDB is broken at this time
curl -C - -o ./bin/gdb-arch-2021-02 https://nullworks.gitlab.io/cathook/cathook/gdb && chmod +x ./bin/gdb-arch-2021-02 || true
;;
"ubuntu")
dpkg -s "${ubuntu_packages[@]}" > /dev/null 2>&1