[Lldb-commits] [lldb] [lldb][windows] print stop reason if MSVC's runtime check fails (PR #185473)

Charles Zablit via lldb-commits lldb-commits at lists.llvm.org
Wed Mar 11 05:23:08 PDT 2026


================
@@ -79,6 +81,49 @@ std::string GetProcessExecutableName(DWORD pid) {
   }
   return file_name;
 }
+
+std::optional<std::string> GetMSVCRTCFailureDescription(Thread &thread) {
+  const uint32_t kMaxFrames = 8;
+
+  for (uint32_t i = 0; i < kMaxFrames; ++i) {
+    StackFrameSP frame = thread.GetStackFrameAtIndex(i);
+    if (!frame)
+      break;
+
+    SymbolContext sc = frame->GetSymbolContext(eSymbolContextSymbol);
+    if (!sc.symbol)
+      continue;
+
+    const char *fn_name = frame->GetFunctionName();
+    if (!fn_name)
+      continue;
+    llvm::StringRef name(fn_name);
+
+    if (!name.contains("failwithmessage"))
----------------
charles-zablit wrote:

Made the test stricter 👍 
The frame recognizer checks for the `0x80000003` code and checks that it's frame `#0` as well.

https://github.com/llvm/llvm-project/pull/185473


More information about the lldb-commits mailing list