Merge "Fix X86/MIPS gdbserver's event_getmsg_helper"
diff --git a/build/tools/prebuilt-common.sh b/build/tools/prebuilt-common.sh
index 03be0ed..de52ba6 100644
--- a/build/tools/prebuilt-common.sh
+++ b/build/tools/prebuilt-common.sh
@@ -1015,7 +1015,7 @@
         ABI_CONFIGURE_EXTRA_FLAGS="--with-arch=armv5te --disable-gold --disable-libgomp"
         ;;
     aarch64-linux-android-*)
-        ARCH="aarch64"
+        ARCH="arm64"
         ABI="aarch64-v8a"
         ABI_CONFIGURE_TARGET="aarch64-linux-android"
         # Note:
@@ -1198,9 +1198,9 @@
 find_ndk_unknown_archs()
 {
     local FOUND_ARCHS=$(find_ndk_archs)
-    # TODO: aarch64, x86_64 is here just to be found as known arch.
+    # TODO: arm64, x86_64 is here just to be found as known arch.
     # It can be removed as soon as it is added into $DEFAULT_ARCHS
-    echo "$(filter_out "$DEFAULT_ARCHS aarch64 x86_64 mips64" "$FOUND_ARCHS")"
+    echo "$(filter_out "$DEFAULT_ARCHS arm64 x86_64 mips64" "$FOUND_ARCHS")"
 }
 
 # Determine whether given arch is in unknown archs list
diff --git a/ndk-gdb.py b/ndk-gdb.py
index 5f3b35b..37a3073 100755
--- a/ndk-gdb.py
+++ b/ndk-gdb.py
@@ -215,9 +215,12 @@
                          help='Do not wait for debugger to attach (may miss early JNI breakpoints)',
                          action='store_true', dest='nowait')
 
-    stdcxx_pypr_versions = [ 'gnustdcxx'+d.replace('gcc','')
-                             for d in os.listdir(PYPRPR_GNUSTDCXX_BASE)
-                             if os.path.isdir(os.path.join(PYPRPR_GNUSTDCXX_BASE, d)) ]
+    if os.path.isdir(PYPRPR_GNUSTDCXX_BASE):
+        stdcxx_pypr_versions = [ 'gnustdcxx'+d.replace('gcc','')
+                                 for d in os.listdir(PYPRPR_GNUSTDCXX_BASE)
+                                 if os.path.isdir(os.path.join(PYPRPR_GNUSTDCXX_BASE, d)) ]
+    else:
+        stdcxx_pypr_versions = []
 
     parser.add_argument( '--stdcxx-py-pr',
                          help='Specify stdcxx python pretty-printer',