aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/eval.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/eval.c b/src/eval.c
index 874cf6d868c..3c4999d818c 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -51,7 +51,6 @@ Lisp_Object Vsignaling_function;
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; 53Lisp_Object *backtrace_args (union specbinding *) EXTERNALLY_VISIBLE;
54Lisp_Object backtrace_function (union specbinding *) EXTERNALLY_VISIBLE;
55union specbinding *backtrace_next (union specbinding *) EXTERNALLY_VISIBLE; 54union specbinding *backtrace_next (union specbinding *) EXTERNALLY_VISIBLE;
56union specbinding *backtrace_top (void) EXTERNALLY_VISIBLE; 55union specbinding *backtrace_top (void) EXTERNALLY_VISIBLE;
57 56
@@ -108,12 +107,21 @@ specpdl_arg (union specbinding *pdl)
108 return pdl->unwind.arg; 107 return pdl->unwind.arg;
109} 108}
110 109
111Lisp_Object 110static Lisp_Object
112backtrace_function (union specbinding *pdl) 111backtrace_function_body (union specbinding *pdl)
113{ 112{
114 eassert (pdl->kind == SPECPDL_BACKTRACE); 113 eassert (pdl->kind == SPECPDL_BACKTRACE);
115 return pdl->bt.function; 114 return pdl->bt.function;
116} 115}
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 *));
117 125
118static ptrdiff_t 126static ptrdiff_t
119backtrace_nargs (union specbinding *pdl) 127backtrace_nargs (union specbinding *pdl)