Fix custom bcache hash regression.
authorSami Wagiaalla <swagiaal@redhat.com>
Tue, 7 Sep 2010 15:00:00 +0000 (15:00 +0000)
committerSami Wagiaalla <swagiaal@redhat.com>
Tue, 7 Sep 2010 15:00:00 +0000 (15:00 +0000)
2010-09-09  Sami Wagiaalla  <swagiaal@redhat.com>

* psymtab.c (add_psymbol_to_bcache): Initialize
obj_section.
memset psymbol.ginfo.value to 0.

gdb/ChangeLog
gdb/psymtab.c

index 8eca93ad78050f69f82477dda72a1af2f013eb32..da61ab72830d3de5d07766f07e10a14c7531e0de 100644 (file)
@@ -1,3 +1,9 @@
+2010-09-09  Sami Wagiaalla  <swagiaal@redhat.com>
+
+       * psymtab.c (add_psymbol_to_bcache): Initialize
+       obj_section.
+       memset psymbol.ginfo.value to 0.
+
 2010-09-06  Pedro Alves  <pedro@codesourcery.com>
 
        * infrun.c (resume): Extend comment on ignoring single-step
index b1a7fc9581fa5d0252ed320619d420735b0d482d..f805d6fb0f92d2fd21f6e5852493c3d8fea886f3 100644 (file)
@@ -1384,6 +1384,11 @@ add_psymbol_to_bcache (char *name, int namelength, int copy_name,
 {
   struct partial_symbol psymbol;
 
+  /* We must ensure that the entire 'value' field has been zeroed
+     before assigning to it, because an assignment may not write the
+     entire field.  */
+  memset (&psymbol.ginfo.value, 0, sizeof (psymbol.ginfo.value));
+
   /* val and coreaddr are mutually exclusive, one of them *will* be zero */
   if (val != 0)
     {
@@ -1394,6 +1399,7 @@ add_psymbol_to_bcache (char *name, int namelength, int copy_name,
       SYMBOL_VALUE_ADDRESS (&psymbol) = coreaddr;
     }
   SYMBOL_SECTION (&psymbol) = 0;
+  SYMBOL_OBJ_SECTION (&psymbol) = NULL;
   SYMBOL_SET_LANGUAGE (&psymbol, language);
   PSYMBOL_DOMAIN (&psymbol) = domain;
   PSYMBOL_CLASS (&psymbol) = class;
This page took 0.031304 seconds and 4 git commands to generate.