aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorSami Wagiaalla <swagiaal@redhat.com>2010-09-07 15:00:00 +0000
committerSami Wagiaalla <swagiaal@redhat.com>2010-09-07 15:00:00 +0000
commitfc956729733b29650ebd1cfddccb6eaf3a35a9b2 (patch)
tree30edabdc979a1a78adc40c0a3b8d0e6dbd5f3e0c /gdb
parent23a12aacb2cd5a8b06cd9b7962ddcc0316ed409a (diff)
downloadgdb-fc956729733b29650ebd1cfddccb6eaf3a35a9b2.zip
gdb-fc956729733b29650ebd1cfddccb6eaf3a35a9b2.tar.gz
gdb-fc956729733b29650ebd1cfddccb6eaf3a35a9b2.tar.bz2
Fix custom bcache hash regression.
2010-09-09 Sami Wagiaalla <swagiaal@redhat.com> * psymtab.c (add_psymbol_to_bcache): Initialize obj_section. memset psymbol.ginfo.value to 0.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog6
-rw-r--r--gdb/psymtab.c6
2 files changed, 12 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 8eca93a..da61ab7 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -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
diff --git a/gdb/psymtab.c b/gdb/psymtab.c
index b1a7fc9..f805d6f 100644
--- a/gdb/psymtab.c
+++ b/gdb/psymtab.c
@@ -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;