[Lldb-commits] [lldb] [LLDB][MIPS] Fix signal SIGBUS number mismatch error on mips target (PR #132688)

via lldb-commits lldb-commits at lists.llvm.org
Mon Mar 31 23:58:00 PDT 2025


https://github.com/yingopq updated https://github.com/llvm/llvm-project/pull/132688

>From 61901c7cd6aa2b53169eae92ef55848589a8c276 Mon Sep 17 00:00:00 2001
From: Ying Huang <ying.huang at oss.cipunited.com>
Date: Mon, 24 Mar 2025 03:44:41 -0400
Subject: [PATCH] [LLDB][MIPS] Fix signal SIGBUS number mismatch error on mips
 target

Now, because we do not support mips debugging, if we compile LLVM
on mips target, would report error `static assertion failed:Value
mismatch for signal number SIGBUS`, so add this condition to avoid
error.
---
 lldb/source/Plugins/Process/Utility/LinuxSignals.cpp | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/lldb/source/Plugins/Process/Utility/LinuxSignals.cpp b/lldb/source/Plugins/Process/Utility/LinuxSignals.cpp
index eaecc84df15d4..9c4fe55147a28 100644
--- a/lldb/source/Plugins/Process/Utility/LinuxSignals.cpp
+++ b/lldb/source/Plugins/Process/Utility/LinuxSignals.cpp
@@ -8,7 +8,11 @@
 
 #include "LinuxSignals.h"
 
-#ifdef __linux__
+// mips-linux debugging is not supported and mips uses different numbers for
+// some signals (e.g. SIGBUS) on linux, so we skip the static checks below. The
+// definitions here can be used for debugging non-mips targets on a mips-hosted
+// lldb.
+#if defined(__linux__) && !defined(__mips__)
 #include <csignal>
 
 #ifndef SEGV_BNDERR
@@ -33,7 +37,7 @@
 #else
 #define ADD_SIGCODE(signal_name, signal_value, code_name, code_value, ...)     \
   AddSignalCode(signal_value, code_value, __VA_ARGS__)
-#endif /* ifdef __linux__ */
+#endif /* if defined(__linux__) && !defined(__mips__) */
 
 using namespace lldb_private;
 



More information about the lldb-commits mailing list