diff options
| author | Eli Zaretskii | 2024-10-28 09:04:41 -0400 |
|---|---|---|
| committer | Eli Zaretskii | 2024-10-28 15:44:33 +0200 |
| commit | dfb7f1942659cab4464e01f7e498efc4b269de3e (patch) | |
| tree | 6de4bcee43058058eba1c70e0858265b3589988b | |
| parent | 7aa00fa90d6eb9347034106da10cdbbdc23b3d3a (diff) | |
| download | emacs-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.c | 21 |
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. */ |
| 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 | Lisp_Object backtrace_function (union specbinding *) EXTERNALLY_VISIBLE; | ||
| 55 | union specbinding *backtrace_next (union specbinding *) EXTERNALLY_VISIBLE; | 53 | union specbinding *backtrace_next (union specbinding *) EXTERNALLY_VISIBLE; |
| 56 | union specbinding *backtrace_top (void) EXTERNALLY_VISIBLE; | 54 | union 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 | ||
| 111 | Lisp_Object | 109 | /* To work around GDB bug 32313 |
| 112 | backtrace_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 | |||
| 118 | static Lisp_Object | ||
| 119 | backtrace_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 | } |
| 124 | GDB_FUNCPTR (backtrace_function, Lisp_Object, (union specbinding *)); | ||
| 117 | 125 | ||
| 118 | static ptrdiff_t | 126 | static ptrdiff_t |
| 119 | backtrace_nargs (union specbinding *pdl) | 127 | backtrace_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 | ||
| 125 | Lisp_Object * | 133 | static Lisp_Object * |
| 126 | backtrace_args (union specbinding *pdl) | 134 | backtrace_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 | } |
| 139 | GDB_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 | ||