gdb/dwarf: add more context to complaints in mapped_debug_names_reader::scan_one_entry

I realize that complaints are not often enabled and shown, but if we
emit them, I think they should include enough context to help a user who
wishes to dig in the problem to pinpoint where the problem happened
exactly.  For this reason, change the complaints in
mapped_debug_names_reader::scan_one_entry to include precisions
regarding which index entry is problematic exactly.

I am not attached to the particular format.  I thought that because this
is extra contextual information, I would put it in the square brackets
at the end (which only shows the module name currently).  However, it
would be nice to converge towards a format that we could replicate
elsewhere in the DWARF reader, so feel free to chime in.

I factored out the formatting to a separate function, because I will be
adding more of these in a subsequent patch, and it's easier to have the
formatting centralized.

I have not touched the "Unsupported .debug_names form" warning.  If that
comes up, we probably don't care about the specific index entry, we just
need to implement support for that form.

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