aboutsummaryrefslogtreecommitdiffstats
path: root/src/eval.c
diff options
context:
space:
mode:
authorEli Zaretskii2024-10-28 09:04:41 -0400
committerEli Zaretskii2024-10-28 09:04:41 -0400
commitb7b55dfc03c4d36ae77812c16d15142a6f6f27df (patch)
treeb361e6fe16034fb7577bac90774aee980ba726fb /src/eval.c
parentea685170063b59855322ceffdeaaab4acaf8e388 (diff)
downloademacs-b7b55dfc03c4d36ae77812c16d15142a6f6f27df.tar.gz
emacs-b7b55dfc03c4d36ae77812c16d15142a6f6f27df.zip
More workarounds for GDB bug 32313
* src/eval.c (backtrace_args): Same treatment as backtrace_function.
Diffstat (limited to 'src/eval.c')
-rw-r--r--src/eval.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/src/eval.c b/src/eval.c
index 3c4999d818c..d0a2abf0089 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -50,7 +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;
54union specbinding *backtrace_next (union specbinding *) EXTERNALLY_VISIBLE; 53union specbinding *backtrace_next (union specbinding *) EXTERNALLY_VISIBLE;
55union specbinding *backtrace_top (void) EXTERNALLY_VISIBLE; 54union specbinding *backtrace_top (void) EXTERNALLY_VISIBLE;
56 55
@@ -107,20 +106,21 @@ specpdl_arg (union specbinding *pdl)
107 return pdl->unwind.arg; 106 return pdl->unwind.arg;
108} 107}
109 108
109/* To work around GDB bug 32313
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
110static Lisp_Object 118static Lisp_Object
111backtrace_function_body (union specbinding *pdl) 119backtrace_function_body (union specbinding *pdl)
112{ 120{
113 eassert (pdl->kind == SPECPDL_BACKTRACE); 121 eassert (pdl->kind == SPECPDL_BACKTRACE);
114 return pdl->bt.function; 122 return pdl->bt.function;
115} 123}
116/* To work around GDB bug 32313
117 <https://sourceware.org/bugzilla/show_bug.cgi?id=32313>
118 make backtrace_function a visible-to-GDB pointer instead of merely
119 being an externally visible function itself. Declare the pointer
120 first to pacify gcc -Wmissing-variable-declarations. */
121#define GDB_FUNCPTR(func, resulttype, params) \
122 extern resulttype (*const func) params EXTERNALLY_VISIBLE; \
123 resulttype (*const func) params = func##_body
124GDB_FUNCPTR (backtrace_function, Lisp_Object, (union specbinding *)); 124GDB_FUNCPTR (backtrace_function, Lisp_Object, (union specbinding *));
125 125
126static ptrdiff_t 126static ptrdiff_t
@@ -130,12 +130,13 @@ backtrace_nargs (union specbinding *pdl)
130 return pdl->bt.nargs; 130 return pdl->bt.nargs;
131} 131}
132 132
133Lisp_Object * 133static Lisp_Object *
134backtrace_args (union specbinding *pdl) 134backtrace_args_body (union specbinding *pdl)
135{ 135{
136 eassert (pdl->kind == SPECPDL_BACKTRACE); 136 eassert (pdl->kind == SPECPDL_BACKTRACE);
137 return pdl->bt.args; 137 return pdl->bt.args;
138} 138}
139GDB_FUNCPTR (backtrace_args, Lisp_Object *, (union specbinding *));
139 140
140/* Functions to modify slots of backtrace records. */ 141/* Functions to modify slots of backtrace records. */
141 142