aboutsummaryrefslogtreecommitdiff
path: root/libbacktrace/ztest.c
AgeCommit message (Collapse)AuthorFilesLines
2022-01-03Update copyright years.Jakub Jelinek1-1/+1
2021-01-04Update copyright years.Jakub Jelinek1-1/+1
2020-05-13libbacktrace: mark test_large parameter unused in ztest.cIan Lance Taylor1-1/+1
libbacktrace/ * ztest.c (test_large): Mark state ATTRIBUTE_UNUSED.
2020-02-15libbacktrace: update to current libgo test fileIan Lance Taylor1-2/+2
* ztest.c (test_large): Update file to current libgo test file.
2020-02-03libbacktrace: always pass -g when compiling test codeIan Lance Taylor1-7/+11
This approach required adding a few casts to ztest.c, as it is now compiled with -Wall. Fixes PR libbacktrace/90636
2020-01-01Update copyright years.Jakub Jelinek1-1/+1
From-SVN: r279813
2019-01-01Update copyright years.Jakub Jelinek1-1/+1
From-SVN: r267494
2018-01-17elf.c (codes): Fix size to be 288.Ian Lance Taylor1-1/+64
* elf.c (codes) [GENERATE_FIXED_HUFFMAN_TABLE]: Fix size to be 288. (main) [GENERATE_FIXED_HUFFMAN_TABLE]: Pass 288 to elf_zlib_inflate_table. Generate elf_zlib_default_dist_table. (elf_zlib_default_table): Update. (elf_zlib_default_dist_table): New static array. (elf_zlib_inflate): Use elf_zlib_default_dist_table for dist table for block type 1. * ztest.c (struct zlib_test): Add uncompressed_len. (tests): Initialize uncompressed_len field. Add new test case. (test_samples): Use uncompressed_len field. From-SVN: r256776
2018-01-03Update copyright years.Jakub Jelinek1-1/+1
From-SVN: r256169
2017-10-06ztest.c (test_large): Pass unsigned long *, not size_t *, to zlib uncompress ↵Ian Lance Taylor1-1/+4
function. * ztest.c (test_large): Pass unsigned long *, not size_t *, to zlib uncompress function. From-SVN: r253491
2017-10-05elf.c (elf_zlib_fetch): Change pval argument to uint64_t *.Ian Lance Taylor1-3/+3
* elf.c (elf_zlib_fetch): Change pval argument to uint64_t *. Read a four byte integer. (elf_zlib_inflate): Change val to uint64_t. Align pin to a 32-bit boundary before ever calling elf_zlib_fetch. * ztest.c (test_large): Simplify print statements a bit. From-SVN: r253456
2017-10-03ztest.c: #include <errno.h>.Ian Lance Taylor1-15/+30
* ztest.c: #include <errno.h>. (TEST_TIMING): Don't define, don't test. (xclock_gettime, xclockid_t): Define if !HAVE_CLOCK_GETTIME. (clockid_t, clock_gettime, CLOCK_REALTIME): Likewise. (ZLIB_CLOCK_GETTIME_ARG): Define. * configure.ac: Change clock_gettime_link to CLOCK_GETTIME_LINK. * Makefile.am: Likewise. * configure, Makefile.in: Rebuild. From-SVN: r253377
2017-10-02libbacktrace: Conditionalize test timing on clock_gettime availabilityThomas Schwinge1-1/+11
libbacktrace/ PR other/67165 * configure.ac: Check for clock_gettime. * config.h.in: Regenerate. * configure: Likewise. * ztest.c (average_time, test_large): Conditionalize test timing on clock_gettime availability. From-SVN: r253344
2017-09-29re PR other/67165 (please enable libbacktrace to work with compressed debug ↵Ian Lance Taylor1-0/+446
sections) PR other/67165 * elf.c (__builtin_prefetch): Define if not __GNUC__. (unlikely): Define. (SHF_UNCOMPRESSED, ELFCOMPRESS_ZLIB): Define. (b_elf_chdr): Define type. (enum debug_section): Add ZDEBUG_xxx values. (debug_section_names): Add names for new sections. (struct debug_section_info): Add compressed field. (elf_zlib_failed, elf_zlib_fetch): New static functions. (HUFFMAN_TABLE_SIZE, HUFFMAN_VALUE_MASK): Define. (HUFFMAN_BITS_SHIFT, HUFFMAN_BITS_MASK): Define. (HUFFMAN_SECONDARY_SHIFT): Define. (ZDEBUG_TABLE_SIZE): Define. (ZDEBUG_TABLE_CODELEN_OFFSET, ZDEBUG_TABLE_WORK_OFFSET): Define. (final_next_secondary): New static variable if BACKTRACE_GENERATE_FIXED_HUFFMAN_TABLE. (elf_zlib_inflate_table): New static function. (BACKTRACE_GENERATE_FIXED_HUFFMAN_TABLE): If define, define main function to produce fixed Huffman table. (elf_zlib_default_table): New static variable. (elf_zlib_inflate): New static function. (elf_zlib_verify_checksum): Likewise. (elf_zlib_inflate_and_verify): Likewise. (elf_uncompress_zdebug): Likewise. (elf_uncompress_chdr): Likewise. (backtrace_uncompress_zdebug): New extern function. (elf_add): Look for .zdebug sections and SHF_COMPRESSED debug sections, and uncompress them. * internal.h (backtrace_compress_zdebug): Declare. * ztest.c: New file. * configure.ac: Check for -lz and check whether the linker supports --compress-debug-sections. * Makefile.am (ztest_SOURCES): New variable. (ztest_CFLAGS, ztest_LDADD): New variables. (check_PROGRAMS): Add ztest. (ctestg_SOURCES): New variable. (ctestg_CFLAGS, ctestg_LDFLAGS, ctestg_LDADD): New variables. (ctesta_SOURCES): New variable. (ctesta_CFLAGS, ctesta_LDFLAGS, ctesta_LDADD): New variables. (check_PROGRAMS): Add ctestg and ctesta. * configure, config.h.in, Makefile.in: Rebuild. From-SVN: r253275