gdb/dwarf: access m_info_ptr directly instead of passing info_ptr around

The few methods of cutu_reader that read DIEs into memory generally
receive an info_ptr that says where to start reading and return another
one (either by return value or parameter) indicating where the caller
should continue reading.

We can avoid all this passing around by having these methods access
m_info_ptr directly.  This allows changing some methods that read DIEs
to return `die_info *`, instead of returning it by parameter, which just
makes the code simpler to read, I think.

The only method that meaningfully reads and writes m_info_ptr (except
the places that initially set it up) is read_full_die_1.  It reads and
increments m_info_ptr once to read the abbrev and once again to read
each attribute.  Other methods use it for logging.

The methods cutu_reader::read_attribute and
cutu_reader::read_attribute_value do not touch m_info_ptr directly,
because they are used in cooked-indexer.c, which appears to read some
things in a non-linear fashion, unlike cutu_reader's DIE-reading
methods.  The cooked indexer calls cutu_reader::info_ptr to get the
m_info_ptr value just after the top-level DIE, and then it does its own
attribute reading after that.

Change-Id: I251f63d13d453a2827b21349760da033171880e2
Approved-By: Tom Tromey <tom@tromey.com>
2 files changed