Generating __debugbreak() for TRAP_SEQUENCE1_ on Windows ARM64

The instruction 'BRK #F000' does trap on Windows ARM64 which is different from
other ARM64 platforms. Calling __debugbreak() which will produce the right
encoding and always supported by MSVC and clang.

Bug: 893460
Change-Id: I54e2d8de6ae7d9ba5929dc8e382e18a99d5aaeb4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1879677
Reviewed-by: Daniel Cheng <[email protected]>
Reviewed-by: Bruce Dawson <[email protected]>
Commit-Queue: Tom Tan <[email protected]>
Cr-Commit-Position: refs/heads/master@{#710700}
diff --git a/base/immediate_crash.h b/base/immediate_crash.h
index 94158fe..733110a7 100644
--- a/base/immediate_crash.h
+++ b/base/immediate_crash.h
@@ -99,7 +99,9 @@
 
 #elif defined(ARCH_CPU_ARM64)
 
-#define TRAP_SEQUENCE1_() __asm volatile("brk #0\n")
+// Windows ARM64 uses "BRK #F000" as its breakpoint instruction, and
+// __debugbreak() generates that in both VC++ and clang.
+#define TRAP_SEQUENCE1_() __debugbreak()
 // Intentionally empty: __builtin_unreachable() is always part of the sequence
 // (see IMMEDIATE_CRASH below) and already emits a ud2 on Win64,
 // https://crbug.com/958373