Files
binutils-gdb/ld/testsuite/ld-ctf/data-func-conflicted.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

64 lines
1.7 KiB
Makefile

#as:
#source: data-func-1.c
#source: data-func-2.c
#objdump: --ctf=.ctf
#ld: -shared -s
#name: Conflicted data syms, partially indexed, stripped
.*: +file format .*
Contents of CTF section \.ctf:
Header:
Magic number: 0xdff2
Version: 4 \(CTF_VERSION_3\)
#...
Data object section: .* \(0xc bytes\)
Function info section: .* \(0x40 bytes\)
Object index section: .* \(0xc bytes\)
Type section: .* \(0xe8 bytes\)
String section: .*
#...
Data objects:
bar -> 0x[0-9a-f]*: struct var_3 \(size 0x[0-9a-f]*\)
var_1 -> 0x[0-9a-f]*: foo_t \(size 0x[0-9a-f]*\) -> .*
var_666 -> 0x[0-9a-f]*: foo_t \* \(size 0x[0-9a-f]*\) -> .*
Function objects:
func_[0-9]* -> 0x[0-9a-f]*: void \*\(\*\) \(const char \*restrict, int \(\*\)\(\*\) \(const char \*\)\)
#...
Types:
#...
.*: struct var_3 .*
#...
CTF archive member: .*/data-func-1\.c:
Header:
Magic number: 0xdff2
Version: 4 \(CTF_VERSION_3\)
#...
Parent name: \.ctf
Compilation unit name: .*/data-func-1\.c
Data object section: .* \(0xfa4 bytes\)
Type section: .* \(0xc bytes\)
String section: .*
Labels:
Data objects:
var_[0-9]* -> 0x[0-9a-f]*: foo_t \(size 0x[0-9a-f]*\) -> .*
var_[0-9]* -> 0x[0-9a-f]*: foo_t \(size 0x[0-9a-f]*\) -> .*
var_[0-9]* -> 0x[0-9a-f]*: foo_t \(size 0x[0-9a-f]*\) -> .*
var_[0-9]* -> 0x[0-9a-f]*: foo_t \(size 0x[0-9a-f]*\) -> .*
var_[0-9]* -> 0x[0-9a-f]*: foo_t \(size 0x[0-9a-f]*\) -> .*
var_[0-9]* -> 0x[0-9a-f]*: foo_t \(size 0x[0-9a-f]*\) -> .*
var_[0-9]* -> 0x[0-9a-f]*: foo_t \(size 0x[0-9a-f]*\) -> .*
#...
Function objects:
Variables:
Types:
0x80000001: foo_t .* -> .* int .*
#...