From 91d3055d8b77d56cf64f85ace4237a0ccca98a4a Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Wed, 1 May 2019 15:31:10 -0600 Subject: [PATCH] Convert mdebugread.c to type-safe registry API This changes mdebugread.c to use the type-safe registry API. gdb/ChangeLog 2019-05-08 Tom Tromey * mdebugread.c (basic_type_data): Change type. (basic_type, _initialize_mdebugread): Update. --- gdb/ChangeLog | 5 +++++ gdb/mdebugread.c | 11 +++++------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index edda8c918e0..4f1859c981d 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2019-05-08 Tom Tromey + + * mdebugread.c (basic_type_data): Change type. + (basic_type, _initialize_mdebugread): Update. + 2019-05-08 Tom Tromey * common/gdb_unique_ptr.h (struct noop_deleter): New. diff --git a/gdb/mdebugread.c b/gdb/mdebugread.c index 35e7890f357..2b54fef051a 100644 --- a/gdb/mdebugread.c +++ b/gdb/mdebugread.c @@ -1358,14 +1358,15 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend, /* Basic types. */ -static const struct objfile_data *basic_type_data; +static const struct objfile_key> + basic_type_data; static struct type * basic_type (int bt, struct objfile *objfile) { struct gdbarch *gdbarch = get_objfile_arch (objfile); - struct type **map_bt - = (struct type **) objfile_data (objfile, basic_type_data); + struct type **map_bt = basic_type_data.get (objfile); struct type *tp; if (bt >= btMax) @@ -1375,7 +1376,7 @@ basic_type (int bt, struct objfile *objfile) { map_bt = OBSTACK_CALLOC (&objfile->objfile_obstack, btMax, struct type *); - set_objfile_data (objfile, basic_type_data, map_bt); + basic_type_data.set (objfile, map_bt); } if (map_bt[bt]) @@ -4811,8 +4812,6 @@ elfmdebug_build_psymtabs (struct objfile *objfile, void _initialize_mdebugread (void) { - basic_type_data = register_objfile_data (); - mdebug_register_index = register_symbol_register_impl (LOC_REGISTER, &mdebug_register_funcs); mdebug_regparm_index -- 2.30.2