x/debug: speed up various DWARF information queries.

Builds auxiliary tables from the DWARF data to speed up requests for:
- Entries with a given name or matching a regexp (using a map from
  symbol name to a linked list of *Entry)
- Mapping a PC to a function (using a slice of function bounds, sorted
  by PC).
- Mapping a PC to a source line (using a slice of structs containing
  (PC, file, line), sorted by PC).
- Mapping a source line to breakpoint addresses (using a slice
  containing, for each file, a slice of (line, PC) pairs sorted by line.)

Renames some functions to better reflect their return values
(lookupFunction->functionStartAddress, lookupRE->LookupMatchingSymbols,
lookupPC/entryForPC->PCToFunction, LineToPCs->LineToBreakpointPCs).

Uses more specific lookups for entries that must be variables
(LookupEntry->LookupVariable).

Change-Id: Ia57514887495a7cfca242fa4af5517acf5eecf45
Reviewed-on: https://go-review.googlesource.com/20314
Reviewed-by: Dave Day <djd@golang.org>
8 files changed