[PATCH + 8.3] Don't derive partial_symbol from general_symbol_info

Tom Tromey tom@tromey.com
Mon Sep 9 16:35:00 GMT 2019


Tom> This patch partly reverts commit 8a6d42345 ("Change representation of
Tom> psymbol to flush out accessors"); specifically, it changes
Tom> partial_symbol to no longer derive from general_symbol_info.

Christian> I don't really understand this patch, could you elaborate a bit about how
Christian> inheriting makes it less likely that fields will be initialized? In
Christian> particular the value field, since it sounds like that's where the problem
Christian> is.

The main issue is that there is padding in the struct, and the padding
bytes can take any value.  (Also maybe there was an issue with the value
field, I don't recall.)  However, the bcache relies on the bits being
identical.

The reason the patch works is that it restores this line:

+  memset (&psymbol, 0, sizeof (psymbol));

... ensuring that the memory is zeroed.  This isn't possible when
inheritance is used.

Tom



More information about the Gdb-patches mailing list