[libunwind] [libunwind][Haiku] Improve support (PR #115462)

via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 8 03:15:55 PST 2024


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff d74127e78aa7f8ab07b0926d25920444dde6c73c faa99ee1a06a8139995bba31e6d783df164fb45d --extensions hpp -- libunwind/src/UnwindCursor.hpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/libunwind/src/UnwindCursor.hpp b/libunwind/src/UnwindCursor.hpp
index 0019c1e62a..371f8dd647 100644
--- a/libunwind/src/UnwindCursor.hpp
+++ b/libunwind/src/UnwindCursor.hpp
@@ -1316,7 +1316,7 @@ private:
   unw_proc_info_t  _info;
   bool             _unwindInfoMissing;
   bool             _isSignalFrame;
-#if defined(_LIBUNWIND_CHECK_LINUX_SIGRETURN) || \
+#if defined(_LIBUNWIND_CHECK_LINUX_SIGRETURN) ||                               \
     (defined(_LIBUNWIND_TARGET_HAIKU) && defined(_LIBUNWIND_TARGET_X86_64))
   bool             _isSigReturn = false;
 #endif
@@ -2553,7 +2553,7 @@ int UnwindCursor<A, R>::stepWithTBTable(pint_t pc, tbtable *TBTable,
 
 template <typename A, typename R>
 void UnwindCursor<A, R>::setInfoBasedOnIPRegister(bool isReturnAddress) {
-#if defined(_LIBUNWIND_CHECK_LINUX_SIGRETURN) || \
+#if defined(_LIBUNWIND_CHECK_LINUX_SIGRETURN) ||                               \
     (defined(_LIBUNWIND_TARGET_HAIKU) && defined(_LIBUNWIND_TARGET_X86_64))
   _isSigReturn = false;
 #endif
@@ -2678,7 +2678,7 @@ void UnwindCursor<A, R>::setInfoBasedOnIPRegister(bool isReturnAddress) {
   }
 #endif // #if defined(_LIBUNWIND_SUPPORT_DWARF_UNWIND)
 
-#if defined(_LIBUNWIND_CHECK_LINUX_SIGRETURN) || \
+#if defined(_LIBUNWIND_CHECK_LINUX_SIGRETURN) ||                               \
     (defined(_LIBUNWIND_TARGET_HAIKU) && defined(_LIBUNWIND_TARGET_X86_64))
   if (setInfoForSigReturn())
     return;
@@ -2767,8 +2767,9 @@ extern void *__gCommPageAddress;
 template <typename A, typename R>
 bool UnwindCursor<A, R>::setInfoForSigReturn() {
 #if defined(_LIBUNWIND_TARGET_X86_64)
-  addr_t signal_handler = (((addr_t*)__gCommPageAddress)[COMMPAGE_ENTRY_X86_SIGNAL_HANDLER]
-                                                              + (addr_t)__gCommPageAddress);
+  addr_t signal_handler =
+      (((addr_t *)__gCommPageAddress)[COMMPAGE_ENTRY_X86_SIGNAL_HANDLER] +
+       (addr_t)__gCommPageAddress);
   addr_t signal_handler_ret = signal_handler + 45;
 #endif
   pint_t pc = static_cast<pint_t>(this->getReg(UNW_REG_IP));
@@ -2787,7 +2788,7 @@ int UnwindCursor<A, R>::stepThroughSigReturn() {
   _isSignalFrame = true;
   pint_t sp = _registers.getSP();
 #if defined(_LIBUNWIND_TARGET_X86_64)
-  vregs *regs = (vregs*)(sp + 0x70);
+  vregs *regs = (vregs *)(sp + 0x70);
 
   _registers.setRegister(UNW_REG_IP, regs->rip);
   _registers.setRegister(UNW_REG_SP, regs->rsp);
@@ -2798,8 +2799,8 @@ int UnwindCursor<A, R>::stepThroughSigReturn() {
   _registers.setRegister(UNW_X86_64_RSI, regs->rsi);
   _registers.setRegister(UNW_X86_64_RDI, regs->rdi);
   _registers.setRegister(UNW_X86_64_RBP, regs->rbp);
-  _registers.setRegister(UNW_X86_64_R8,  regs->r8);
-  _registers.setRegister(UNW_X86_64_R9,  regs->r9);
+  _registers.setRegister(UNW_X86_64_R8, regs->r8);
+  _registers.setRegister(UNW_X86_64_R9, regs->r9);
   _registers.setRegister(UNW_X86_64_R10, regs->r10);
   _registers.setRegister(UNW_X86_64_R11, regs->r11);
   _registers.setRegister(UNW_X86_64_R12, regs->r12);
@@ -2979,7 +2980,7 @@ template <typename A, typename R> int UnwindCursor<A, R>::step(bool stage2) {
 
   // Use unwinding info to modify register set as if function returned.
   int result;
-#if defined(_LIBUNWIND_CHECK_LINUX_SIGRETURN) || \
+#if defined(_LIBUNWIND_CHECK_LINUX_SIGRETURN) ||                               \
     (defined(_LIBUNWIND_TARGET_HAIKU) && defined(_LIBUNWIND_TARGET_X86_64))
   if (_isSigReturn) {
     result = this->stepThroughSigReturn();

``````````

</details>


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


More information about the cfe-commits mailing list