From 34f01bf8f7404ef0e0473fd5925b5902da9463ad Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 15 Jun 2019 19:28:51 +0300 Subject: [PATCH] Improve error message when dmpstruct.h needs to be updated * src/pdumper.c (dump_cons, dump_interval_tree, dump_string) (dump_marker, dump_overlay, dump_finalizer) (dump_bignum, dump_float, dump_fwd_int, dump_fwd_bool) (dump_fwd_obj, dump_fwd_buffer_obj, dump_fwd_kboard_obj) (dump_fwd, dump_blv, dump_symbol, dump_vectorlike_generic) (dump_hash_table, dump_buffer, dump_bool_vector, dump_subr) (dump_vectorlike, dump_object, dump_charset) [CHECK_STRUCTS]: Make the error message more specific where to find the comment to CHECK_STRUCTS. --- src/pdumper.c | 50 +++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/src/pdumper.c b/src/pdumper.c index 28045d1959e..9121a632236 100644 --- a/src/pdumper.c +++ b/src/pdumper.c @@ -2031,7 +2031,7 @@ static dump_off dump_cons (struct dump_context *ctx, const struct Lisp_Cons *cons) { #if CHECK_STRUCTS && !defined (HASH_Lisp_Cons_00EEE63F67) -# error "Lisp_Cons changed. See CHECK_STRUCTS comment." +# error "Lisp_Cons changed. See CHECK_STRUCTS comment in config.h." #endif struct Lisp_Cons out; dump_object_start (ctx, &out, sizeof (out)); @@ -2046,7 +2046,7 @@ dump_interval_tree (struct dump_context *ctx, dump_off parent_offset) { #if CHECK_STRUCTS && !defined (HASH_interval_1B38941C37) -# error "interval changed. See CHECK_STRUCTS comment." +# error "interval changed. See CHECK_STRUCTS comment in config.h." #endif /* TODO: output tree breadth-first? */ struct interval out; @@ -2090,7 +2090,7 @@ static dump_off dump_string (struct dump_context *ctx, const struct Lisp_String *string) { #if CHECK_STRUCTS && !defined (HASH_Lisp_String_86FEA6EC7C) -# error "Lisp_String changed. See CHECK_STRUCTS comment." +# error "Lisp_String changed. See CHECK_STRUCTS comment in config.h." #endif /* If we have text properties, write them _after_ the string so that at runtime, the prefetcher and cache will DTRT. (We access the @@ -2136,7 +2136,7 @@ static dump_off dump_marker (struct dump_context *ctx, const struct Lisp_Marker *marker) { #if CHECK_STRUCTS && !defined (HASH_Lisp_Marker_642DBAF866) -# error "Lisp_Marker changed. See CHECK_STRUCTS comment." +# error "Lisp_Marker changed. See CHECK_STRUCTS comment in config.h." #endif START_DUMP_PVEC (ctx, &marker->header, struct Lisp_Marker, out); @@ -2159,7 +2159,7 @@ static dump_off dump_overlay (struct dump_context *ctx, const struct Lisp_Overlay *overlay) { #if CHECK_STRUCTS && !defined (HASH_Lisp_Overlay_72EADA9882) -# error "Lisp_Overlay changed. See CHECK_STRUCTS comment." +# error "Lisp_Overlay changed. See CHECK_STRUCTS comment in config.h." #endif START_DUMP_PVEC (ctx, &overlay->header, struct Lisp_Overlay, out); dump_pseudovector_lisp_fields (ctx, &out->header, &overlay->header); @@ -2187,7 +2187,7 @@ dump_finalizer (struct dump_context *ctx, const struct Lisp_Finalizer *finalizer) { #if CHECK_STRUCTS && !defined (HASH_Lisp_Finalizer_D58E647CB8) -# error "Lisp_Finalizer changed. See CHECK_STRUCTS comment." +# error "Lisp_Finalizer changed. See CHECK_STRUCTS comment in config.h." #endif START_DUMP_PVEC (ctx, &finalizer->header, struct Lisp_Finalizer, out); /* Do _not_ call dump_pseudovector_lisp_fields here: we dump the @@ -2209,7 +2209,7 @@ static dump_off dump_bignum (struct dump_context *ctx, Lisp_Object object) { #if CHECK_STRUCTS && !defined (HASH_Lisp_Bignum_661945DE2B) -# error "Lisp_Bignum changed. See CHECK_STRUCTS comment." +# error "Lisp_Bignum changed. See CHECK_STRUCTS comment in config.h." #endif const struct Lisp_Bignum *bignum = XBIGNUM (object); START_DUMP_PVEC (ctx, &bignum->header, struct Lisp_Bignum, out); @@ -2247,7 +2247,7 @@ static dump_off dump_float (struct dump_context *ctx, const struct Lisp_Float *lfloat) { #if CHECK_STRUCTS && !defined (HASH_Lisp_Float_50A7B216D9) -# error "Lisp_Float changed. See CHECK_STRUCTS comment." +# error "Lisp_Float changed. See CHECK_STRUCTS comment in config.h." #endif eassert (ctx->header.cold_start); struct Lisp_Float out; @@ -2260,7 +2260,7 @@ static dump_off dump_fwd_int (struct dump_context *ctx, const struct Lisp_Intfwd *intfwd) { #if CHECK_STRUCTS && !defined HASH_Lisp_Intfwd_4D887A7387 -# error "Lisp_Intfwd changed. See CHECK_STRUCTS comment." +# error "Lisp_Intfwd changed. See CHECK_STRUCTS comment in config.h." #endif dump_emacs_reloc_immediate_intmax_t (ctx, intfwd->intvar, *intfwd->intvar); struct Lisp_Intfwd out; @@ -2274,7 +2274,7 @@ static dump_off dump_fwd_bool (struct dump_context *ctx, const struct Lisp_Boolfwd *boolfwd) { #if CHECK_STRUCTS && !defined (HASH_Lisp_Boolfwd_0EA1C7ADCC) -# error "Lisp_Boolfwd changed. See CHECK_STRUCTS comment." +# error "Lisp_Boolfwd changed. See CHECK_STRUCTS comment in config.h." #endif dump_emacs_reloc_immediate_bool (ctx, boolfwd->boolvar, *boolfwd->boolvar); struct Lisp_Boolfwd out; @@ -2288,7 +2288,7 @@ static dump_off dump_fwd_obj (struct dump_context *ctx, const struct Lisp_Objfwd *objfwd) { #if CHECK_STRUCTS && !defined (HASH_Lisp_Objfwd_45D3E513DC) -# error "Lisp_Objfwd changed. See CHECK_STRUCTS comment." +# error "Lisp_Objfwd changed. See CHECK_STRUCTS comment in config.h." #endif if (NILP (Fgethash (dump_off_to_lisp (emacs_offset (objfwd->objvar)), ctx->staticpro_table, @@ -2306,7 +2306,7 @@ dump_fwd_buffer_obj (struct dump_context *ctx, const struct Lisp_Buffer_Objfwd *buffer_objfwd) { #if CHECK_STRUCTS && !defined (HASH_Lisp_Buffer_Objfwd_13CA6B04FC) -# error "Lisp_Buffer_Objfwd changed. See CHECK_STRUCTS comment." +# error "Lisp_Buffer_Objfwd changed. See CHECK_STRUCTS comment in config.h." #endif struct Lisp_Buffer_Objfwd out; dump_object_start (ctx, &out, sizeof (out)); @@ -2322,7 +2322,7 @@ dump_fwd_kboard_obj (struct dump_context *ctx, const struct Lisp_Kboard_Objfwd *kboard_objfwd) { #if CHECK_STRUCTS && !defined (HASH_Lisp_Kboard_Objfwd_CAA7E71069) -# error "Lisp_Intfwd changed. See CHECK_STRUCTS comment." +# error "Lisp_Intfwd changed. See CHECK_STRUCTS comment in config.h." #endif struct Lisp_Kboard_Objfwd out; dump_object_start (ctx, &out, sizeof (out)); @@ -2335,7 +2335,7 @@ static dump_off dump_fwd (struct dump_context *ctx, lispfwd fwd) { #if CHECK_STRUCTS && !defined (HASH_Lisp_Fwd_Type_9CBA6EE55E) -# error "Lisp_Fwd_Type changed. See CHECK_STRUCTS comment." +# error "Lisp_Fwd_Type changed. See CHECK_STRUCTS comment in config.h." #endif void const *p = fwd.fwdptr; dump_off offset; @@ -2369,7 +2369,7 @@ dump_blv (struct dump_context *ctx, const struct Lisp_Buffer_Local_Value *blv) { #if CHECK_STRUCTS && !defined HASH_Lisp_Buffer_Local_Value_3C363FAC3C -# error "Lisp_Buffer_Local_Value changed. See CHECK_STRUCTS comment." +# error "Lisp_Buffer_Local_Value changed. See CHECK_STRUCTS comment in config.h." #endif struct Lisp_Buffer_Local_Value out; dump_object_start (ctx, &out, sizeof (out)); @@ -2434,10 +2434,10 @@ dump_symbol (struct dump_context *ctx, dump_off offset) { #if CHECK_STRUCTS && !defined HASH_Lisp_Symbol_999DC26DEC -# error "Lisp_Symbol changed. See CHECK_STRUCTS comment." +# error "Lisp_Symbol changed. See CHECK_STRUCTS comment in config.h." #endif #if CHECK_STRUCTS && !defined (HASH_symbol_redirect_ADB4F5B113) -# error "symbol_redirect changed. See CHECK_STRUCTS comment." +# error "symbol_redirect changed. See CHECK_STRUCTS comment in config.h." #endif if (ctx->flags.defer_symbols) @@ -2530,7 +2530,7 @@ dump_vectorlike_generic (struct dump_context *ctx, const union vectorlike_header *header) { #if CHECK_STRUCTS && !defined (HASH_vectorlike_header_00A5A4BFB2) -# error "vectorlike_header changed. See CHECK_STRUCTS comment." +# error "vectorlike_header changed. See CHECK_STRUCTS comment in config.h." #endif const struct Lisp_Vector *v = (const struct Lisp_Vector *) header; ptrdiff_t size = header->size; @@ -2690,7 +2690,7 @@ dump_hash_table (struct dump_context *ctx, dump_off offset) { #if CHECK_STRUCTS && !defined HASH_Lisp_Hash_Table_EF95ED06FF -# error "Lisp_Hash_Table changed. See CHECK_STRUCTS comment." +# error "Lisp_Hash_Table changed. See CHECK_STRUCTS comment in config.h." #endif const struct Lisp_Hash_Table *hash_in = XHASH_TABLE (object); bool is_stable = dump_hash_table_stable_p (hash_in); @@ -2758,7 +2758,7 @@ static dump_off dump_buffer (struct dump_context *ctx, const struct buffer *in_buffer) { #if CHECK_STRUCTS && !defined HASH_buffer_E34A11C6B9 -# error "buffer changed. See CHECK_STRUCTS comment." +# error "buffer changed. See CHECK_STRUCTS comment in config.h." #endif struct buffer munged_buffer = *in_buffer; struct buffer *buffer = &munged_buffer; @@ -2894,7 +2894,7 @@ static dump_off dump_bool_vector (struct dump_context *ctx, const struct Lisp_Vector *v) { #if CHECK_STRUCTS && !defined (HASH_Lisp_Vector_3091289B35) -# error "Lisp_Vector changed. See CHECK_STRUCTS comment." +# error "Lisp_Vector changed. See CHECK_STRUCTS comment in config.h." #endif /* No relocation needed, so we don't need dump_object_start. */ dump_align_output (ctx, DUMP_ALIGNMENT); @@ -2911,7 +2911,7 @@ static dump_off dump_subr (struct dump_context *ctx, const struct Lisp_Subr *subr) { #if CHECK_STRUCTS && !defined (HASH_Lisp_Subr_594AB72B54) -# error "Lisp_Subr changed. See CHECK_STRUCTS comment." +# error "Lisp_Subr changed. See CHECK_STRUCTS comment in config.h." #endif struct Lisp_Subr out; dump_object_start (ctx, &out, sizeof (out)); @@ -2950,7 +2950,7 @@ dump_vectorlike (struct dump_context *ctx, dump_off offset) { #if CHECK_STRUCTS && !defined HASH_pvec_type_E55BD36F8E -# error "pvec_type changed. See CHECK_STRUCTS comment." +# error "pvec_type changed. See CHECK_STRUCTS comment in config.h." #endif const struct Lisp_Vector *v = XVECTOR (lv); switch (PSEUDOVECTOR_TYPE (v)) @@ -3058,7 +3058,7 @@ static dump_off dump_object (struct dump_context *ctx, Lisp_Object object) { #if CHECK_STRUCTS && !defined (HASH_Lisp_Type_E2AD97D3F7) -# error "Lisp_Type changed. See CHECK_STRUCTS comment." +# error "Lisp_Type changed. See CHECK_STRUCTS comment in config.h." #endif #ifdef ENABLE_CHECKING /* Vdead is extern only when ENABLE_CHECKING. */ @@ -3163,7 +3163,7 @@ static dump_off dump_charset (struct dump_context *ctx, int cs_i) { #if CHECK_STRUCTS && !defined (HASH_charset_317C49E291) -# error "charset changed. See CHECK_STRUCTS comment." +# error "charset changed. See CHECK_STRUCTS comment in config.h." #endif dump_align_output (ctx, alignof (struct charset)); const struct charset *cs = charset_table + cs_i; -- 2.39.5