@@ -127,19 +127,24 @@ function gdbclient() {
127127 local GDB=
128128 local GDB64=
129129 local CPU_ABI=` adb shell getprop ro.product.cpu.abilist | sed s/.$//`
130+ # TODO: Derive this differently to correctly support multi-arch. We could try to parse
131+ # /proc/pid/exe. Right now, we prefer 64bit by checking those entries first.
132+ # TODO: Correctly support native bridge, which makes parsing abilist very brittle.
133+ # Note: Do NOT sort the entries alphabetically because of this. Fugu's abilist is
134+ # "x86,armeabi-v7a,armeabi", and we need to grab the "x86".
130135 # TODO: we assume these are available via $PATH
131136 if [[ $CPU_ABI =~ (^| ,)arm64 ]]; then
132137 GDB=arm-linux-androideabi-gdb
133138 GDB64=aarch64-linux-android-gdb
134- elif [[ $CPU_ABI =~ (^| ,)arm ]]; then
135- GDB=arm-linux-androideabi-gdb
136139 elif [[ $CPU_ABI =~ (^| ,)x86_64 ]]; then
137140 GDB=x86_64-linux-android-gdb
138- elif [[ $CPU_ABI =~ (^| ,)x86 ]]; then
139- GDB=x86_64-linux-android-gdb
140141 elif [[ $CPU_ABI =~ (^| ,)mips64 ]]; then
141142 GDB=mipsel-linux-android-gdb
142143 GDB64=mips64el-linux-android-gdb
144+ elif [[ $CPU_ABI =~ (^| ,)x86 ]]; then # See note above for order.
145+ GDB=x86_64-linux-android-gdb
146+ elif [[ $CPU_ABI =~ (^| ,)arm ]]; then
147+ GDB=arm-linux-androideabi-gdb
143148 elif [[ $CPU_ABI =~ (^| ,)mips ]]; then
144149 GDB=mipsel-linux-android-gdb
145150 else
0 commit comments