1 2019-02-26 Tom de Vries <tdevries@suse.de>
3 * Makefile.am (TESTS): Only add b3test_dwz_buildid if HAVE_DWZ.
4 * Makefile.in: Regenerate.
6 2019-02-12 Tom de Vries <tdevries@suse.de>
9 * dwarf.c (dwarf_lookup_pc): Don't call bsearch if nmemb == 0.
11 2019-02-10 Tom de Vries <tdevries@suse.de>
13 * Makefile.am (BUILDTESTS): Add btest_lto.
14 * Makefile.in: Regenerate.
15 * btest.c (test1, f2, f3, test3, f22, f23): Declare with
16 __attribute__((noclone)).
18 2019-02-08 Tom de Vries <tdevries@suse.de>
20 * backtrace.c (backtrace_full): Declare with __attribute__((noinline)).
21 * print.c (backtrace_print): Same.
22 * simple.c (backtrace_simple): Same.
24 2019-02-08 Tom de Vries <tdevries@suse.de>
27 * dwarf.c (build_address_map): Keep all parsed units.
28 (read_referenced_name_from_attr): Handle DW_FORM_ref_addr.
30 2019-01-31 Tom de Vries <tdevries@suse.de>
33 * elf.c (elf_add): Read build-id if with_buildid_data. Fix
34 'debugaltlink_name_len =+ 1'.
36 2019-01-29 Tom de Vries <tdevries@suse.de>
38 * install-debuginfo-for-buildid.sh.in: New script.
39 * Makefile.am (check_PROGRAMS): Add b2test and b3test.
40 (TESTS): Add b2test_buildid and b3test_dwz_buildid.
41 * Makefile.in: Regenerate.
42 * configure.ac (HAVE_ELF): Set with AM_CONDITIONAL.
43 (READELF): Set with AC_CHECK_PROG.
44 (install-debuginfo-for-buildid.sh): Generate with AC_CONFIG_FILES.
45 * configure: Regenerate.
46 * elf.c (SYSTEM_BUILD_ID_DIR): Factor out of ...
47 (elf_open_debugfile_by_buildid): ... here.
49 2019-01-29 Tom de Vries <tdevries@suse.de>
51 * Makefile.am: Replace check_PROGRAMS with BUILDTESTS, except for
53 (TESTS): Don't add check_PROGRAMS. Add BUILDTESTS.
54 (check_PROGRAMS): Add BUILDTESTS.
55 * Makefile.in: Regenerate.
57 2019-01-28 Tom de Vries <tdevries@suse.de>
59 * Makefile.am (xcoff_%.c): Generate sed result into temporary file.
60 Use $< to access prerequisite.
61 * Makefile.in: Regenerate.
63 2019-01-25 Nathan Sidwell <nathan@acm.org>
65 * elf.c (elf_add): Pass "" filename to recursive call with
68 2019-01-25 Tom de Vries <tdevries@suse.de>
70 * elf.c (elf_add): When handling .gnu_debugaltlink, call elf_add with
72 * Makefile.am (TESTS): Add btest_dwz_gnudebuglink.
73 * Makefile.in: Regenerate.
75 2019-01-25 Tom de Vries <tdevries@suse.de>
77 * Makefile.am: Rewrite dtest rule into "%_gnudebuglink" pattern rule.
78 (TESTS): Rename dtest to btest_gnudebuglink.
79 * Makefile.in: Regenerate.
81 2019-01-23 Tom de Vries <tdevries@suse.de>
83 * dwarf.c (struct unit): Use size_t for low_offset/high_offset fields.
84 (units_search, find_unit): Use size_t for offset.
85 (build_address_map): Use size_t for unit_offset.
87 2019-01-20 Gerald Pfeifer <gerald@pfeifer.com>
89 * allocfail.c (main): Increase portability of printf statement.
91 2019-01-18 Ian Lance Taylor <iant@golang.org>
94 * mmapio.c (backtrace_get_view): Change size parameter to
95 uint64_t. Check that value fits in size_t.
96 * read.c (backtrace_get_view): Likewise.
97 * internal.h (backtrace_get_view): Update declaration.
98 * elf.c (elf_add): Pass shstrhdr->sh_size to backtrace_get_view.
100 2019-01-17 Tom de Vries <tdevries@suse.de>
102 PR libbacktrace/82857
103 * configure.ac (DWZ): Set with AC_CHECK_PROG.
104 (HAVE_DWZ): Set with AM_CONDITIONAL.
105 * configure: Regenerate.
106 * Makefile.am (TESTS): Add btest_dwz.
107 * Makefile.in: Regenerate.
109 2019-01-17 Tom de Vries <tdevries@suse.de>
111 PR libbacktrace/82857
112 * dwarf.c (enum attr_val_encoding): Add ATTR_VAL_REF_ALT_INFO.
113 (read_attribute): Handle DW_FORM_GNU_ref_alt using
114 ATTR_VAL_REF_ALT_INFO.
115 (read_referenced_name_from_attr): Handle DW_FORM_GNU_ref_alt.
117 2019-01-17 Tom de Vries <tdevries@suse.de>
119 * dwarf.c (struct unit): Add low_offset and high_offset fields.
120 (struct unit_vector): New type.
121 (struct dwarf_data): Add units and units_counts fields.
122 (find_unit): New function.
123 (find_address_ranges): Add and handle unit_tag parameter.
124 (build_address_map): Add and handle units_vec parameter.
125 (build_dwarf_data): Pass units_vec to build_address_map. Store resulting
128 2019-01-17 Tom de Vries <tdevries@suse.de>
130 PR libbacktrace/82857
131 * dwarf.c (read_attribute): Handle DW_FORM_GNU_strp_alt
134 2019-01-17 Tom de Vries <tdevries@suse.de>
136 * dwarf.c (enum attr_val_encoding): Add ATTR_VAL_NONE.
137 (read_attribute): Add altlink parameter. Handle missing altlink for
138 DW_FORM_GNU_strp_alt and DW_FORM_GNU_ref_alt.
139 (find_address_ranges, build_address_map, build_dwarf_data): Add and
140 handle altlink parameter.
141 (read_referenced_name, read_function_entry): Add argument to
144 2019-01-17 Tom de Vries <tdevries@suse.de>
146 * dwarf.c (struct dwarf_data): Add altlink field.
147 (backtrace_dwarf_add): Add and handle fileline_altlink parameter.
148 * elf.c (elf_add): Add argument to backtrace_dwarf_add call.
149 (phdr_callback, backtrace_initialize): Add argument to elf_add calls.
150 * internal.h (backtrace_dwarf_add): Add fileline_altlink parameter.
151 * pecoff.c (coff_add): Add argument to backtrace_dwarf_add call.
152 * xcoff.c (xcoff_add): Same.
154 2019-01-17 Tom de Vries <tdevries@suse.de>
156 * internal.h (backtrace_dwarf_add): Add fileline_entry parameter.
157 * dwarf.c (backtrace_dwarf_add): Add and handle fileline_entry parameter.
158 * elf.c (elf_add): Add and handle fileline_entry parameter. Add
159 argument to backtrace_dwarf_add call.
160 (phdr_callback, backtrace_initialize): Add argument to elf_add calls.
161 * pecoff.c (coff_add): Add argument to backtrace_dwarf_add call.
162 * xcoff.c (xcoff_add): Same.
164 2019-01-17 Tom de Vries <tdevries@suse.de>
166 * elf.c (elf_add): Add and handle with_buildid_data and
167 with_buildid_size parameters. Handle .gnu_debugaltlink section.
168 (phdr_callback, backtrace_initialize): Add arguments to elf_add calls.
170 2019-01-16 Tom de Vries <tdevries@suse.de>
172 * dwarf.c (read_referenced_name_from_attr): New function. Factor out
174 (read_referenced_name): ... here, and ...
175 (read_function_entry): ... here.
177 2019-01-16 Tom de Vries <tdevries@suse.de>
179 * dwarf.c (read_referenced_name): Don't allow DW_AT_name to override any
181 (read_function_entry): Same. Don't allow name found via
182 DW_AT_abstract_origin or case DW_AT_specification to override linkage
185 2019-01-09 Sandra Loosemore <sandra@codesourcery.com>
189 * backtrace.h: Mechanically replace "can not" with "cannot".
191 2019-01-01 Jakub Jelinek <jakub@redhat.com>
193 Update copyright years.
195 2018-12-29 Gerald Pfeifer <gerald@pfeifer.com>
197 * Makefile.am (xcoff_%.c): Use an actual newline instead of \n
199 * Makefile.in: Regenerate.
201 2018-12-28 Tom de Vries <tdevries@suse.de>
203 * dwarf.c (build_address_map): Reuse unused units.
205 2018-12-28 Tom de Vries <tdevries@suse.de>
207 * dwarf.c (build_address_map): Simplify by removing local variable
210 2018-12-28 Ian Lance Taylor <iant@golang.org>
211 Tom de Vries <tdevries@suse.de>
213 PR libbacktrace/88063
214 * dwarf.c (free_unit_addrs_vector): Remove.
215 (build_address_map): Keep track of allocated units in vector. Free
216 allocated units and corresponding abbrevs upon failure. Remove now
217 redundant call to free_unit_addrs_vector. Free addrs vector upon
218 failure. Free allocated unit vector.
220 2018-12-28 Tom de Vries <tdevries@suse.de>
222 * dwarf.c (build_address_map): Free addrs vector upon failure.
224 2018-12-14 Tom de Vries <tdevries@suse.de>
227 * allocfail.sh: Remove "set -o pipefail".
229 2018-12-12 Tom de Vries <tdevries@suse.de>
231 * Makefile.am (TESTS): Add allocfail.sh.
232 (check_PROGRAMS): Add allocfail.
233 * Makefile.in: Regenerate.
234 * instrumented_alloc.c: New file. Redefine malloc and realloc.
236 * allocfail.c: New file.
237 * allocfail.sh: New file.
239 2018-11-30 Tom de Vries <tdevries@suse.de>
241 * Makefile.am (check_PROGRAMS): Add test_elf, test_xcoff_32,
242 test_xcoff_64, test_pecoff and test_unknown.
243 * Makefile.in: Regenerate.
244 * test_format.c: New file.
246 2018-11-30 Tom de Vries <tdevries@suse.de>
248 * Makefile.am : Add _with_alloc version for each test in
250 * Makefile.in: Regenerate.
252 2018-11-30 Tom de Vries <tdevries@suse.de>
254 * internal.h (backtrace_vector_free): New static inline fuction,
256 * dwarf.c (read_line_info): ... here.
258 2018-11-28 Tom de Vries <tdevries@suse.de>
260 * dwarf.c (read_abbrevs): Fix handling of abbrevs->abbrevs allocation
263 2018-11-27 Tom de Vries <tdevries@suse.de>
265 * mmap.c (backtrace_vector_release): Same.
266 * unittest.c (test1): Add check.
268 2018-11-27 Tom de Vries <tdevries@suse.de>
270 * alloc.c (backtrace_vector_release): Handle vec->size == 0 using free
272 * Makefile.am (check_PROGRAMS): Add unittest.
273 * Makefile.in: Regenerate.
274 * unittest.c: New file.
276 2018-11-22 Tom de Vries <tdevries@suse.de>
278 * dwarf.c (read_initial_length): Factor out of ...
279 (build_address_map, read_line_info): ... here.
281 2018-11-21 Tom de Vries <tdevries@suse.de>
283 * dwarf.c (read_string): Factor out of ...
284 (read_attribute, read_line_header, read_line_program): ... here.
286 2018-10-31 Joseph Myers <joseph@codesourcery.com>
289 * Makefile.am: Include multilib.am.
290 * configure.ac: Remove AC_PREREQ. Use AC_LANG_SOURCE.
291 * Makefile.in, aclocal.m4, config.h.in, configure: Regenerate.
293 2018-10-05 Ian Lance Taylor <iant@golang.org>
295 PR libbacktrace/87529
296 * backtrace.h: Document that backtrace_create_state should be
299 2018-08-05 Iain Buclaw <ibuclaw@gdcproject.org>
301 * configure.ac: Move define of HAVE_ZLIB into check for -lz.
302 * Makefile.in: Regenerate.
303 * config.h.in: Likewise.
304 * configure: Likewise.
306 2018-08-01 Tony Reix <tony.reix@atos.net>
308 * xcoff.c (struct xcoff_line, struct xcoff_line_vector): Remove.
309 (struct xcoff_func, struct xcoff_func_vector): New structs.
310 (xcoff_syminfo): Drop leading dot from symbol name.
311 (xcoff_line_compare, xcoff_line_search): Remove.
312 (xcoff_func_compare, xcoff_func_search): New static functions.
313 (xcoff_lookup_pc): Search function table.
314 (xcoff_add_line, xcoff_process_linenos): Remove.
315 (xcoff_initialize_fileline): Build function table.
317 2018-06-21 Denis Khalikov <d.khalikov@partner.samsung.com>
320 * elf.c (elf_add): Increase ".note.gnu.build-id" section size
321 checking up to 36 bytes.
323 2018-04-24 H.J. Lu <hongjiu.lu@intel.com>
325 * configure: Regenerated.
327 2018-04-19 Jakub Jelinek <jakub@redhat.com>
329 * configure: Regenerated.
331 2018-04-17 Ian Lance Taylor <iant@golang.org>
333 * backtrace.c: Revert last two changes. Don't call mmap
336 2018-04-17 Ian Lance Taylor <iant@golang.org>
338 * backtrace.c: Include backtrace-supported.h before checking
339 BACKTRACE_USES_MALLOC.
341 2018-04-17 Ian Lance Taylor <iant@golang.org>
343 * backtrace.c (backtrace_full): When testing whether we can
344 allocate memory, call mmap directly, and munmap the memory.
346 2018-04-04 Jakub Jelinek <jakub@redhat.com>
349 * elf.c (elf_zlib_fetch): Fix up predefined macro names in test for
350 big endian, only use 32-bit loads if endianity macros are predefined
351 and indicate big or little endian.
353 2018-02-14 Igor Tsimbalist <igor.v.tsimbalist@intel.com>
356 * configure: Regenerate.
358 2018-02-15 Jakub Jelinek <jakub@redhat.com>
361 * elf.c (SHT_PROGBITS): Undefine and define.
363 2018-02-14 Jakub Jelinek <jakub@redhat.com>
366 * elf.c (EM_PPC64, EF_PPC64_ABI): Undefine and define.
367 (struct elf_ppc64_opd_data): New type.
368 (elf_initialize_syminfo): Add opd argument, handle symbols
369 pointing into the PowerPC64 ELFv1 .opd section.
370 (elf_add): Read .opd section on PowerPC64 ELFv1, pass pointer
371 to structure with .opd data to elf_initialize_syminfo.
373 2018-01-31 Ian Lance Taylor <iant@golang.org>
375 * elf.c (elf_add): Close descriptor if we use a debugfile.
376 * btest.c (check_open_files): New static function.
377 (main): Call check_open_files.
379 2018-01-25 Ian Lance Taylor <iant@golang.org>
381 * elf.c (elf_open_debugfile_by_debuglink): Don't check CRC if the
383 (elf_add): Don't clear *found_sym and *found_dwarf if debuginfo.
385 2018-01-25 Ian Lance Taylor <iant@golang.org>
387 * pecoff.c (coff_add): Only release syms_view if it is valid.
389 2018-01-25 Ian Lance Taylor <iant@golang.org>
391 * pecoff.c (coff_add): Another memcpy -> coff_read4 fix.
393 2018-01-24 Ian Lance Taylor <iant@golang.org>
395 * pecoff.c (coff_add): Use coff_read4, not memcpy.
397 2018-01-24 Ian Lance Taylor <iant@golang.org>
400 * mmap.c (backtrace_free_locked): Don't put more than 16 entries
403 2018-01-19 Tony Reix <tony.reix@atos.net>
405 * xcoff.c (xcoff_incl_compare): New function.
406 (xcoff_incl_search): New function.
407 (xcoff_process_linenos): Use bsearch to find include file.
408 (xcoff_initialize_fileline): Sort include file information.
410 2018-01-16 Ian Lance Taylor <iant@golang.org>
412 * elf.c (codes) [GENERATE_FIXED_HUFFMAN_TABLE]: Fix size to be
414 (main) [GENERATE_FIXED_HUFFMAN_TABLE]: Pass 288 to
415 elf_zlib_inflate_table. Generate elf_zlib_default_dist_table.
416 (elf_zlib_default_table): Update.
417 (elf_zlib_default_dist_table): New static array.
418 (elf_zlib_inflate): Use elf_zlib_default_dist_table for dist table
420 * ztest.c (struct zlib_test): Add uncompressed_len.
421 (tests): Initialize uncompressed_len field. Add new test case.
422 (test_samples): Use uncompressed_len field.
424 2018-01-03 Jakub Jelinek <jakub@redhat.com>
426 Update copyright years.
428 2017-11-17 Igor Tsimbalist <igor.v.tsimbalist@intel.com>
430 * configure.ac: Add CET_FLAGS to EXTRA_FLAGS.
431 * aclocal.m4: Regenerate.
432 * Makefile.in: Likewise.
433 * configure: Likewise.
435 2017-10-06 Ian Lance Taylor <iant@golang.org>
437 * ztest.c (test_large): Pass unsigned long *, not size_t *, to
438 zlib uncompress function.
440 2017-10-05 Ian Lance Taylor <iant@golang.org>
442 * elf.c (elf_zlib_fetch): Change pval argument to uint64_t *.
443 Read a four byte integer.
444 (elf_zlib_inflate): Change val to uint64_t. Align pin to a 32-bit
445 boundary before ever calling elf_zlib_fetch.
446 * ztest.c (test_large): Simplify print statements a bit.
448 2017-10-02 Ian Lance Taylor <iant@golang.org>
450 * ztest.c: #include <errno.h>.
451 (TEST_TIMING): Don't define, don't test.
452 (xclock_gettime, xclockid_t): Define if !HAVE_CLOCK_GETTIME.
453 (clockid_t, clock_gettime, CLOCK_REALTIME): Likewise.
454 (ZLIB_CLOCK_GETTIME_ARG): Define.
455 * configure.ac: Change clock_gettime_link to CLOCK_GETTIME_LINK.
456 * Makefile.am: Likewise.
457 * configure, Makefile.in: Rebuild.
459 2017-10-02 Thomas Schwinge <thomas@codesourcery.com>
462 * Makefile.am: Append the content of clock_gettime_link to
464 * configure.ac: Test for the case that clock_gettime is in librt.
465 * Makefile.in: Regenerate.
466 * configure: Likewise.
469 * configure.ac: Check for clock_gettime.
470 * config.h.in: Regenerate.
471 * configure: Likewise.
472 * ztest.c (average_time, test_large): Conditionalize test timing
473 on clock_gettime availability.
475 2017-09-29 Tony Reix <tony.reix@atos.net>
477 * xcoff.c: Initial support for DWARF debug sections in XCOFF.
478 (STYP_DWARF, SSUBTYP_DW*): Define.
479 (enum dwarf_section): Define.
480 (struct dwsect_info): Define.
481 (xcoff_add): Look for DWARF sections, pass them to
484 2017-09-28 Ian Lance Taylor <iant@golang.org>
487 * elf.c (__builtin_prefetch): Define if not __GNUC__.
489 (SHF_UNCOMPRESSED, ELFCOMPRESS_ZLIB): Define.
490 (b_elf_chdr): Define type.
491 (enum debug_section): Add ZDEBUG_xxx values.
492 (debug_section_names): Add names for new sections.
493 (struct debug_section_info): Add compressed field.
494 (elf_zlib_failed, elf_zlib_fetch): New static functions.
495 (HUFFMAN_TABLE_SIZE, HUFFMAN_VALUE_MASK): Define.
496 (HUFFMAN_BITS_SHIFT, HUFFMAN_BITS_MASK): Define.
497 (HUFFMAN_SECONDARY_SHIFT): Define.
498 (ZDEBUG_TABLE_SIZE): Define.
499 (ZDEBUG_TABLE_CODELEN_OFFSET, ZDEBUG_TABLE_WORK_OFFSET): Define.
500 (final_next_secondary): New static variable if
501 BACKTRACE_GENERATE_FIXED_HUFFMAN_TABLE.
502 (elf_zlib_inflate_table): New static function.
503 (BACKTRACE_GENERATE_FIXED_HUFFMAN_TABLE): If define, define main
504 function to produce fixed Huffman table.
505 (elf_zlib_default_table): New static variable.
506 (elf_zlib_inflate): New static function.
507 (elf_zlib_verify_checksum): Likewise.
508 (elf_zlib_inflate_and_verify): Likewise.
509 (elf_uncompress_zdebug): Likewise.
510 (elf_uncompress_chdr): Likewise.
511 (backtrace_uncompress_zdebug): New extern function.
512 (elf_add): Look for .zdebug sections and SHF_COMPRESSED debug
513 sections, and uncompress them.
514 * internal.h (backtrace_compress_zdebug): Declare.
516 * configure.ac: Check for -lz and check whether the linker
517 supports --compress-debug-sections.
518 * Makefile.am (ztest_SOURCES): New variable.
519 (ztest_CFLAGS, ztest_LDADD): New variables.
520 (check_PROGRAMS): Add ztest.
521 (ctestg_SOURCES): New variable.
522 (ctestg_CFLAGS, ctestg_LDFLAGS, ctestg_LDADD): New variables.
523 (ctesta_SOURCES): New variable.
524 (ctesta_CFLAGS, ctesta_LDFLAGS, ctesta_LDADD): New variables.
525 (check_PROGRAMS): Add ctestg and ctesta.
526 * configure, config.h.in, Makefile.in: Rebuild.
528 2017-09-22 Ian Lance Taylor <iant@golang.org>
531 * configure.ac: Check for lstat and readlink.
532 * elf.c (lstat, readlink): Provide dummy versions if real versions
534 * configure, config.h.in: Rebuild.
536 2017-09-21 Ian Lance Taylor <iant@google.com>
539 * elf.c (backtrace_initialize): Set pd.exe_filename.
541 2017-09-20 Ian Lance Taylor <iant@golang.org>
542 Denis Khalikov <d.khalikov@partner.samsung.com>
545 Support for external debug info.
546 * elf.c: Include <errno.h>, <sys/stat.h>, <unistd.h>.
547 (S_ISLNK): Define if not defined.
548 (xstrnlen): Define if strnlen is not available.
549 (b_elf_note): Define type.
550 (NT_GNU_BUILD_ID): Define macro.
551 (elf_crc32, elf_crc32_file): New static functions.
552 (elf_is_symlink, elf_readlink): New static functions.
553 (elf_open_debugfile_by_buildid): New static function.
554 (elf_try_debugfile): New static function.
555 (elf_find_debugfile_by_debuglink): New static function.
556 (elf_open_debugfile_by_debuglink): New static function.
557 (elf_add): Add filename and debuginfo parameters. Adjust all
558 callers. Look for external debug info notes, and try to fetch
559 debug info from external file.
560 (struct phdr_data): Add exe_filename field.
561 (phdr_callback): Pass filename to elf_add.
562 (backtrace_initialize): Add filename parameter.
563 * internal.h (backtrace_initialize): Add filename parameter.
564 * fileline.c (fileline_initialize): Pass filename to
565 backtrace_initialize.
566 * pecoff.c (fileline_initialize): Add unused filename parameter.
567 * unknown.c (fileline_initialize): Likewise.
568 * xcoff.c (fileline_initialize): Likewise.
569 * configure.ac: Check for objcopy --add-gnu-debuglink.
570 * Makefile.am (dtest): New test target.
571 * configure, Makefile.in: Rebuild.
573 2017-09-12 Steve Ellcey <sellcey@cavium.com>
576 * Makefile.am (ttest_CFLAGS): Add $(AM_CFLAGS)
577 * Makefile.in: Regenerate.
579 2017-09-12 Steve Ellcey <sellcey@cavium.com>
582 * libbacktrace/Makefile.in
583 (HAVE_PTHREAD_TRUE@@NATIVE_TRUE@ttest_CFLAGS): Add $(AM_CFLAGS)
585 2017-08-02 David Edelsohn <dje.gcc@gmail.com>
588 * xcoff.c (xcoff_process_linenos): Initialize incl to NULL.
590 2017-07-28 Tony Reix <tony.reix@atos.net>
592 * xcoff.c: Don't leak a file descriptor if an archive is malformed.
594 2017-07-28 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
596 * fileline.c (fileline_initialize): Print pid_t as long.
598 2017-07-26 Tony Reix <tony.reix@atos.net>
600 * configure.ac: Check for XCOFF32/XCOFF64. Check for loadquery.
601 * filetype.awk: Separate AIX XCOFF32 and XCOFF64.
602 * xcoff.c: Add support for AIX XCOFF32 and XCOFF64 formats.
603 * configure, config.h.in: Regenerate.
605 2017-07-21 Tony Reix <tony.reix@atos.net>
607 * filetype.awk: Add AIX XCOFF type detection.
608 * configure.ac: Recognize xcoff format.
609 * Makefile.am (FORMAT_FILES): Add xcoff.c.
610 * fileline.c: Include <unistd.h>.
611 (fileline_initialize): Add case for AIX procfs.
613 * configure, Makefile.in: Rebuild.
615 2017-06-21 Richard Biener <rguenther@suse.de>
617 * configure.ac: Add AC_SYS_LARGEFILE.
618 * config.h.in: Regenerate.
619 * configure: Likewise.
621 2017-06-11 Ian Lance Taylor <iant@golang.org>
623 * elf.c (backtrace_initialize): Always set *fileline_fn.
625 * btest.c: Move support functions into testlib.c. Change calls to
626 check to pass file name.
627 * testlib.c: New file, copied from (part of) btest.c.
628 * testlib.h: New file, declarations for testlib.c.
629 * edtest.c: Use testlib.h and testlib.c.
630 * configure.ac: Test for -pthread, set HAVE_PTHREAD conditional.
631 * Makefile.am (btest_SOURCES): Add testlib.c.
632 (edtest_SOURCES): Likewise.
633 (CHECK_PROGRAMS): Add ttest if HAVE_PTHREAD.
634 (ttest_SOURCES, ttest_CFLAGS, ttest_LDADD): Define.
635 * configure, Makefile.in: Rebuild.
637 2017-05-19 Than McIntosh <thanm@google.com>
639 * dwarf.c (free_line_header): Don't free dirs if dirs_count == 0.
640 (read_line_header): Don't allocate dirs if dirs_count == 0.
641 * edtest.c: New file.
642 * edtest2.c: New file.
643 * Makefile.am (edtest_SOURCES, edtest_LDADD): Define.
644 (check_PROGRAMS): Add edtest.
645 (edtest2_build.c, gen_edtest2_build): New targets.
646 * Makefile.in: Rebuild.
648 2017-03-08 Sam Thursfield <sam.thursfield@codethink.co.uk>
650 * btest.c (test5): Replace #ifdef guard with 'unused' attribute
651 to fix compile warning when BACKTRACE_SUPPORTED isn't defined.
653 2017-01-01 Jakub Jelinek <jakub@redhat.com>
655 Update copyright years.
657 2016-11-15 Matthias Klose <doko@ubuntu.com>
659 * configure: Regenerate.
661 2016-09-11 Carlos Liam <carlos@aarzee.me>
663 * all: Remove meaningless trailing whitespace.
665 2016-05-18 Uros Bizjak <ubizjak@gmail.com>
668 * elf.c (phdr_callback) [__i386__]: Add
669 __attribute__((__force_align_arg_pointer__)).
671 2016-03-02 Maxim Ostapenko <m.ostapenko@partner.samsung.com>
673 * elf.c (backtrace_initialize): Properly initialize elf_fileline_fn to
674 avoid possible crash.
675 (elf_add): Don't set *fileline_fn to elf_nodebug value in case of
676 missing debug info anymore.
678 2016-02-06 John David Anglin <danglin@gcc.gnu.org>
680 * mmap.c (MAP_FAILED): Define if not defined.
682 2016-01-04 Jakub Jelinek <jakub@redhat.com>
684 Update copyright years.
686 2015-12-18 Andris Pavenis <andris.pavenis@iki.fi>
688 * configure.ac: Specify that DJGPP do not have mmap
689 even when sys/mman.h exists.
690 * configure: Regenerate
692 2015-12-09 John David Anglin <danglin@gcc.gnu.org>
695 * configure.ac: Set libbacktrace_cv_sys_sync to no on hppa*-*-hpux*.
696 * configure: Regenerate.
697 * elf.c (backtrace_initialize): Cast __sync_bool_compare_and_swap call
700 2015-09-17 Ian Lance Taylor <iant@google.com>
702 * posix.c (backtrace_open): Cast second argument of open() to int.
704 2015-09-11 Ian Lance Taylor <iant@google.com>
706 * Makefile.am (backtrace.lo): Depend on internal.h.
707 (sort.lo, stest.lo): Add explicit dependencies.
708 * Makefile.in: Rebuild.
710 2015-09-09 Hans-Peter Nilsson <hp@axis.com>
712 * backtrace.c: #include <sys/types.h>.
714 2015-09-08 Ian Lance Taylor <iant@google.com>
717 * backtrace.c: #include "internal.h".
718 (struct backtrace_data): Add can_alloc field.
719 (unwind): If can_alloc is false, don't try to get file/line
721 (backtrace_full): Set can_alloc field in bdata.
722 * alloc.c (backtrace_alloc): Don't call error_callback if it is
724 * mmap.c (backtrace_alloc): Likewise.
725 * internal.h: Update comments for backtrace_alloc and
728 2015-09-08 Ian Lance Taylor <iant@google.com>
731 * mmap.c (backtrace_alloc): Correct test for mmap failure.
733 2015-08-31 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
735 * configure.ac: For spu-*-* targets, set have_fcntl to no.
736 * configure: Regenerate.
738 2015-08-27 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
740 * configure.ac: Remove [disable-shared] argument to LT_INIT.
741 Remove setting PIC_FLAG when building as target library.
742 * configure: Regenerate.
744 2015-08-26 Hans-Peter Nilsson <hp@axis.com>
746 * configure.ac: Only compile with -fPIC if the target
748 * configure: Regenerate.
750 2015-08-24 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
752 * configure.ac: Set have_mmap to no on spu-*-* targets.
753 * configure: Regenerate.
755 2015-08-13 Ian Lance Taylor <iant@google.com>
757 * dwarf.c (read_function_entry): Add vec_inlined parameter.
760 2015-06-11 Martin Sebor <msebor@redhat.com>
763 * dwarf.c (struct line): Add new field idx.
764 (line_compare): Use it.
766 (read_line_info): Reset it.
768 2015-05-29 Tristan Gingold <gingold@adacore.com>
770 * pecoff.c: New file.
771 * Makefile.am (FORMAT_FILES): Add pecoff.c and dependencies.
772 * Makefile.in: Regenerate.
773 * filetype.awk: Detect pecoff.
774 * configure.ac: Define BACKTRACE_SUPPORTS_DATA on elf platforms.
776 * btest.c (test5): Test enabled only if BACKTRACE_SUPPORTS_DATA is
778 * backtrace-supported.h.in (BACKTRACE_SUPPORTS_DATA): Define.
779 * configure: Regenerate.
780 * pecoff.c: New file.
782 2015-05-13 Michael Haubenwallner <michael.haubenwallner@ssi-schaefer.com>
784 * Makefile.in: Regenerated with automake-1.11.6.
785 * aclocal.m4: Likewise.
786 * configure: Likewise.
788 2015-01-24 Matthias Klose <doko@ubuntu.com>
790 * configure.ac: Move AM_ENABLE_MULTILIB before AC_PROG_CC.
791 * configure: Regenerate.
793 2015-01-05 Jakub Jelinek <jakub@redhat.com>
795 Update copyright years.
797 2014-11-21 H.J. Lu <hongjiu.lu@intel.com>
800 * configure: Regenerated.
802 2014-11-11 David Malcolm <dmalcolm@redhat.com>
804 * ChangeLog.jit: New.
806 2014-11-11 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
809 * configure: Regenerate.
811 2014-10-23 Ian Lance Taylor <iant@google.com>
813 * internal.h (backtrace_atomic_load_pointer) [no atomic or sync]:
814 Fix to return void *.
816 2014-05-08 Ian Lance Taylor <iant@google.com>
818 * mmap.c (backtrace_free): If freeing a large aligned block of
819 memory, call munmap rather than holding onto it.
820 (backtrace_vector_grow): When growing a vector, double the number
821 of pages requested. When releasing the old version of a grown
822 vector, pass the correct size to backtrace_free.
824 2014-03-07 Ian Lance Taylor <iant@google.com>
826 * sort.c (backtrace_qsort): Use middle element as pivot.
828 2014-03-06 Ian Lance Taylor <iant@google.com>
832 * internal.h (backtrace_qsort): Declare.
833 * dwarf.c (read_abbrevs): Call backtrace_qsort instead of qsort.
834 (read_line_info, read_function_entry): Likewise.
835 (read_function_info, build_dwarf_data): Likewise.
836 * elf.c (elf_initialize_syminfo): Likewise.
837 * Makefile.am (libbacktrace_la_SOURCES): Add sort.c.
838 (stest_SOURCES, stest_LDADD): Define.
839 (check_PROGRAMS): Add stest.
841 2014-02-07 Misty De Meo <misty@brew.sh>
844 * configure.ac: Use AC_LINK_IFELSE in check for
846 * configure: Regenerate.
848 2014-01-02 Richard Sandiford <rdsandiford@googlemail.com>
850 Update copyright years
852 2013-12-06 Jakub Jelinek <jakub@redhat.com>
854 * elf.c (ET_DYN): Undefine and define again.
855 (elf_add): Add exe argument, if true and ehdr.e_type is ET_DYN,
856 return early -1 without closing the descriptor.
857 (struct phdr_data): Add exe_descriptor.
858 (phdr_callback): If pd->exe_descriptor is not -1, for very first
859 call if dlpi_name is NULL just call elf_add with the exe_descriptor,
860 otherwise backtrace_close the exe_descriptor if not -1. Adjust
862 (backtrace_initialize): Adjust call to elf_add. If it returns
863 -1, set pd.exe_descriptor to descriptor, otherwise set it to -1.
865 2013-12-05 Ian Lance Taylor <iant@google.com>
867 * alloc.c (backtrace_vector_finish): Add error_callback and data
868 parameters. Call backtrace_vector_release. Return address base.
869 * mmap.c (backtrace_vector_finish): Add error_callback and data
870 parameters. Return address base.
871 * dwarf.c (read_function_info): Get new address base from
872 backtrace_vector_finish.
873 * internal.h (backtrace_vector_finish): Update declaration.
875 2013-11-27 Ian Lance Taylor <iant@google.com>
877 * dwarf.c (find_address_ranges): New static function, broken out
878 of build_address_map.
879 (build_address_map): Call it.
880 * btest.c (check): Check for missing filename or function, rather
882 (f3): Check that enough frames were returned.
884 2013-11-19 Jakub Jelinek <jakub@redhat.com>
886 * backtrace.h (backtrace_syminfo_callback): Add symsize argument.
887 * elf.c (elf_syminfo): Pass 0 or sym->size to the callback as
889 * btest.c (struct symdata): Add size field.
890 (callback_three): Add symsize argument. Copy it to the data->size
892 (f23): Set symdata.size to 0.
893 (test5): Likewise. If sizeof (int) > 1, lookup address of
894 ((uintptr_t) &global) + 1. Verify symdata.val and symdata.size
897 * atomic.c: Include sys/types.h.
899 2013-11-18 Ian Lance Taylor <iant@google.com>
901 * configure.ac: Check for support of __atomic extensions.
902 * internal.h: Declare or #define atomic functions for use in
904 * atomic.c: New file.
905 * dwarf.c (dwarf_lookup_pc): Use atomic functions.
906 (dwarf_fileline, backtrace_dwarf_add): Likewise.
907 * elf.c (elf_add_syminfo_data, elf_syminfo): Likewise.
908 (backtrace_initialize): Likewise.
909 * fileline.c (fileline_initialize): Likewise.
910 * Makefile.am (libbacktrace_la_SOURCES): Add atomic.c.
911 * configure, config.h.in, Makefile.in: Rebuild.
913 2013-11-18 Jakub Jelinek <jakub@redhat.com>
915 * elf.c (SHN_UNDEF): Define.
916 (elf_initialize_syminfo): Add base_address argument. Ignore symbols
917 with st_shndx == SHN_UNDEF. Add base_address to address fields.
918 (elf_add): Adjust caller.
920 * elf.c (phdr_callback): Process info->dlpi_addr == 0 normally.
922 2013-11-16 Ian Lance Taylor <iant@google.com>
924 * backtrace.h (backtrace_create_state): Correct comment about
927 2013-11-15 Ian Lance Taylor <iant@google.com>
929 * backtrace.h (backtrace_syminfo): Update comment and parameter
930 name to take any address, not just a PC value.
931 * elf.c (STT_OBJECT): Define.
932 (elf_nosyms): Rename parameter pc to addr.
933 (elf_symbol_search): Rename local variable pc to addr.
934 (elf_initialize_syminfo): Add STT_OBJECT symbols to elf_symbols.
935 (elf_syminfo): Rename parameter pc to addr.
936 * btest.c (global): New global variable.
940 2013-10-17 Ian Lance Taylor <iant@google.com>
942 * elf.c (elf_add): Don't get the wrong offsets if a debug section
945 2013-10-15 David Malcolm <dmalcolm@redhat.com>
947 * configure.ac: Add --enable-host-shared, setting up
948 pre-existing PIC_FLAG variable within Makefile.am et al.
949 * configure: Regenerate.
951 2013-09-20 Alan Modra <amodra@gmail.com>
953 * configure: Regenerate.
955 2013-07-23 Alexander Monakov <amonakov@ispras.ru>
957 * elf.c (elf_syminfo): Loop over the elf_syminfo_data chain.
959 2013-07-23 Alexander Monakov <amonakov@ispras.ru>
961 * elf.c (backtrace_initialize): Pass elf_fileline_fn to
962 dl_iterate_phdr callbacks.
964 2013-03-25 Ian Lance Taylor <iant@google.com>
966 * alloc.c: #include <sys/types.h>.
969 2013-01-31 Ian Lance Taylor <iant@google.com>
971 * dwarf.c (read_function_info): Permit fvec parameter to be NULL.
972 (dwarf_lookup_pc): Don't use ddata->fvec if threaded.
974 2013-01-25 Jakub Jelinek <jakub@redhat.com>
977 * dwarf.c (read_line_header): Don't crash if DW_AT_comp_dir
978 attribute was not seen.
980 2013-01-16 Ian Lance Taylor <iant@google.com>
982 * dwarf.c (struct unit): Add filename and abs_filename fields.
983 (build_address_map): Set new fields when reading unit.
984 (dwarf_lookup_pc): If we don't find an entry in the line table,
985 just return the main file name.
987 2013-01-14 Richard Sandiford <rdsandiford@googlemail.com>
989 Update copyright years.
991 2013-01-01 Ian Lance Taylor <iant@google.com>
994 * Makefile.am (AM_CPPFLAGS): Remove -I ../gcc/include and -I
995 $(MULTIBUILDTOP)/../../gcc/include.
996 * Makefile.in: Rebuild.
998 2013-01-01 Ian Lance Taylor <iant@google.com>
1001 * mmap.c (backtrace_alloc): Don't call sync functions if not
1003 (backtrace_free): Likewise.
1005 2012-12-12 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
1007 * mmapio.c: Define MAP_FAILED if not defined.
1009 2012-12-11 Jakub Jelinek <jakub@redhat.com>
1012 * Makefile.am (AM_CFLAGS): Remove -frandom-seed=$@.
1013 * configure.ac: If --with-target-subdir, add -frandom-seed=$@
1014 to EXTRA_FLAGS unconditionally, otherwise check whether the compiler
1016 * Makefile.in: Regenerated.
1017 * configure: Regenerated.
1019 2012-12-07 Jakub Jelinek <jakub@redhat.com>
1022 * Makefile.am (AM_CFLAGS): Add -frandom-seed=$@.
1023 * Makefile.in: Regenerated.
1025 2012-11-20 Ian Lance Taylor <iant@google.com>
1027 * dwarf.c (read_attribute): Always clear val.
1029 2012-11-13 Ian Lance Taylor <iant@google.com>
1032 * configure.ac: Only add -Werror if building a target library.
1033 * configure: Rebuild.
1035 2012-11-12 Ian Lance Taylor <iant@google.com>
1036 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
1037 Gerald Pfeifer <gerald@pfeifer.com>
1039 * configure.ac: Check for getexecname.
1040 * fileline.c: #include <errno.h>. Define getexecname if not
1042 (fileline_initialize): Try to find the executable in a few
1044 * print.c (error_callback): Only print the filename if it came
1045 from the backtrace state.
1046 * configure, config.h.in: Rebuild.
1048 2012-10-29 Ian Lance Taylor <iant@google.com>
1050 * mmap.c (backtrace_vector_release): Correct last patch: add
1053 2012-10-29 Ian Lance Taylor <iant@google.com>
1055 * mmap.c (backtrace_vector_release): Make sure freed block is
1056 aligned on 8-byte boundary.
1058 2012-10-26 Ian Lance Taylor <iant@google.com>
1061 * posix.c (backtrace_open): Add does_not_exist parameter.
1062 * elf.c (phdr_callback): Do not warn if shared library could not
1064 * fileline.c (fileline_initialize): Update calls to
1066 * internal.h (backtrace_open): Update declaration.
1068 2012-10-26 Jack Howarth <howarth@bromo.med.uc.edu>
1071 * configure.ac: Check for _Unwind_GetIPInfo function declaration.
1072 * configure: Regenerate.
1074 2012-10-24 Ian Lance Taylor <iant@google.com>
1077 * configure.ac: Check whether -funwind-tables option works.
1078 * configure: Rebuild.
1080 2012-10-11 Ian Lance Taylor <iant@google.com>
1082 * configure.ac: Do not use dl_iterate_phdr on Solaris 10.
1083 * configure: Rebuild.
1085 2012-10-10 Ian Lance Taylor <iant@google.com>
1087 * elf.c: Rename all Elf typedefs to start with b_elf, and be all
1090 2012-10-10 Hans-Peter Nilsson <hp@bitrange.com>
1092 * elf.c (elf_add_syminfo_data): Add casts to avoid warning.
1094 2012-10-09 Ian Lance Taylor <iant@google.com>
1096 * dwarf.c (dwarf_fileline): Add cast to avoid warning.
1097 (backtrace_dwarf_add): Likewise.
1099 2012-10-09 Ian Lance Taylor <iant@google.com>
1101 Add support for tracing through shared libraries.
1102 * configure.ac: Check for link.h and dl_iterate_phdr.
1103 * elf.c: #include <link.h> if system has dl_iterate_phdr. #undef
1104 ELF macros before #defining them.
1105 (dl_phdr_info, dl_iterate_phdr): Define if system does not have
1107 (struct elf_syminfo_data): Add next field.
1108 (elf_initialize_syminfo): Initialize next field.
1109 (elf_add_syminfo_data): New static function.
1110 (elf_add): New static function, broken out of
1111 backtrace_initialize. Call backtrace_dwarf_add instead of
1112 backtrace_dwarf_initialize.
1113 (struct phdr_data): Define.
1114 (phdr_callback): New static function.
1115 (backtrace_initialize): Call elf_add.
1116 * dwarf.c (struct dwarf_data): Add next and base_address fields.
1117 (add_unit_addr): Add base_address parameter. Change all callers.
1118 (add_unit_ranges, build_address_map): Likewise.
1119 (add_line): Add ddata parameter. Change all callers.
1120 (read_line_program, add_function_range): Likewise.
1121 (dwarf_lookup_pc): New static function, broken out of
1123 (dwarf_fileline): Call dwarf_lookup_pc.
1124 (build_dwarf_data): New static function.
1125 (backtrace_dwarf_add): New function.
1126 (backtrace_dwarf_initialize): Remove.
1127 * internal.h (backtrace_dwarf_initialize): Don't declare.
1128 (backtrace_dwarf_add): Declare.
1129 * configure, config.h.in: Rebuild.
1131 2012-10-04 Gerald Pfeifer <gerald@pfeifer.com>
1133 * btest.c (f23): Avoid uninitialized variable warning.
1135 2012-10-04 Ian Lance Taylor <iant@google.com>
1137 * dwarf.c: If the system header files do not declare strnlen,
1138 provide our own version.
1140 2012-10-03 Ian Lance Taylor <iant@google.com>
1142 * dwarf.c (read_uleb128): Fix overflow test.
1143 (read_sleb128): Likewise.
1144 (build_address_map): Don't change unit_buf.start.
1146 2012-10-02 Uros Bizjak <ubizjak@gmail.com>
1149 * configure.ac (EXTRA_FLAGS): New.
1150 * Makefile.am (AM_FLAGS): Add $(EXTRA_FLAGS).
1151 * configure, Makefile.in: Regenerate.
1153 2012-09-29 Ian Lance Taylor <iant@google.com>
1156 * fileline.c (fileline_initialize): Pass errnum as -1 when
1157 reporting that we could not read executable information after a
1160 2012-09-27 Ian Lance Taylor <iant@google.com>
1163 * configure.ac: Add no-dependencies to AM_INIT_AUTOMAKE.
1164 * Makefile.am: Add dependencies for all objects.
1165 * configure, aclocal.m4, Makefile.in: Rebuild.
1167 2012-09-27 Ian Lance Taylor <iant@google.com>
1170 * elf.c (backtrace_initialize): Set *fileln_fn, not
1173 2012-09-19 Ian Lance Taylor <iant@google.com>
1175 * configure.ac: Only use GCC_CHECK_UNWIND_GETIPINFO when compiled
1176 as a target library.
1177 * configure: Rebuild.
1179 2012-09-19 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
1180 Ian Lance Taylor <iant@google.com>
1182 * configure.ac (GCC_HEADER_STDINT): Invoke.
1183 * backtrace.h: If we can't find <stdint.h>, use "gstdint.h".
1184 * btest.c: Don't include <stdint.h>.
1185 * dwarf.c: Likewise.
1186 * configure, aclocal.m4, Makefile.in, config.h.in: Rebuild.
1188 2012-09-18 Ian Lance Taylor <iant@google.com>
1191 * Makefile.am (AM_CPPFLAGS): Define.
1192 (AM_CFLAGS): Remove -I options.
1193 * Makefile.in: Rebuild.
1195 2012-09-18 Ian Lance Taylor <iant@google.com>
1197 * posix.c (O_BINARY): Define if not defined.
1198 (backtrace_open): Pass O_BINARY to open. Only call fcntl if
1199 HAVE_FCNTL is defined.
1200 * configure.ac: Test for the fcntl function.
1201 * configure, config.h.in: Rebuild.
1203 2012-09-18 Ian Lance Taylor <iant@google.com>
1205 * btest.c (test1, test2, test3, test4): Add the unused attribute.
1207 2012-09-18 Ian Lance Taylor <iant@google.com>
1209 * dwarf.c: Correct test of HAVE_DECL_STRNLEN.
1211 2012-09-18 Ian Lance Taylor <iant@google.com>
1213 * configure.ac: Add AC_USE_SYSTEM_EXTENSIONS.
1214 * mmapio.c: Don't define _GNU_SOURCE.
1215 * configure, config.h.in: Rebuild.
1217 2012-09-18 Ian Lance Taylor <iant@google.com>
1219 * configure.ac: Check whether strnlen is declared.
1220 * dwarf.c: Declare strnlen if not declared.
1221 * configure, config.h.in: Rebuild.
1223 2012-09-18 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
1225 * fileline.c: Include <stdlib.h>.
1228 2012-09-17 Ian Lance Taylor <iant@google.com>
1231 * nounwind.c (backtrace_full): Rename from backtrace. Add state
1234 2012-09-17 Gerald Pfeifer <gerald@pfeifer.com>
1237 * nounwind.c (backtrace_simple): Add state parameter.
1239 2012-09-17 Ian Lance Taylor <iant@google.com>
1242 * unknown.c (unknown_fileline): Add state parameter, remove
1243 fileline_data parameter, name error_callback parameter.
1244 (backtrace_initialize): Add state parameter.
1246 2012-09-17 Ian Lance Taylor <iant@google.com>
1248 * Initial implementation.
1250 Copyright (C) 2012-2019 Free Software Foundation, Inc.
1252 Copying and distribution of this file, with or without modification,
1253 are permitted in any medium without royalty provided the copyright
1254 notice and this notice are preserved.