]> git.eshelyaron.com Git - emacs.git/commitdiff
More workarounds for GDB bug 32313
authorEli Zaretskii <eliz@gnu.org>
Mon, 28 Oct 2024 13:04:41 +0000 (09:04 -0400)
committerEshel Yaron <me@eshelyaron.com>
Tue, 29 Oct 2024 09:57:09 +0000 (10:57 +0100)
* src/eval.c (backtrace_args): Same treatment as
backtrace_function.

(cherry picked from commit b7b55dfc03c4d36ae77812c16d15142a6f6f27df)

src/eval.c

index 3c4999d818c6b3f387da65b6df62f0fb914ab3f1..d0a2abf00895eec25da33564d1cf4dd4d6cb2b26 100644 (file)
@@ -50,7 +50,6 @@ Lisp_Object Vsignaling_function;
 
 /* These would ordinarily be static, but they need to be visible to GDB.  */
 bool backtrace_p (union specbinding *) EXTERNALLY_VISIBLE;
-Lisp_Object *backtrace_args (union specbinding *) EXTERNALLY_VISIBLE;
 union specbinding *backtrace_next (union specbinding *) EXTERNALLY_VISIBLE;
 union specbinding *backtrace_top (void) EXTERNALLY_VISIBLE;
 
@@ -107,20 +106,21 @@ specpdl_arg (union specbinding *pdl)
   return pdl->unwind.arg;
 }
 
+/* To work around GDB bug 32313
+   <https://sourceware.org/bugzilla/show_bug.cgi?id=32313> make
+   backtrace_* functions visible-to-GDB pointers instead of merely
+   being an externally visible functions themselves.  Declare the
+   pointer first to pacify gcc -Wmissing-variable-declarations.  */
+#define GDB_FUNCPTR(func, resulttype, params) \
+  extern resulttype (*const func) params EXTERNALLY_VISIBLE; \
+  resulttype (*const func) params = func##_body
+
 static Lisp_Object
 backtrace_function_body (union specbinding *pdl)
 {
   eassert (pdl->kind == SPECPDL_BACKTRACE);
   return pdl->bt.function;
 }
-/* To work around GDB bug 32313
-   <https://sourceware.org/bugzilla/show_bug.cgi?id=32313>
-   make backtrace_function a visible-to-GDB pointer instead of merely
-   being an externally visible function itself.  Declare the pointer
-   first to pacify gcc -Wmissing-variable-declarations.  */
-#define GDB_FUNCPTR(func, resulttype, params) \
-  extern resulttype (*const func) params EXTERNALLY_VISIBLE; \
-  resulttype (*const func) params = func##_body
 GDB_FUNCPTR (backtrace_function, Lisp_Object, (union specbinding *));
 
 static ptrdiff_t
@@ -130,12 +130,13 @@ backtrace_nargs (union specbinding *pdl)
   return pdl->bt.nargs;
 }
 
-Lisp_Object *
-backtrace_args (union specbinding *pdl)
+static Lisp_Object *
+backtrace_args_body (union specbinding *pdl)
 {
   eassert (pdl->kind == SPECPDL_BACKTRACE);
   return pdl->bt.args;
 }
+GDB_FUNCPTR (backtrace_args, Lisp_Object *, (union specbinding *));
 
 /* Functions to modify slots of backtrace records.  */