binutils-gdb/ld/testsuite/ld-ctf/diag-cuname.d
Nick Alcock 91e7ce2fd7 libctf, ld: more dumper improvements
Dump more details about the types found in data object and function info
sections (the type ID and recursive info on the type itself, but not on
its members).  Before now, this was being dumped for entries in the
variable section, but not for the closely-related function info and data
object sections, which is inconsistent and makes finding the
corresponding types in the type section unnecessarily hard.  (This also
gets rid of code in which bugs have already been found in favour of the
same code everything else in the dumper uses to dump types.)

While we're doing that, change the recursive type dumper in question to
recursively dump info on arrays' element type, just as we do for all
types that reference other types. (Arrays are not a kind of reference
type in libctf, but perhaps we should change that in future and make
ctf_type_reference return the element type.)

ld/ChangeLog
2021-01-05  Nick Alcock  <nick.alcock@oracle.com>

	* testsuite/ld-ctf/array.d: Adjust for dumper changes.
	* testsuite/ld-ctf/data-func-conflicted.d: Likewise.
	* testsuite/ld-ctf/diag-cttname-null.d: Likewise.
	* testsuite/ld-ctf/diag-cuname.d: Likewise.
	* testsuite/ld-ctf/diag-parlabel.d: Likewise.
	* testsuite/ld-ctf/function.d: Likewise.
	* testsuite/ld-ctf/slice.d: Likewise.

libctf/ChangeLog
2021-01-05  Nick Alcock  <nick.alcock@oracle.com>

	* ctf-dump.c (ctf_dump_objts): Dump by calling ctf_dump_format_type.
	(ctf_dump_format_type): Don't emit the size for function objects.
	Dump the element type of arrays like we dump the pointed-to type of
	pointers, etc.
2021-01-05 14:53:39 +00:00

41 lines
722 B
Makefile

#as:
#source: diag-cuname.s
#objdump: --ctf=.ctf
#ld: -shared --ctf-variables
#name: Diagnostics - Invalid CU name offset
.*: +file format .*
Contents of CTF section .ctf:
Header:
Magic number: 0xdff2
Version: 4 \(CTF_VERSION_3\)
#...
Compilation unit name: \(\?\)
#...
Data object section: .*
Type section: .*
String section: .*
Labels:
Data objects:
a -> 0x[0-9a-f]*: struct A \(size 0x[0-9a-f]*\)
#...
Function objects:
Variables:
Types:
#...
0x[0-9a-f]*: struct A \(.*
*\[0x0\] \(ID 0x[0-9a-f]*\) \(kind 6\) struct A \(.*
*\[0x0\] \(ID 0x[0-9a-f]*\) \(kind 3\) struct B \* b \(.*
#...
Strings:
0x0:
#...
0x[0-9a-f]*: \(\?\)
#...