[Lldb-commits] [lldb] [lldb][Process/FreeBSDKernel] Show crash info on start (PR #178027)

Michael Buch via lldb-commits lldb-commits at lists.llvm.org
Thu Feb 12 06:55:28 PST 2026


================
@@ -277,6 +286,143 @@ lldb::addr_t ProcessFreeBSDKernel::FindSymbol(const char *name) {
   return sym ? sym->GetLoadAddress(&GetTarget()) : LLDB_INVALID_ADDRESS;
 }
 
+void ProcessFreeBSDKernel::ShowCrashInfo() {
+  Target &target = GetTarget();
+  Debugger &debugger = target.GetDebugger();
+
+  if (!debugger.GetCommandInterpreter().IsInteractive())
+    return;
+
+  Status error;
+
+  // Find msgbufp symbol (pointer to message buffer)
+  lldb::addr_t msgbufp_addr = FindSymbol("msgbufp");
+  if (msgbufp_addr == LLDB_INVALID_ADDRESS)
+    return;
+
+  // Read the pointer value
+  lldb::addr_t msgbufp = ReadPointerFromMemory(msgbufp_addr, error);
+  if (!error.Success() || msgbufp == LLDB_INVALID_ADDRESS)
+    return;
+
+  // Get the type information for struct msgbuf from DWARF
+  TypeQuery query("msgbuf");
----------------
Michael137 wrote:

Latest revision includes a check for whether the expected fields were present. That makes it easier to adjust backwards-compatibly if the layout ever changes. I don't have anything else to add here so I'll leave the rest of the review up to FreeBSD/kgdb experts

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


More information about the lldb-commits mailing list