binutils-gdb/libctf
Nick Alcock 7044740174 libctf, dump: fix slice dumping
Now that we can have slices of anything terminating in an int, we must
dump things accordingly, or slices of typedefs appear as

  c5b: __u8 -> 16c: __u8 -> 78: short unsigned int (size 0x2)

which is unhelpful.  If things *are* printed as slices, the name is
missing:

  a15: [slice 0x8:0x4]-> 16c: __u8 -> 78: short unsigned int (size 0x2)

And struct members give no clue they're a slice at all, which is a shame
since bitfields are the major use of this type kind:

       [0x8] (ID 0xa15) (kind 10) __u8  dst_reg

Fix things so that everything slicelike or integral gets its encoding
printed, and everything with a name gets the name printed:

  a15: __u8  [slice 0x8:0x4] (size 0x1) -> 1ff: __u8 (size 0x1) -> 37: unsigned char [0x0:0x8] (size 0x1)
     [0x0] (ID 0xa15) (kind 10) __u8:4 (aligned at 0x1, format 0x2, offset:bits 0x8:0x4)

Bitfield struct members get a technically redundant but much
easier-to-understand dumping now:

    [0x0] (ID 0x80000005) (kind 6) struct bpf_insn (aligned at 0x1)
        [0x0] (ID 0x222) (kind 10) __u8 code (aligned at 0x1)
        [0x8] (ID 0x1e9e) (kind 10) __u8  dst_reg:4 (aligned at 0x1, format 0x2, offset:bits 0x8:0x4)
        [0xc] (ID 0x1e46) (kind 10) __u8  src_reg:4 (aligned at 0x1, format 0x2, offset:bits 0xc:0x4)
        [0x10] (ID 0xf35) (kind 10) __s16 off (aligned at 0x2)
        [0x20] (ID 0x1718) (kind 10) __s32 imm (aligned at 0x4)

This also fixes one place where a failure to format a type would be
erroneously considered an out-of-memory condition.

libctf/
	* ctf-dump.c (ctf_is_slice): Delete, unnecessary.
	(ctf_dump_format_type): improve slice formatting.  Always print
	the type size, even of slices.
	(ctf_dump_member): Print slices (-> bitfields) differently from
	non-slices.  Failure to format a type is not an OOM.
2020-07-22 18:02:18 +01:00
..
.gitignore libctf: restructure error handling to reduce relocations 2020-07-22 17:57:20 +01:00
aclocal.m4 libctf: support platforms with separate libintl 2020-06-26 15:56:39 +01:00
ChangeLog libctf, dump: fix slice dumping 2020-07-22 18:02:18 +01:00
config.h.in libctf: support platforms with separate libintl 2020-06-26 15:56:39 +01:00
configure libctf: support platforms with separate libintl 2020-06-26 15:56:39 +01:00
configure.ac libctf: support platforms with separate libintl 2020-06-26 15:56:39 +01:00
ctf-archive.c libctf, next: introduce new class of easier-to-use iterators 2020-07-22 17:57:50 +01:00
ctf-create.c libctf, ld, binutils: add textual error/warning reporting for libctf 2020-07-22 18:02:17 +01:00
ctf-decl.c libctf, decl: avoid leaks of the formatted string on error 2020-07-22 18:02:17 +01:00
ctf-decls.h libctf: pass the thunk down properly when wrapping qsort_r 2020-07-22 17:57:52 +01:00
ctf-dump.c libctf, dump: fix slice dumping 2020-07-22 18:02:18 +01:00
ctf-endian.h Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
ctf-error.c libctf: restructure error handling to reduce relocations 2020-07-22 17:57:20 +01:00
ctf-hash.c libctf, next, hash: add dynhash and dynset _next iteration 2020-07-22 17:57:51 +01:00
ctf-impl.h libctf, ld, binutils: add textual error/warning reporting for libctf 2020-07-22 18:02:17 +01:00
ctf-inlines.h libctf, ld, binutils: add textual error/warning reporting for libctf 2020-07-22 18:02:17 +01:00
ctf-labels.c Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
ctf-link.c Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
ctf-lookup.c libctf, next: introduce new class of easier-to-use iterators 2020-07-22 17:57:50 +01:00
ctf-open-bfd.c libctf, archive: stop ctf_arc_bufopen triggering crazy unmaps 2020-07-22 17:57:33 +01:00
ctf-open.c libctf, ld, binutils: add textual error/warning reporting for libctf 2020-07-22 18:02:17 +01:00
ctf-qsort_r.c Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
ctf-string.c Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
ctf-subr.c libctf, ld, binutils: add textual error/warning reporting for libctf 2020-07-22 18:02:17 +01:00
ctf-types.c libctf, types: enhance ctf_type_aname to print function arg types 2020-07-22 18:02:17 +01:00
ctf-util.c libctf, next, hash: add dynhash and dynset _next iteration 2020-07-22 17:57:51 +01:00
elf.h Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
libctf.ver libctf, ld, binutils: add textual error/warning reporting for libctf 2020-07-22 18:02:17 +01:00
Makefile.am libctf: restructure error handling to reduce relocations 2020-07-22 17:57:20 +01:00
Makefile.in libctf: restructure error handling to reduce relocations 2020-07-22 17:57:20 +01:00
mkerrors.sed libctf: restructure error handling to reduce relocations 2020-07-22 17:57:20 +01:00
swap.h libctf, elfcpp, gold: do not assume that <byteswap.h> contains bswap_* 2020-06-26 15:56:39 +01:00