]> Git Repo - binutils.git/commitdiff
Add initializers to bound_minimal_symbol
authorTom Tromey <[email protected]>
Tue, 8 Feb 2022 20:41:53 +0000 (13:41 -0700)
committerTom Tromey <[email protected]>
Fri, 11 Feb 2022 16:23:56 +0000 (09:23 -0700)
This adds initializers to bound_minimal_symbol, allowing for the
removal of some calls to memset.

gdb/ada-lang.c
gdb/findvar.c
gdb/minsyms.h
gdb/value.c

index 0dd83cda8e5a30eae1c43c4e0930eada7f80c467..d2f620cbb041acd199a919cda41e35079723657f 100644 (file)
@@ -4562,8 +4562,6 @@ ada_lookup_simple_minsym (const char *name)
 {
   struct bound_minimal_symbol result;
 
-  memset (&result, 0, sizeof (result));
-
   symbol_name_match_type match_type = name_match_type_from_name (name);
   lookup_name_info lookup_name (name, match_type);
 
index 1d22e645305e0bd6ddb0d55f226039e7db4cf5e1..6660b00679578d5472fa8beec145b877d4cafe1c 100644 (file)
@@ -404,7 +404,7 @@ symbol_read_needs_frame (struct symbol *sym)
 struct minsym_lookup_data
 {
   /* The name of the minimal symbol we are searching for.  */
-  const char *name;
+  const char *name = nullptr;
 
   /* The field where the callback should store the minimal symbol
      if found.  It should be initialized to NULL before the search
@@ -751,7 +751,6 @@ language_defn::read_var_value (struct symbol *var,
        struct minimal_symbol *msym;
        struct obj_section *obj_section;
 
-       memset (&lookup_data, 0, sizeof (lookup_data));
        lookup_data.name = var->linkage_name ();
 
        gdbarch_iterate_over_objfiles_in_search_order
index 5970cb3bb9963798a03d81f623070e2925adeec1..ed31d32483a483364307cf9f4bdafbb616b84f73 100644 (file)
@@ -31,12 +31,12 @@ struct bound_minimal_symbol
   /* The minimal symbol that was found, or NULL if no minimal symbol
      was found.  */
 
-  struct minimal_symbol *minsym;
+  struct minimal_symbol *minsym = nullptr;
 
   /* If MINSYM is not NULL, then this is the objfile in which the
      symbol is defined.  */
 
-  struct objfile *objfile;
+  struct objfile *objfile = nullptr;
 
   /* Return the obj_section from OBJFILE for MINSYM.  */
 
index 7bd9891b3e97a7c101d59433d12853dd43ede900..76099966f13e83f87718964484984f5d2295f912 100644 (file)
@@ -3171,13 +3171,8 @@ value_fn_field (struct value **arg1p, struct fn_field *f,
   struct bound_minimal_symbol msym;
 
   sym = lookup_symbol (physname, 0, VAR_DOMAIN, 0).symbol;
-  if (sym != NULL)
+  if (sym == nullptr)
     {
-      memset (&msym, 0, sizeof (msym));
-    }
-  else
-    {
-      gdb_assert (sym == NULL);
       msym = lookup_bound_minimal_symbol (physname);
       if (msym.minsym == NULL)
        return NULL;
This page took 0.039904 seconds and 4 git commands to generate.