aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2024-10-28 09:04:41 -0400
committerEli Zaretskii2024-10-28 15:44:33 +0200
commitdfb7f1942659cab4464e01f7e498efc4b269de3e (patch)
tree6de4bcee43058058eba1c70e0858265b3589988b
parent7aa00fa90d6eb9347034106da10cdbbdc23b3d3a (diff)
downloademacs-dfb7f1942659cab4464e01f7e498efc4b269de3e.tar.gz
emacs-dfb7f1942659cab4464e01f7e498efc4b269de3e.zip
More workarounds for GDB bug 32313
* src/eval.c (backtrace_args): Same treatment as backtrace_function. cherry-picked from commit b7b55df.
-rw-r--r--src/eval.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/src/eval.c b/src/eval.c
index 874cf6d868c..d0a2abf0089 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -50,8 +50,6 @@ Lisp_Object Vsignaling_function;
50 50
51/* These would ordinarily be static, but they need to be visible to GDB. */ 51/* These would ordinarily be static, but they need to be visible to GDB. */
52bool backtrace_p (union specbinding *) EXTERNALLY_VISIBLE; 52bool backtrace_p (union specbinding *) EXTERNALLY_VISIBLE;
53Lisp_Object *backtrace_args (union specbinding *) EXTERNALLY_VISIBLE;
54Lisp_Object backtrace_function (union specbinding *) EXTERNALLY_VISIBLE;
55union specbinding *backtrace_next (union specbinding *) EXTERNALLY_VISIBLE; 53union specbinding *backtrace_next (union specbinding *) EXTERNALLY_VISIBLE;
56union specbinding *backtrace_top (void) EXTERNALLY_VISIBLE; 54union specbinding *backtrace_top (void) EXTERNALLY_VISIBLE;
57 55
@@ -108,12 +106,22 @@ specpdl_arg (union specbinding *pdl)
108 return pdl->unwind.arg; 106 return pdl->unwind.arg;
109} 107}
110 108
111Lisp_Object 109/* To work around GDB bug 32313
112backtrace_function (union specbinding *pdl) 110 <https://sourceware.org/bugzilla/show_bug.cgi?id=32313> make
111 backtrace_* functions visible-to-GDB pointers instead of merely
112 being an externally visible functions themselves. Declare the
113 pointer first to pacify gcc -Wmissing-variable-declarations. */
114#define GDB_FUNCPTR(func, resulttype, params) \
115 extern resulttype (*const func) params EXTERNALLY_VISIBLE; \
116 resulttype (*const func) params = func##_body
117
118static Lisp_Object
119backtrace_function_body (union specbinding *pdl)
113{ 120{
114 eassert (pdl->kind == SPECPDL_BACKTRACE); 121 eassert (pdl->kind == SPECPDL_BACKTRACE);
115 return pdl->bt.function; 122 return pdl->bt.function;
116} 123}
124GDB_FUNCPTR (backtrace_function, Lisp_Object, (union specbinding *));
117 125
118static ptrdiff_t 126static ptrdiff_t
119backtrace_nargs (union specbinding *pdl) 127backtrace_nargs (union specbinding *pdl)
@@ -122,12 +130,13 @@ backtrace_nargs (union specbinding *pdl)
122 return pdl->bt.nargs; 130 return pdl->bt.nargs;
123} 131}
124 132
125Lisp_Object * 133static Lisp_Object *
126backtrace_args (union specbinding *pdl) 134backtrace_args_body (union specbinding *pdl)
127{ 135{
128 eassert (pdl->kind == SPECPDL_BACKTRACE); 136 eassert (pdl->kind == SPECPDL_BACKTRACE);
129 return pdl->bt.args; 137 return pdl->bt.args;
130} 138}
139GDB_FUNCPTR (backtrace_args, Lisp_Object *, (union specbinding *));
131 140
132/* Functions to modify slots of backtrace records. */ 141/* Functions to modify slots of backtrace records. */
133 142