This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Regression for gdb.stabs/gdb11479.exp [Re: [patch 1/2] Use custom hash function with bcache]


On Thu, Sep 2, 2010 at 12:01 PM, Doug Evans <dje@google.com> wrote:
> On Thu, Sep 2, 2010 at 8:36 AM, sami wagiaalla <swagiaal@redhat.com> wrote:
>> This sounds good to me. If we are not using a static psymbol struct should
>> we zero out the value union at least ?
>>
>>> 2010-09-01 ?Doug Evans<dje@google.com>
>>>
>>> ? ? ? ? * psymtab.c (add_psymbol_to_bcache): Initialize obj_section.
>>>
>>> Index: psymtab.c
>>> ===================================================================
>>> RCS file: /cvs/src/src/gdb/psymtab.c,v
>>> retrieving revision 1.12
>>> diff -u -p -r1.12 psymtab.c
>>> --- psymtab.c ? 1 Sep 2010 21:50:26 -0000 ? ? ? 1.12
>>> +++ psymtab.c ? 1 Sep 2010 22:50:05 -0000
>>> @@ -1394,6 +1394,7 @@ add_psymbol_to_bcache (char *name, int n
>>> ? ? ? ?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;
>
> The value union was only zeroed out before in case sizeof
> (SYMBOL_VALUE) != sizeof (SYMBOL_VALUE_ADDRESS) != sizeof (union), to
> maintain a consistent hash.
> The code does set the value union, and we no longer hash as a byte
> array, so I think we're fine.

Blech.  "never mind".  We do need the memset.
The hash still includes sizeof (ginfo.value), which is reasonable (I
thought it didn't for some reason).
gcc turns it in to a move instruction anyway so no worries there.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]