diff options
| author | Eli Zaretskii | 2024-10-28 09:04:41 -0400 |
|---|---|---|
| committer | Eli Zaretskii | 2024-10-28 09:04:41 -0400 |
| commit | b7b55dfc03c4d36ae77812c16d15142a6f6f27df (patch) | |
| tree | b361e6fe16034fb7577bac90774aee980ba726fb /src/eval.c | |
| parent | ea685170063b59855322ceffdeaaab4acaf8e388 (diff) | |
| download | emacs-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.c | 23 |
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. */ |
| 52 | bool backtrace_p (union specbinding *) EXTERNALLY_VISIBLE; | 52 | bool backtrace_p (union specbinding *) EXTERNALLY_VISIBLE; |
| 53 | Lisp_Object *backtrace_args (union specbinding *) EXTERNALLY_VISIBLE; | ||
| 54 | union specbinding *backtrace_next (union specbinding *) EXTERNALLY_VISIBLE; | 53 | union specbinding *backtrace_next (union specbinding *) EXTERNALLY_VISIBLE; |
| 55 | union specbinding *backtrace_top (void) EXTERNALLY_VISIBLE; | 54 | union 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 | |||
| 110 | static Lisp_Object | 118 | static Lisp_Object |
| 111 | backtrace_function_body (union specbinding *pdl) | 119 | backtrace_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 | ||
| 124 | GDB_FUNCPTR (backtrace_function, Lisp_Object, (union specbinding *)); | 124 | GDB_FUNCPTR (backtrace_function, Lisp_Object, (union specbinding *)); |
| 125 | 125 | ||
| 126 | static ptrdiff_t | 126 | static 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 | ||
| 133 | Lisp_Object * | 133 | static Lisp_Object * |
| 134 | backtrace_args (union specbinding *pdl) | 134 | backtrace_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 | } |
| 139 | GDB_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 | ||