The language_defn structure has an la_magic field, this used to be
used as a basic check that the language_defn structure had the
expected layout - at least the end of the structure was where we
expected it to be.
This feature only really makes sense if we imagine GDB dynamically
loading language support from dynamic libraries, where a version
mismatch might cause problems.
However, in current GDB language support is statically built into GDB,
and since this commit:
commit
47e77640be31fc1a4eb3718f594ed5fd0faff065
Date: Thu Jul 20 18:28:01 2017 +0100
Make language_def O(1)
the existing (if pointless) check of the la_magic field was removed.
There now appears to be no use of the la_magic field, and I propose
that we delete it.
There should be no user visible changes after this commit.
gdb/ChangeLog:
* ada-lang.c (ada_language_defn): Remove use of LANG_MAGIC.
* c-lang.c (c_language_defn): Likewise.
(cplus_language_defn): Likewise.
(asm_language_defn): Likewise.
(minimal_language_defn): Likewise.
* d-lang.c (d_language_defn): Likewise.
* f-lang.c (f_language_defn): Likewise.
* go-lang.c (go_language_defn): Likewise.
* language.c (unknown_language_defn): Likewise.
(auto_language_defn): Likewise.
* language.h (struct language_defn): Remove la_magic field.
(LANG_MAGIC): Delete.
* m2-lang.c (m2_language_defn): Remove use of LANG_MAGIC.
* objc-lang.c (objc_language_defn): Likewise.
* opencl-lang.c (opencl_language_defn): Likewise.
* p-lang.c (pascal_language_defn): Likewise.
* rust-lang.c (rust_language_defn): Likewise.
+2019-04-12 Andrew Burgess <andrew.burgess@embecosm.com>
+
+ * ada-lang.c (ada_language_defn): Remove use of LANG_MAGIC.
+ * c-lang.c (c_language_defn): Likewise.
+ (cplus_language_defn): Likewise.
+ (asm_language_defn): Likewise.
+ (minimal_language_defn): Likewise.
+ * d-lang.c (d_language_defn): Likewise.
+ * f-lang.c (f_language_defn): Likewise.
+ * go-lang.c (go_language_defn): Likewise.
+ * language.c (unknown_language_defn): Likewise.
+ (auto_language_defn): Likewise.
+ * language.h (struct language_defn): Remove la_magic field.
+ (LANG_MAGIC): Delete.
+ * m2-lang.c (m2_language_defn): Remove use of LANG_MAGIC.
+ * objc-lang.c (objc_language_defn): Likewise.
+ * opencl-lang.c (opencl_language_defn): Likewise.
+ * p-lang.c (pascal_language_defn): Likewise.
+ * rust-lang.c (rust_language_defn): Likewise.
+
2019-04-11 Andrew Burgess <andrew.burgess@embecosm.com>
* riscv-tdep.c (riscv_type_align): New function.
default_search_name_hash,
&ada_varobj_ops,
NULL,
- NULL,
- LANG_MAGIC
+ NULL
};
/* Command-list for the "set/show ada" prefix command. */
default_search_name_hash,
&c_varobj_ops,
c_get_compile_context,
- c_compute_program,
- LANG_MAGIC
+ c_compute_program
};
enum cplus_primitive_types {
cp_search_name_hash,
&cplus_varobj_ops,
cplus_get_compile_context,
- cplus_compute_program,
- LANG_MAGIC
+ cplus_compute_program
};
static const char *asm_extensions[] =
default_search_name_hash,
&default_varobj_ops,
NULL,
- NULL,
- LANG_MAGIC
+ NULL
};
/* The following language_defn does not represent a real language.
default_search_name_hash,
&default_varobj_ops,
NULL,
- NULL,
- LANG_MAGIC
+ NULL
};
default_search_name_hash,
&default_varobj_ops,
NULL,
- NULL,
- LANG_MAGIC
+ NULL
};
/* Build all D language types for the specified architecture. */
default_search_name_hash,
&default_varobj_ops,
NULL,
- NULL,
- LANG_MAGIC
+ NULL
};
static void *
default_search_name_hash,
&default_varobj_ops,
NULL,
- NULL,
- LANG_MAGIC
+ NULL
};
static void *
default_search_name_hash,
&default_varobj_ops,
NULL,
- NULL,
- LANG_MAGIC
+ NULL
};
/* These two structs define fake entries for the "local" and "auto"
default_search_name_hash,
&default_varobj_ops,
NULL,
- NULL,
- LANG_MAGIC
+ NULL
};
\f
struct gdbarch *gdbarch,
const struct block *expr_block,
CORE_ADDR expr_pc);
-
- /* Add fields above this point, so the magic number is always last. */
- /* Magic number for compat checking. */
-
- long la_magic;
-
};
-#define LANG_MAGIC 910823L
-
/* Pointer to the language_defn for our current language. This pointer
always points to *some* valid struct; it can be used without checking
it for validity.
default_search_name_hash,
&default_varobj_ops,
NULL,
- NULL,
- LANG_MAGIC
+ NULL
};
static void *
default_search_name_hash,
&default_varobj_ops,
NULL,
- NULL,
- LANG_MAGIC
+ NULL
};
/*
default_search_name_hash,
&default_varobj_ops,
NULL,
- NULL,
- LANG_MAGIC
+ NULL
};
static void *
default_search_name_hash,
&default_varobj_ops,
NULL,
- NULL,
- LANG_MAGIC
+ NULL
};
default_search_name_hash,
&default_varobj_ops,
NULL,
- NULL,
- LANG_MAGIC
+ NULL
};