mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-12-09 04:21:49 +08:00
eb5323fdf8
ctf_type_visit (used, among other things, by the type dumping code) was aborting when it saw a nonrepresentable type anywhere: even a single structure member with a nonrepresentable type caused an abort with ECTF_NONREPRESENTABLE. This is not useful behaviour, given that the abort comes from a type-resolution we are only doing in order to determine whether the type is a structure or union. We know nonrepresentable types can't be either, so handle that case and pass the nonrepresentable type down. (The added test verifies that the dumper now handles this case and prints nonrepresentable structure members as it already does nonrepresentable top-level types, rather than skipping the whole structure -- or, without the previous commit, skipping the whole types section.) ld/ChangeLog 2021-10-25 Nick Alcock <nick.alcock@oracle.com> * testsuite/ld-ctf/nonrepresentable-member.*: New test. libctf/ChangeLog 2021-10-25 Nick Alcock <nick.alcock@oracle.com> * ctf-types.c (ctf_type_rvisit): Handle nonrepresentable types.
26 lines
543 B
Makefile
26 lines
543 B
Makefile
#as:
|
|
#source: nonrepresentable-member.c
|
|
#objdump: --ctf
|
|
#ld: -shared
|
|
#name: Nonrepresentable members
|
|
|
|
.*: +file format .*
|
|
|
|
Contents of CTF section .ctf:
|
|
|
|
Header:
|
|
Magic number: 0xdff2
|
|
Version: 4 \(CTF_VERSION_3\)
|
|
#...
|
|
Types:
|
|
#...
|
|
0x[0-9a-f]*: \(kind 6\) struct blah .*
|
|
*\[0x0\] boring: ID 0x[0-9a-f]*: \(kind 1\) int .*
|
|
*\[0x[0-9a-f]*\] foo: .* \(.*represent.*\)
|
|
*\[0x[0-9a-f]*\] bar: .* \(.*represent.*\)
|
|
*\[0x[0-9a-f]*\] this_is_printed: ID 0x[0-9a-f]*: \(kind 1\) int .*
|
|
#...
|
|
|
|
Strings:
|
|
#...
|