From fc956729733b29650ebd1cfddccb6eaf3a35a9b2 Mon Sep 17 00:00:00 2001 From: Sami Wagiaalla Date: Tue, 7 Sep 2010 15:00:00 +0000 Subject: [PATCH] Fix custom bcache hash regression. 2010-09-09 Sami Wagiaalla * psymtab.c (add_psymbol_to_bcache): Initialize obj_section. memset psymbol.ginfo.value to 0. --- gdb/ChangeLog | 6 ++++++ gdb/psymtab.c | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 8eca93ad780..da61ab72830 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2010-09-09 Sami Wagiaalla + + * psymtab.c (add_psymbol_to_bcache): Initialize + obj_section. + memset psymbol.ginfo.value to 0. + 2010-09-06 Pedro Alves * infrun.c (resume): Extend comment on ignoring single-step diff --git a/gdb/psymtab.c b/gdb/psymtab.c index b1a7fc9581f..f805d6fb0f9 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; -- 2.30.2