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 Wed, Sep 1, 2010 at 12:28 PM, sami wagiaalla <swagiaal@redhat.com> wrote:
>> I hope I'm not reducing the S/N ratio here, but there's something I
>> don't understand.
>> The original patch doesn't initialize obj_section (right?) (except by
>> virtue of using "static"). ?So if this fixes things, does it do so
>> only because we're taking advantage of the fact that obj_section will
>> be NULL in the static version
>
> Yes.
>
> ?and that's sufficient?
>
> IIUC, it should be.
>
> ?So do we need
>>
>> the memset of the original patch (which only zeros
>> psymbol.ginfo.value).
>>
>
> I don't really see why it is needed but I am inclined to believe the
> comment.

I think that stems from the old
bcache-the-entire-thing-as-a-byte-array behaviour, but that's gone now
(thankfully).

>> Plus, reverting to the original patch leaves me a little
>> uncomfortable: There's a comment that mentions gaps in the struct
>> causing cache misses, but that's no longer an issue with the custom
>> hash function (right?).
>
> I should probably fix that comment. The gabs in the struct, while bad, would
> not cause hash misses since the new supplied hash function only looks at the
> initialized fields.

Looking at the struct, and what's left to initialize, I like this patch.
Now everything is initialized.


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;


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