[00/15] Index DWARF in the background

Message ID 20231029173839.471514-1-tom@tromey.com
Headers
Series Index DWARF in the background |

Message

Tom Tromey Oct. 29, 2023, 5:35 p.m. UTC
  This series changes gdb to do its initial DWARF indexing in the
background.

This process is mostly asynchronous with respect to the rest of gdb.
That is, rather than pre-emptively waiting for scanning to complete,
now gdb's main thread will only wait when some result of the scan is
required.

This drastically improves gdb's apparent startup time in the "normal"
case where a user does "gdb some-executable" -- e.g., for starting gdb
on itself, the time until the prompt returns goes from ~1.2 seconds to
~0.06 seconds on my machine.

This approach works by hiding most of the work from the user.  Waiting
can still be needed; for example if one starts gdb and immediately
sets a breakpoint -- however, because the indexer is reasonably fast,
and human reaction times are slow, this series still manages to be
fairly successful.

My current belief is that doing any better than this will probably
require a new debug format that isn't quite so cursed to read.

This series requires the BFD threading series I posted to the binutils
list, and the DWZ refactoring patch I sent recently.

I regression tested this on x86-64 Fedora 38.  I've also built it with
TSAN and tested that, though TSAN seems to introduce random timeouts
into the testsuite when I use "make -j8 check".

Tom