This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Reverted - June 5th patch
- To: gdb-patches at sources dot redhat dot com
- Subject: Reverted - June 5th patch
- From: Daniel Berlin <dberlin at redhat dot com>
- Date: 07 Nov 2000 21:51:02 -0500
As per Jim Blandy's request, I have reverted the June 5th change to
cache type names.
Changelog for revert patch:
2000-11-07 Daniel Berlin <dberlin@redhat.com>
* dwarf2read.c: Revert June 5th change for caching of types,
as per Jim Blandy's request.
Revert patch follows:
Index: ChangeLog
===================================================================
RCS file: /cvs/src/src/gdb/ChangeLog,v
retrieving revision 1.753
diff -c -3 -p -r1.753 ChangeLog
*** ChangeLog 2000/11/06 23:12:29 1.753
--- ChangeLog 2000/11/08 02:47:34
***************
*** 1,3 ****
--- 1,8 ----
+ 2000-11-07 Daniel Berlin <dberlin@redhat.com>
+
+ * dwarf2read.c: Revert June 5th change for caching of types,
+ as per Jim Blandy's request.
+
2000-11-06 Fernando Nasser <fnasser@totem.toronto.redhat.com>
* wrapper.c (gdb_value_assign): New function. Longjump-free
Index: dwarf2read.c
===================================================================
RCS file: /cvs/src/src/gdb/dwarf2read.c,v
retrieving revision 1.17
diff -c -3 -p -r1.17 dwarf2read.c
*** dwarf2read.c 2000/11/03 22:38:38 1.17
--- dwarf2read.c 2000/11/08 02:47:35
*************** static struct abbrev_info *dwarf2_abbrev
*** 275,285 ****
static struct die_info *die_ref_table[REF_HASH_SIZE];
- #ifndef TYPE_HASH_SIZE
- #define TYPE_HASH_SIZE 4096
- #endif
- static struct type *dwarf2_cached_types[TYPE_HASH_SIZE];
-
/* Obstack for allocating temporary storage used during symbol reading. */
static struct obstack dwarf2_tmp_obstack;
--- 275,280 ----
*************** read_comp_unit (char *info_ptr, bfd *abf
*** 2901,2907 ****
char *cur_ptr;
int nesting_level;
! /* Reset die reference table and cached types table; we are
building new ones now. */
dwarf2_empty_hash_tables ();
--- 2896,2902 ----
char *cur_ptr;
int nesting_level;
! /* Reset die reference table; we are
building new ones now. */
dwarf2_empty_hash_tables ();
*************** tag_type_to_type (struct die_info *die,
*** 4528,4565 ****
}
else
{
! struct attribute *attr;
! attr = dwarf_attr (die, DW_AT_name);
! if (attr && DW_STRING (attr))
! {
! char *attrname=DW_STRING (attr);
! unsigned long hashval=hash(attrname, strlen(attrname)) % TYPE_HASH_SIZE;
!
! if (dwarf2_cached_types[hashval] != NULL)
! {
! const char *nameoftype;
! nameoftype = TYPE_NAME(dwarf2_cached_types[hashval]) == NULL ? TYPE_TAG_NAME(dwarf2_cached_types[hashval]) : TYPE_NAME(dwarf2_cached_types[hashval]);
! if (strcmp(attrname, nameoftype) == 0)
! {
! die->type=dwarf2_cached_types[hashval];
! }
! else
! {
! read_type_die (die, objfile, cu_header);
! dwarf2_cached_types[hashval] = die->type;
! }
! }
! else
! {
! read_type_die (die, objfile, cu_header);
! dwarf2_cached_types[hashval] = die->type;
! }
! }
! else
! {
! read_type_die (die, objfile, cu_header);
! }
!
if (!die->type)
{
dump_die (die);
--- 4523,4529 ----
}
else
{
! read_type_die (die, objfile, cu_header);
if (!die->type)
{
dump_die (die);
*************** static void
*** 5606,5612 ****
dwarf2_empty_hash_tables (void)
{
memset (die_ref_table, 0, sizeof (die_ref_table));
- memset (dwarf2_cached_types, 0, sizeof(dwarf2_cached_types));
}
static unsigned int
--- 5570,5575 ----