crashpad_stackwalker: Check for missing minidump_stackwalk.

Error out early since the script will fail without it.

Change-Id: I2f569e91f4b29269ebc7ae9f0c1542c218c3303a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1529164
Auto-Submit: Eric Stevenson <estevenson@chromium.org>
Reviewed-by: Egor Pasko <pasko@chromium.org>
Commit-Queue: Egor Pasko <pasko@chromium.org>
Cr-Commit-Position: refs/heads/master@{#642049}
diff --git a/build/android/stacktrace/crashpad_stackwalker.py b/build/android/stacktrace/crashpad_stackwalker.py
index 94355f8..02024c9 100755
--- a/build/android/stacktrace/crashpad_stackwalker.py
+++ b/build/android/stacktrace/crashpad_stackwalker.py
@@ -127,6 +127,12 @@
       help='Directory on the device where Chrome stores cached files,'
       ' crashpad stores dumps in a subdirectory of it')
   args = parser.parse_args()
+
+  stackwalk_path = os.path.join(args.build_path, 'minidump_stackwalk')
+  if not os.path.exists(stackwalk_path):
+    logging.error('Missing minidump_stackwalk executable')
+    return 1
+
   devil_chromium.Initialize(adb_path=args.adb_path)
   device = device_utils.DeviceUtils(args.device)
 
@@ -147,10 +153,7 @@
       library_names = _ExtractLibraryNamesFromDump(args.build_path,
                                                    dump_full_path)
       symbols_dir = _CreateSymbolsDir(args.build_path, library_names)
-      stackwalk_cmd = [
-          os.path.join(args.build_path, 'minidump_stackwalk'), dump_full_path,
-          symbols_dir
-      ]
+      stackwalk_cmd = [stackwalk_path, dump_full_path, symbols_dir]
       subprocess.call(stackwalk_cmd)
     finally:
       shutil.rmtree(dump_dir, ignore_errors=True)