DW_AT_specification and DW_AT_abstract_origin resolving was only performed
on subroutine DIEs because it used the getSubroutineName method. Introduce
a more generic getName() and use it to dump the reference attributes.
Testcases have been updated to check the printed names instead of the offsets
except when the name could be ambiguous.
I implemented getName in a way that allowed to replicate exactly the current
getSubroutineName behavior (checking that each DIE in the reference chain is
a subroutine DIE). It could be made a bit simpler if getSubroutineName
only checked that the root DIE is a subroutine DIE and then called a generic
getName() afterwards.
I can of course commit this in 2 patches, 1 for the getName addition and another
for the use in dump().