From a83e9154c2f2a7c2c3a399c25c3931560a990d40 Mon Sep 17 00:00:00 2001 From: Joel Brobecker Date: Tue, 11 Sep 2012 21:26:04 +0000 Subject: [PATCH] install_minimal_symbols: use memset instead of setting each field. gdb/ChangeLog: * minsyms.c (install_minimal_symbols): Use memset to fill entire minimal_symbol struct object, rather than setting some of its fields one by one. --- gdb/ChangeLog | 6 ++++++ gdb/minsyms.c | 8 +------- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 959ff334d3..449d4fbf68 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2012-09-11 Joel Brobecker + + * minsyms.c (install_minimal_symbols): Use memset to fill entire + minimal_symbol struct object, rather than setting some of its + fields one by one. + 2012-09-11 Andrew Burgess * c-typeprint.c (c_type_print_varspec_prefix): Pass through the diff --git a/gdb/minsyms.c b/gdb/minsyms.c index 1070fff644..b6df4eae2d 100644 --- a/gdb/minsyms.c +++ b/gdb/minsyms.c @@ -1229,13 +1229,7 @@ install_minimal_symbols (struct objfile *objfile) symbol count does *not* include this null symbol, which is why it is indexed by mcount and not mcount-1. */ - SYMBOL_LINKAGE_NAME (&msymbols[mcount]) = NULL; - SYMBOL_VALUE_ADDRESS (&msymbols[mcount]) = 0; - MSYMBOL_TARGET_FLAG_1 (&msymbols[mcount]) = 0; - MSYMBOL_TARGET_FLAG_2 (&msymbols[mcount]) = 0; - MSYMBOL_SIZE (&msymbols[mcount]) = 0; - MSYMBOL_TYPE (&msymbols[mcount]) = mst_unknown; - SYMBOL_SET_LANGUAGE (&msymbols[mcount], language_unknown); + memset (&msymbols[mcount], 0, sizeof (struct minimal_symbol)); /* Attach the minimal symbol table to the specified objfile. The strings themselves are also located in the objfile_obstack -- 2.34.1