binutils-gdb/gdb/testsuite/gdb.gdb
Andrew Burgess 3644f41dc8 gdb: generate dwarf-5 index identically as worker-thread count changes
Similar to the previous commit, this commit ensures that the dwarf-5
index files are generated identically as the number of worker-threads
changes.

Building the dwarf-5 index makes use of a closed hash table, the
bucket_hash local within debug_names::build().  Entries are added to
bucket_hash from m_name_to_value_set, which, in turn, is populated
by calls to debug_names::insert() in write_debug_names.  The insert
calls are ordered based on the entries within the cooked_index, and
the ordering within cooked_index depends on the number of worker
threads that GDB is using.

My proposal is to sort each chain within the bucket_hash closed hash
table prior to using this to build the dwarf-5 index.

The buckets within bucket_hash will always have the same ordering (for
a given GDB build with a given executable), and by sorting the chains
within each bucket, we can be sure that GDB will see each entry in a
deterministic order.

I've extended the index creation test to cover this case.

Approved-By: Tom Tromey <tom@tromey.com>
2023-11-28 10:23:19 +00:00
..
index-file.exp gdb: generate dwarf-5 index identically as worker-thread count changes 2023-11-28 10:23:19 +00:00
python-helper.cc Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
python-helper.exp [gdb/testsuite] Fix gdb.gdb/python-helper.exp with -O2 -flto=auto and gcc 7.5.0 some more 2023-07-26 13:28:15 +02:00
selftest.exp [gdb/testsuite] Add -q to INTERNAL_GDBFLAGS 2023-04-07 10:26:02 +02:00
unittest.c Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
unittest.exp [gdb/testsuite] Fix gdb.gdb/unittest.exp for remote host 2023-03-27 17:40:06 +02:00