diff options
Diffstat (limited to 'gdb/gdbarch.h')
-rw-r--r-- | gdb/gdbarch.h | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h index 16c7391..3249584 100644 --- a/gdb/gdbarch.h +++ b/gdb/gdbarch.h @@ -61,11 +61,11 @@ struct inferior; /* The base class for every architecture's tdep sub-class. The virtual destructor ensures the class has RTTI information, which allows - gdb::checked_static_cast to be used, the gdbarch_tdep the function. */ + gdb::checked_static_cast to be used in the gdbarch_tdep function. */ -struct gdbarch_tdep +struct gdbarch_tdep_base { - virtual ~gdbarch_tdep() = default; + virtual ~gdbarch_tdep_base() = default; }; /* The architecture associated with the inferior through the @@ -151,20 +151,23 @@ using read_core_file_mappings_loop_ftype = #include "gdbarch-gen.h" /* An internal function that should _only_ be called from gdbarch_tdep. - Returns the gdbarch_tdep field held within GDBARCH. */ + Returns the gdbarch_tdep_base field held within GDBARCH. */ -extern struct gdbarch_tdep *gdbarch_tdep_1 (struct gdbarch *gdbarch); +extern struct gdbarch_tdep_base *gdbarch_tdep_1 (struct gdbarch *gdbarch); -/* Return the gdbarch_tdep object held within GDBARCH cast to the type - TDepType, which should be a sub-class of gdbarch_tdep. There is no - checking done that the gdbarch_tdep within GDBARCH actually is of the - type TDepType, we just assume the caller knows what they are doing. */ +/* Return the gdbarch_tdep_base object held within GDBARCH cast to the type + TDepType, which should be a sub-class of gdbarch_tdep_base. + + When GDB is compiled in maintainer mode a run-time check is performed + that the gdbarch_tdep_base within GDBARCH really is of type TDepType. + When GDB is compiled in release mode the run-time check is not + performed, and we assume the caller knows what they are doing. */ template<typename TDepType> static inline TDepType * gdbarch_tdep (struct gdbarch *gdbarch) { - struct gdbarch_tdep *tdep = gdbarch_tdep_1 (gdbarch); + struct gdbarch_tdep_base *tdep = gdbarch_tdep_1 (gdbarch); return gdb::checked_static_cast<TDepType *> (tdep); } @@ -293,7 +296,7 @@ extern struct gdbarch_list *gdbarch_list_lookup_by_info (struct gdbarch_list *ar parameters. set_gdbarch_*() functions are called to complete the initialization of the object. */ -extern struct gdbarch *gdbarch_alloc (const struct gdbarch_info *info, struct gdbarch_tdep *tdep); +extern struct gdbarch *gdbarch_alloc (const struct gdbarch_info *info, struct gdbarch_tdep_base *tdep); /* Helper function. Free a partially-constructed ``struct gdbarch''. |