mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-12-27 04:52:05 +08:00
c59e30ed17
This introduces a new lookup testsuite under libctf, which operates by compiling (with libtool) a "lookup" .c file that uses libctf to analyze some other program, then compiling some number of test object files with CTF and optionally linking them together and running the lookup program on the test object files (or linked test binary), before diffing the result much as run_dump_test does. This lets us test the portions of libctf that are not previously testable, notably the portions that do lookup on linked output and that create dynamic dictionaries and then do lookup on them before writing them out, something that is not tested by the ld-ctf testsuite because the linker never does this. A couple of simple tests are added: one testing the functionality of enum lookups, and one testing that the recently-added commit adding extra paranoia to incomplete type handling doesn't break linking and that the result of the link is an (otherwise-impossible) array of forward type in the shared CTF dict. ChangeLog 2021-01-05 Nick Alcock <nick.alcock@oracle.com> * Makefile.def (libctf): No longer no_check. Checking depends on all-ld. * Makefile.in: Regenerated. libctf/ChangeLog 2021-01-05 Nick Alcock <nick.alcock@oracle.com> * Makefile.am (EXPECT): New. (RUNTEST): Likewise. (RUNTESTFLAGS): Likewise. (CC_FOR_TARGET): Likewise. (check-DEJAGNU): Likewise. (AUTOMAKE_OPTIONS): Add dejagnu. * Makefile.in: Regenerated. * testsuite/config/default.exp: New. * testsuite/lib/ctf-lib.exp: Likewise. * testsuite/libctf-lookup/enum.lk: New test. * testsuite/libctf-lookup/enum-ctf.c: New CTF input. * testsuite/libctf-lookup/enum.c: New lookup test. * testsuite/libctf-lookup/ambiguous-struct*.c: New test. * testsuite/libctf-lookup/lookup.exp: New.
117 lines
4.2 KiB
Plaintext
117 lines
4.2 KiB
Plaintext
2021-01-05 Nick Alcock <nick.alcock@oracle.com>
|
||
|
||
* Makefile.am (EXPECT): New.
|
||
(RUNTEST): Likewise.
|
||
(RUNTESTFLAGS): Likewise.
|
||
(CC_FOR_TARGET): Likewise.
|
||
(check-DEJAGNU): Likewise.
|
||
(AUTOMAKE_OPTIONS): Add dejagnu.
|
||
* Makefile.in: Regenerated.
|
||
* testsuite/config/default.exp: New.
|
||
* testsuite/lib/ctf-lib.exp: Likewise.
|
||
* testsuite/libctf-lookup/enum.lk: New test.
|
||
* testsuite/libctf-lookup/enum-ctf.c: New CTF input.
|
||
* testsuite/libctf-lookup/enum.c: New lookup test.
|
||
* testsuite/libctf-lookup/ambiguous-struct*.c: New test.
|
||
* testsuite/libctf-lookup/lookup.exp: New.
|
||
|
||
2021-01-05 Nick Alcock <nick.alcock@oracle.com>
|
||
|
||
* configure.ac (BFD_LIBADD): Remove.
|
||
(BFD_DEPENDENCIES): Likewise. Remove associated cases.
|
||
(SHARED_LIBADD): Rename to...
|
||
(CTF_LIBADD): ... this. Stick in a suitable libiberty even when
|
||
linking statically.
|
||
* Makefile.am (libctf_nobfd_la_LIBADD): Adjust accordingly.
|
||
libctf uses libintl.
|
||
(libctf_la_LIBADD): Reference libbfd.la directly, not via
|
||
BFD_LIBADD.
|
||
(libctf_la_DEPENDENCIES): Remove.
|
||
* Makefile.in: Regenerate.
|
||
* configure: Likewise.
|
||
|
||
2021-01-05 Nick Alcock <nick.alcock@oracle.com>
|
||
|
||
* ctf-decl.c (ctf_decl_push): Exclude slices from the decl stack.
|
||
* ctf-types.c (ctf_type_aname): No longer deal with slices here.
|
||
* ctf-dump.c (ctf_dump_membstate_t) <cdm_toplevel_indent>: Constify.
|
||
(CTF_FT_REFS): New.
|
||
(CTF_FT_BITFIELD): Likewise.
|
||
(CTF_FT_ID): Likewise.
|
||
(ctf_dump_member): Do not do indentation here. Migrate the
|
||
type-printing parts of this into...
|
||
(ctf_dump_format_type): ... here, to be shared by all type printers.
|
||
Get the errno value for non-representable types right. Do not print
|
||
bitfield info for non-bitfields. Improve the format and indentation
|
||
of other type output. Shuffle spacing around to make all indentation
|
||
either 'width of column' or 4 chars.
|
||
(ctf_dump_label): Pass CTF_FT_REFS to ctf_dump_format_type.
|
||
(ctf_dump_objts): Likewise. Spacing shuffle.
|
||
(ctf_dump_var): Likewise.
|
||
(type_hex_digits): Migrate down in the file, to above its new user.
|
||
(ctf_dump_type): Indent here instead. Pass CTF_FT_REFS to
|
||
ctf_dump_format_type. Don't trim off excess linefeeds now we no
|
||
longer generate them. Dump enumerated types.
|
||
|
||
2021-01-05 Nick Alcock <nick.alcock@oracle.com>
|
||
|
||
* ctf-types.c (ctf_type_resolve): Improve comment.
|
||
(ctf_type_size): Yield ECTF_INCOMPLETE when applied to forwards.
|
||
Emit errors into the right dict.
|
||
(ctf_type_align): Likewise.
|
||
* ctf-create.c (ctf_add_member_offset): Yield ECTF_INCOMPLETE
|
||
when adding a member without explicit offset when this member, or
|
||
the previous member, is incomplete.
|
||
* ctf-dump.c (ctf_dump_format_type): Do not try to print the size of
|
||
forwards.
|
||
(ctf_dump_member): Do not try to print their alignment.
|
||
|
||
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 Nick Alcock <nick.alcock@oracle.com>
|
||
|
||
* ctf-dump.c (ctf_dump_format_type): Add 0x to hex type IDs.
|
||
(ctf_dump_header): Add 0x to the hex magic number.
|
||
(ctf_dump_str): Add 0x to the hex string offsets.
|
||
(ctf_dump_membstate_t) <cdm_toplevel_indent>: New.
|
||
(ctf_dump_type): Adjust. Free it when we're done.
|
||
(type_hex_digits): New.
|
||
(ctf_dump_member): Align output depending on the width of the type
|
||
ID being generated. Use printf padding, not a loop, to generate
|
||
indentation.
|
||
|
||
2021-01-05 Nick Alcock <nick.alcock@oracle.com>
|
||
|
||
* ctf-decl.c (ctf_decl_push): Don't print array decls backwards.
|
||
|
||
2021-01-04 Nicolas Boulenguez <nicolas@debian.org>
|
||
|
||
PR 27117
|
||
* configure.ac: Make AC_CONFIG_MACRO_DIR consistent with
|
||
ACLOCAL_AMFLAGS -I dirs.
|
||
* configure: Regenerate.
|
||
|
||
2021-01-01 Alan Modra <amodra@gmail.com>
|
||
|
||
Update year range in copyright notice of all files.
|
||
|
||
For older changes see ChangeLog-2020
|
||
|
||
Copyright (C) 2021 Free Software Foundation, Inc.
|
||
|
||
Copying and distribution of this file, with or without modification,
|
||
are permitted in any medium without royalty provided the copyright
|
||
notice and this notice are preserved.
|
||
|
||
Local Variables:
|
||
mode: change-log
|
||
left-margin: 8
|
||
fill-column: 74
|
||
version-control: never
|
||
End:
|