gdb/dwarf: add logging for CU expansion

I was trying to get an understanding of which CUs were expanded when,
and how much time it was taking.  I wrote this patch to add some logging
related to that, and I think it would be useful to have upstream, to
better understand performance problems related to over-eager CU
expansion, for example.

 - add DWARF_READ_SCOPED_DEBUG_START_END
 - use it in process_queue, to wrap the related expansion messages
   together
 - add a message in maybe_queue_comp_unit when enqueuing a comp unit
 - add timing information to messages in process_queue, indicating how
   much time it took to expand a given symtab
 - count the number of expansions done in a single call to process_queue

    [dwarf-read] process_queue: start: Expanding one or more symtabs of objfile /home/smarchi/build/binutils-gdb/gdb/testsuite/outputs/gdb.dwarf2/dw-form-ref-addr-with-type-units/dw-form-ref-addr-with-type-units ...
      [dwarf-read] process_queue: Expanding symtab of CU at offset 0xc
      [dwarf-read] maybe_queue_comp_unit: Queuing CU for expansion: section offset = 0x38b, queue size = 2
      [dwarf-read] process_queue: Done expanding CU at offset 0xc, took 0.001s
      [dwarf-read] process_queue: Expanding symtab of CU at offset 0x38b
      [dwarf-read] process_queue: Done expanding CU at offset 0x38b, took 0.000s
      [dwarf-read] process_queue: Done expanding 2 symtabs.
    [dwarf-read] process_queue: end: Expanding one or more symtabs of objfile /home/smarchi/build/binutils-gdb/gdb/testsuite/outputs/gdb.dwarf2/dw-form-ref-addr-with-type-units/dw-form-ref-addr-with-type-units ...

Change-Id: I5237d50e0c1d06be33ea83a9120b5fe1cf7ab8c2
Approved-By: Tom Tromey <tom@tromey.com>
1 file changed