.gdbinit.
* src/data.c (pure_write_error): Add `object' argument.
* src/puresize.h (CHECK_IMPURE): Use it.
* src/keyboard.c (safe_run_hooks_error): Improve error message.
+2013-06-03 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * eval.c (backtrace_p, backtrace_top, backtrace_next): Export them to
+ .gdbinit.
+
+ * keyboard.c (safe_run_hooks_error): Improve error message.
+
+ * data.c (pure_write_error): Add `object' argument.
+ * puresize.h (CHECK_IMPURE): Use it.
+
2013-06-03 Michael Albinus <michael.albinus@gmx.de>
* Makefile.in (NOTIFY_OBJ): New variable.
}
void
-pure_write_error (void)
+pure_write_error (Lisp_Object obj)
{
- error ("Attempt to modify read-only object");
+ Fsignal (Qerror, Fcons (build_string ("Attempt to modify read-only object"),
+ Fcons (obj, Qnil)));
}
void
/* Helper functions to scan the backtrace. */
-LISP_INLINE bool backtrace_p (struct specbinding *pdl)
+EXTERN_INLINE bool backtrace_p (struct specbinding *pdl)
{ return pdl >= specpdl; }
-LISP_INLINE struct specbinding *backtrace_top (void)
+
+EXTERN_INLINE struct specbinding *backtrace_top (void)
{
struct specbinding *pdl = specpdl_ptr - 1;
- while (backtrace_p (pdl) && pdl->kind != SPECPDL_BACKTRACE) \
+ while (backtrace_p (pdl) && pdl->kind != SPECPDL_BACKTRACE)
pdl--;
return pdl;
}
-LISP_INLINE struct specbinding *backtrace_next (struct specbinding *pdl)
+
+EXTERN_INLINE struct specbinding *backtrace_next (struct specbinding *pdl)
{
pdl--;
while (backtrace_p (pdl) && pdl->kind != SPECPDL_BACKTRACE)
= CONSP (Vinhibit_quit) ? XCAR (Vinhibit_quit) : Vinhibit_quit;
Lisp_Object fun = CONSP (Vinhibit_quit) ? XCDR (Vinhibit_quit) : Qnil;
Lisp_Object args[4];
- args[0] = build_string ("Error in %s (%s): %S");
+ args[0] = build_string ("Error in %s (%S): %S");
args[1] = hook;
args[2] = fun;
args[3] = error_data;
/* Signal an error if OBJ is pure. */
#define CHECK_IMPURE(obj) \
{ if (PURE_P (obj)) \
- pure_write_error (); }
+ pure_write_error (obj); }
-extern _Noreturn void pure_write_error (void);
+extern _Noreturn void pure_write_error (Lisp_Object);
\f
/* Define PURE_P. */