1 2021-03-03 Ian Lance Taylor <iant@golang.org>
3 * dwarf.c (read_line_program): Don't special case file 0.
4 (read_function_entry): Likewise.
6 2021-03-02 Ian Lance Taylor <iant@golang.org>
9 * dwarf.c (dwarf_buf_error): Add errnum parameter. Change all
11 * backtrace.h: Update backtrace_error_callback comment.
13 2021-02-12 Ian Lance Taylor <iant@golang.org>
15 * configure.ac: Check for objcopy --add-gnu-debuglink by using
17 * configure: Regenerate
19 2021-01-18 Ian Lance Taylor <iant@golang.org>
21 * Makefile.am (%_dwz): If dwz fails, use uncompressed debug info.
22 * Makefile.in: Regenerate.
23 * configure: Regenerate.
25 2021-01-18 Ian Lance Taylor <iant@golang.org>
28 * dwarf.c (read_v2_paths): Allocate zero entry for dirs and
30 (read_line_program): Remove parameter u, change caller. Don't
31 subtract one from dirs and filenames index.
32 (read_function_entry): Don't subtract one from filenames index.
34 2021-01-05 Samuel Thibault <samuel.thibault@ens-lyon.org>
36 * configure: Re-generate.
38 2020-12-05 Iain Sandoe <iain@sandoe.co.uk>
41 * configure: Regenerate.
43 2020-12-02 Ian Lance Taylor <iant@golang.org>
45 * dwarf.c (resolve_string): Use > rather than >= to check whether
46 string index extends past buffer.
47 (resolve_addr_index): Similarly for address index.
49 2020-11-29 John David Anglin <danglin@gcc.gnu.org>
51 * configure: Regenerate.
53 2020-10-20 Ian Lance Taylor <iant@golang.org>
55 * internal.h (ATTRIBUTE_FALLTHROUGH): Define.
56 * elf.c (elf_zlib_inflate): Use ATTRIBUTE_FALLTHROUGH.
58 2020-09-28 Ian Lance Taylor <iant@golang.org>
61 * Makefile.am (check_DATA): Add mtest.dSYM if USE_DSYMUTIL.
62 * Makefile.in: Regenerate.
64 2020-09-28 Ian Lance Taylor <iant@golang.org>
67 * configure.ac (USE_DSYMUTIL): Define instead of HAVE_DSYMUTIL.
68 * Makefile.am: Change all uses of HAVE_DSYMUTIL to USE_DSYMUTIL.
69 * configure: Regenerate.
70 * Makefile.in: Regenerate.
72 2020-09-23 Ian Lance Taylor <iant@golang.org>
74 * dwarf.c (report_inlined_functions): Handle PC == -1 and PC ==
76 (dwarf_lookup_pc): Likewise.
78 2020-09-17 Ian Lance Taylor <iant@golang.org>
81 * fileline.c (backtrace_syminfo_to_full_callback): New function.
82 (backtrace_syminfo_to_full_error_callback): New function.
83 * elf.c (elf_nodebug): Call syminfo_fn if possible.
84 * internal.h (struct backtrace_call_full): Define.
85 (backtrace_syminfo_to_full_callback): Declare.
86 (backtrace_syminfo_to_full_error_callback): Declare.
87 * mtest.c (f3): Only check all[i] if data.index permits.
89 2020-09-16 Iain Sandoe <iain@sandoe.co.uk>
91 * macho.c (MACH_O_CPU_TYPE_PPC): New.
92 (MACH_O_CPU_TYPE_PPC64): New.
93 Add compile-tests for powerpc to the Mach-O variants.
95 2020-09-14 Ian Lance Taylor <iant@golang.org>
98 Add support for MiniDebugInfo.
99 * elf.c (struct elf_view): Define. Replace most uses of
100 backtrace_view with elf_view.
101 (elf_get_view): New static functions. Replace most calls of
102 backtrace_get_view with elf_get_view.
103 (elf_release_view): New static functions. Replace most calls of
104 backtrace_release_view with elf_release_view.
105 (elf_uncompress_failed): Rename from elf_zlib_failed. Change all
107 (LZMA_STATES, LZMA_POS_STATES, LZMA_DIST_STATES): Define.
108 (LZMA_DIST_SLOTS, LZMA_DIST_MODEL_START): Define.
109 (LZMA_DIST_MODEL_END, LZMA_FULL_DISTANCES): Define.
110 (LZMA_ALIGN_SIZE, LZMA_LEN_LOW_SYMBOLS): Define.
111 (LZMA_LEN_MID_SYMBOLS, LZMA_LEN_HIGH_SYMBOLS): Define.
112 (LZMA_LITERAL_CODERS_MAX, LZMA_LITERAL_CODER_SIZE): Define.
113 (LZMA_PROB_IS_MATCH_LEN, LZMA_PROB_IS_REP_LEN): Define.
114 (LZMA_PROB_IS_REP0_LEN, LZMA_PROB_IS_REP1_LEN): Define.
115 (LZMA_PROB_IS_REP2_LEN, LZMA_PROB_IS_REP0_LONG_LEN): Define.
116 (LZMA_PROB_DIST_SLOT_LEN, LZMA_PROB_DIST_SPECIAL_LEN): Define.
117 (LZMA_PROB_DIST_ALIGN_LEN): Define.
118 (LZMA_PROB_MATCH_LEN_CHOICE_LEN): Define.
119 (LZMA_PROB_MATCH_LEN_CHOICE2_LEN): Define.
120 (LZMA_PROB_MATCH_LEN_LOW_LEN): Define.
121 (LZMA_PROB_MATCH_LEN_MID_LEN): Define.
122 (LZMA_PROB_MATCH_LEN_HIGH_LEN): Define.
123 (LZMA_PROB_REP_LEN_CHOICE_LEN): Define.
124 (LZMA_PROB_REP_LEN_CHOICE2_LEN): Define.
125 (LZMA_PROB_REP_LEN_LOW_LEN): Define.
126 (LZMA_PROB_REP_LEN_MID_LEN): Define.
127 (LZMA_PROB_REP_LEN_HIGH_LEN): Define.
128 (LZMA_PROB_LITERAL_LEN): Define.
129 (LZMA_PROB_IS_MATCH_OFFSET, LZMA_PROB_IS_REP_OFFSET): Define.
130 (LZMA_PROB_IS_REP0_OFFSET, LZMA_PROB_IS_REP1_OFFSET): Define.
131 (LZMA_PROB_IS_REP2_OFFSET): Define.
132 (LZMA_PROB_IS_REP0_LONG_OFFSET): Define.
133 (LZMA_PROB_DIST_SLOT_OFFSET): Define.
134 (LZMA_PROB_DIST_SPECIAL_OFFSET): Define.
135 (LZMA_PROB_DIST_ALIGN_OFFSET): Define.
136 (LZMA_PROB_MATCH_LEN_CHOICE_OFFSET): Define.
137 (LZMA_PROB_MATCH_LEN_CHOICE2_OFFSET): Define.
138 (LZMA_PROB_MATCH_LEN_LOW_OFFSET): Define.
139 (LZMA_PROB_MATCH_LEN_MID_OFFSET): Define.
140 (LZMA_PROB_MATCH_LEN_HIGH_OFFSET): Define.
141 (LZMA_PROB_REP_LEN_CHOICE_OFFSET): Define.
142 (LZMA_PROB_REP_LEN_CHOICE2_OFFSET): Define.
143 (LZMA_PROB_REP_LEN_LOW_OFFSET): Define.
144 (LZMA_PROB_REP_LEN_MID_OFFSET): Define.
145 (LZMA_PROB_REP_LEN_HIGH_OFFSET): Define.
146 (LZMA_PROB_LITERAL_OFFSET): Define.
147 (LZMA_PROB_TOTAL_COUNT): Define.
148 (LZMA_IS_MATCH, LZMA_IS_REP, LZMA_IS_REP0): Define.
149 (LZMA_IS_REP1, LZMA_IS_REP2, LZMA_IS_REP0_LONG): Define.
150 (LZMA_DIST_SLOT, LZMA_DIST_SPECIAL, LZMA_DIST_ALIGN): Define.
151 (LZMA_MATCH_LEN_CHOICE, LZMA_MATCH_LEN_CHOICE2): Define.
152 (LZMA_MATCH_LEN_LOW, LZMA_MATCH_LEN_MID): Define.
153 (LZMA_MATCH_LEN_HIGH, LZMA_REP_LEN_CHOICE): Define.
154 (LZMA_REP_LEN_CHOICE2, LZMA_REP_LEN_LOW): Define.
155 (LZMA_REP_LEN_MID, LZMA_REP_LEN_HIGH, LZMA_LITERAL): Define.
156 (elf_lzma_varint): New static function.
157 (elf_lzma_range_normalize): New static function.
158 (elf_lzma_bit, elf_lzma_integer): New static functions.
159 (elf_lzma_reverse_integer): New static function.
160 (elf_lzma_len, elf_uncompress_lzma_block): New static functions.
161 (elf_uncompress_lzma): New static function.
162 (backtrace_uncompress_lzma): New function.
163 (elf_add): Add memory and memory_size parameters. Change all
164 callers. Look for .gnu_debugdata section, and, if found,
165 decompress it and use it for symbols and debug info. Permit the
166 descriptor parameter to be -1.
167 * internal.h (backtrace_uncompress_lzma): Declare.
169 * xztest.c: New file.
170 * configure.ac: Check for nm, xz, and comm programs. Check for
172 (HAVE_MINIDEBUG): Define.
173 * Makefile.am (mtest_SOURCES): Define.
174 (mtest_CFLAGS, mtest_LDADD): Define.
175 (TESTS): Add mtest_minidebug if HAVE_MINIDEBUG.
176 (%_minidebug): New pattern rule, if HAVE_MINIDEBUG.
177 (xztest_SOURCES, xztest_CFLAGS, xztest_LDADD): Define.
178 (xztest_alloc_SOURCES, xztest_alloc_CFLAGS): Define
179 (xztest_alloc_LDADD): Define.
180 (BUILDTESTS): Add mtest, xztest, xztest_alloc.
181 (CLEANFILES): Add files created by minidebug pattern.
182 (btest.lo): Correct INCDIR reference.
183 (mtest.lo, xztest.lo, ztest.lo): New targets.
184 * configure: Regenerate.
185 * config.h.in: Regenerate.
186 * Makefile.in: Regenerate.
188 2020-09-09 Ian Lance Taylor <iant@golang.org>
190 * pecoff.c (coff_initialize_syminfo): Add is_64 parameter.
191 (coff_add): Determine and pass is_64.
193 2020-09-09 Ian Lance Taylor <iant@golang.org>
195 PR libbacktrace/96973
196 * fileline.c (macho_get_executable_path): New static function.
197 (fileline_initialize): Call macho_get_executable_path.
199 2020-09-09 Ian Lance Taylor <iant@golang.org>
201 * dwarf.c (function_addrs_search): Compare against the next entry
202 low address, not the high address.
203 (unit_addrs_search): Likewise.
204 (build_address_map): Add a trailing unit_addrs.
205 (read_function_entry): Add a trailing function_addrs.
206 (read_function_info): Likewise.
207 (report_inlined_functions): Search backward for function_addrs
209 (dwarf_lookup_pc): Search backward for unit_addrs and
210 function_addrs matches.
212 2020-09-08 Ian Lance Taylor <iant@golang.org>
214 * simple.c (simple_unwind): Correct comment spelling.
216 2020-09-08 Ian Lance Taylor <iant@golang.org>
218 * macho.c (macho_add_dsym): Make space for '/' in dsym. Use
219 correct length when freeing diralc.
221 2020-09-08 Ian Lance Taylor <iant@golang.org>
223 PR libbacktrace/96973
224 * macho.c (macho_add_fat): Correctly swap 32-bit file offset.
226 2020-09-08 Ian Lance Taylor <iant@golang.org>
228 PR libbacktrace/96971
229 * filetype.awk: Only match magic number at start of line.
231 2020-08-24 Ian Lance Taylor <iant@golang.org>
233 * macho.c (MACH_O_MH_MAGIC_FAT_64): Define.
234 (MACH_O_MH_CIGAM_FAT_64): Define.
235 (struct macho_fat_arch_64): Define.
236 (macho_add_fat): Add and use is_64 parameter.
237 (macho_add): Recognize 64-bit fat files.
239 2020-07-30 H.J. Lu <hjl.tools@gmail.com>
242 * configure: Regenerated.
244 2020-07-08 Ian Lance Taylor <iant@golang.org>
246 * configure.ac: Test linker support for DWARF5
247 * configure: Regenerate
249 2020-05-29 H.J. Lu <hjl.tools@gmail.com>
252 * configure: Regenerated.
254 2020-05-15 H.J. Lu <hongjiu.lu@intel.com>
257 * configure: Regenerated.
259 2020-05-14 H.J. Lu <hongjiu.lu@intel.com>
261 * configure: Regenerated.
263 2020-05-13 Ian Lance Taylor <iant@golang.org>
265 * ztest.c (test_large): Mark state ATTRIBUTE_UNUSED.
267 2020-05-13 Ian Lance Taylor <iant@golang.org>
270 * posix.c (backtrace_open): Treat EACCESS like ENOENT.
272 2020-05-12 H.J. Lu <hongjiu.lu@intel.com>
274 * Makefile.am (AM_CFLAGS): Add $(CET_HOST_FLAGS).
275 * configure.ac: Add GCC_CET_HOST_FLAGS(CET_HOST_FLAGS) and
276 AC_SUBST(CET_HOST_FLAGS). Clear CET_HOST_FLAGS if jit isn't
278 * Makefile.in: Regenerated.
279 * configure: Likewise.
281 2020-05-11 Ian Lance Taylor <iant@golang.org>
283 PR libbacktrace/95012
284 * configure.ac: Check for getpagesize declaration.
285 * mmap.c: Declare getpagesize if necessary.
286 * mmapio.c: Likewise.
287 * configure: Regenerate.
288 * config.h.in: Regenerate.
289 * Makefile.in: Regenerate.
291 2020-05-09 Roland McGrath <mcgrathr@google.com>
293 * elf.c (elf_add): Bail early if there are no section headers at all.
295 2020-05-09 Ian Lance Taylor <iant@golang.org>
297 * elf.c (elf_add): Don't free strtab if an error occurs after
298 recording symbol information.
300 2020-05-09 Ian Lance Taylor <iant@golang.org>
302 PR libbacktrace/88745
304 * filetype.awk: Recognize Mach-O files.
305 * Makefile.am (FORMAT_FILES): Add macho.c.
306 (check_DATA): New variable. Set to .dSYM if HAVE_DSYMUTIL.
307 (%.dSYM): New pattern target.
308 (test_macho_SOURCES, test_macho_CFLAGS): New targets.
309 (test_macho_LDADD): New target.
310 (BUILDTESTS): Add test_macho.
311 (macho.lo): Add dependencies.
312 * configure.ac: Recognize macho file type. Check for
313 mach-o/dyld.h. Don't try to run objcopy if we don't find it.
314 Look for dsymutil and define a HAVE_DSYMUTIL conditional.
315 * Makefile.in: Regenerate.
316 * configure: Regenerate.
317 * config.h.in: Regenerate.
319 2020-05-09 Ian Lance Taylor <iant@golang.org>
321 * read.c (backtrace_get_view): Support short read.
323 2020-05-09 Ian Lance Taylor <iant@golang.org>
325 * elf.c (elf_add): If debug sections are very large or far apart,
326 read them individually rather than as a single view.
328 2020-05-08 Ian Lance Taylor <iant@golang.org>
330 * fileline.c (sysctl_exec_name): New static function.
331 (sysctl_exec_name1): New macro or static function.
332 (sysctl_exec_name2): Likewise.
333 (fileline_initialize): Try sysctl_exec_name[12].
334 * configure.ac: Check for sysctl args to fetch executable name.
335 * configure: Regenerate.
336 * config.h.in: Regenerate.
338 2020-02-15 Ian Lance Taylor <iant@golang.org>
340 * ztest.c (test_large): Update file to current libgo test file.
342 2020-02-03 Ian Lance Taylor <iant@golang.org>
344 * Makefile.am (libbacktrace_TEST_CFLAGS): Define.
345 (test_elf32_CFLAGS): Use $(libbacktrace_test_CFLAGS).
346 (test_elf_64_CFLAGS, test_xcoff_32_CFLAGS): Likewise.
347 (test_xcoff_64_CFLAGS, test_pecoff_CFLAGS): Likewise.
348 (test_unknown_CFLAGS, unittest_CFLAGS): Likewise.
349 (unittest_alloc_CFLAGS, allocfail_CFLAGS): Likewise.
350 (b2test_CFLAGS, b3test_CFLAGS, btest_CFLAGS): Likewise.
351 (btest_lto_CFLAGS, btest_alloc_CFLAGS, stest_CFLAGS): Likewise.
352 (stest_alloc_CFLAGS): Likewise.
353 * Makefile.in: Regenerate.
354 * ztest.c (error_callback_compress): Mark vdata unused.
355 (test_large): Add casts to avoid warnings.
357 2020-01-01 Jakub Jelinek <jakub@redhat.com>
359 Update copyright years.
361 2019-12-13 Ian Lance Taylor <iant@golang.org>
364 * dwarf.c (struct attr): Add val field.
365 (enum attr_val_encoding): Add ATTR_VAL_ADDDRESS_INDEX,
366 ATTR_VAL_STRING_INDEX, ATTR_VAL_RNGLISTS_INDEX.
367 (struct line_header): Add addrsize field.
368 (struct line_header_format): Define.
369 (struct unit): Add str_offsets_base, addr_base, and rnglists_base
371 (read_uint24): New static function.
372 (read_attribute): Add implicit_val parameter. Replace dwarf_str
373 and dwarf_str_size parameters with dwarf_sections parameter. Add
374 support for new DWARF 5 forms. Change all callers.
375 (resolve_string): New static function.
376 (resolve_addr_index): Likewise.
377 (read_abbrevs): Support DW_FORM_implicit_const.
378 (struct pcrange): Add lowpc_is_addr_index, highpc_is_addr_Index,
379 and ranges_is_index fields.
380 (update_pcrange): Support DWARF 5 encodings.
381 (add_high_low_range): New static function, split out of
383 (add_ranges_from_ranges): Likewise.
384 (add_ranges_from_rnglists): New static function.
385 (add_ranges): Just call new helper functions.
386 (find_address_ranges): Use resolve_string for strings, after
387 reading all attributes. Handle new DWARF 5 attributes.
388 (build_address_map): Support DWARF 5 compilation units.
389 (read_v2_paths): New static function, split out of
391 (read_lnct): New static function.
392 (read_line_header_format_entries): Likewise.
393 (read_line_header): Add ddata parameter. Support DWARF 5 line
394 headers. Call new helper functions. Change all callers.
395 (read_line_program): Use addrsize from line program header. Don't
396 special case directory index 0 for DWARF 5.
397 (read_referenced_name): Use resolve_string.
398 (read_function_entry): Handle DWARF 5 encodings. Use
400 * internal.h (enum dwarf_section): Add DEBUG_ADDR,
401 DEBUG_STR_OFFSETS, DEBUG_LINE_STR, DEBUG_RNGLISTS.
402 * elf.c (dwarf_section_names): Add new section names.
403 * pecoff.c (dwarf_section_names): Likewise.
404 * xcoff.c (xcoff_add): Clear dwarf_sections before setting
406 * configure.ac: Define HAVE_DWARF5 automake conditional.
407 * Makefile.am (dwarf5_SOURCES): New variable if HAVE_DWARF5.
408 (dwarf5_CFLAGS, dwarf5_LDADD): Likewise.
409 (dwarf5_alloc_SOURCES, dwarf5_alloc_CFLAGS): Likewise.
410 (dwarf5_alloc_LDADD): Likewise.
411 (BUILDTESTS): Add dwarf5 tests if HAVE_DWARF5.
412 (CLEANFILES, clean-local): Define.
414 2019-12-08 Ian Lance Taylor <iant@golang.org>
416 * dwarf.c (struct pcrange): Define.
417 (update_pcrange, add_ranges): New static functions.
418 (add_unit_addr): Change signature to work with add_ranges. Don't
419 add base_address here.
420 (add_unit_ranges): Remove.
421 (find_address_ranges): Replace str/ranges parameters with
422 dwarf_sections. Use update_pcrange and add_ranges. Change all
424 (add_function_range): Change signature to work with add_ranges.
425 Don't add base_address here.
426 (add_function_ranges): Remove.
427 (read_function_entry): Use update_pcrange and add_ranges.
429 2019-12-04 Ian Lance Taylor <iant@golang.org>
431 * edtest.c (test1): Add noclone attribute.
433 2019-12-04 Ian Lance Taylor <iant@golang.org>
435 * internal.h (enum dwarf_section): Define.
436 (struct dwarf_sections): Define.
437 (backtrace_dwarf_add): Update declaration to replace specific
438 section parameters with dwarf_sections parameter.
439 * dwarf.c (struct dwarf_data): Replace specific section fields
440 with dwarf_sections field.
441 (read_attribute): Use dwarf_sections with altlink.
442 (build_address_map): Replace specific section parameters with
443 dwarf_sections parameter. Change all callers.
444 (read_line_info): Use dwarf_sections with ddata.
445 (read_referenced_name): Likewise.
446 (add_function_ranges): Likewise.
447 (read_function_entry): Likewise.
448 (read_function_info): Likewise.
449 (build_dwarf_data): Replace specific section parameters with
450 dwarf_sections parameter. Change all callers.
451 (backtrace_dwarf_add): Likewise.
452 * elf.c (enum debug_section): Remove.
453 (dwarf_section_names): Remove .zdebug names.
454 (elf_add): Track zsections separately. Build dwarf_sections.
455 * pecoff.c (enum debug_section): Remove.
456 (struct debug_section_info): Remove data field.
457 (coff_add): Build dwarf_sections.
458 * xcoff.c (enum dwarf_section): Remove. Replace DWSECT_xxx
459 references with DEBUG_xxx references.
460 (xcoff_add): Build dwarf_sections.
462 2019-09-27 Maciej W. Rozycki <macro@wdc.com>
464 * configure: Regenerate.
466 2019-09-26 Ian Lance Taylor <iant@golang.org>
468 PR libbacktrace/91908
469 * pecoff.c (backtrace_initialize): Explicitly cast unchecked
470 __sync_bool_compare_and_swap to void.
471 * xcoff.c (backtrace_initialize): Likewise.
473 2019-09-03 Ulrich Weigand <uweigand@de.ibm.com>
475 * configure.ac: Remove references to spu.
476 * configure: Regenerate.
478 2019-05-24 Clement Chigot <clement.chigot@atos.net>
480 * Makefile.am (BUILDTESTS): Remove test_elf, add test_elf_32 and
482 * Makefile.in: Regenerate.
484 2019-05-14 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
486 * configure.ac (have_dl_iterate_phdr): Remove *-*-solaris2.10*
488 * configure: Regenerate.
490 2019-03-11 Ian Lance Taylor <iant@golang.org>
492 PR libbacktrace/89669
493 * Makefile.am (BUILDTESTS): Only add ztest and ztest_alloc if
495 * Makefile.in: Regenerate.
497 2019-02-26 Tom de Vries <tdevries@suse.de>
499 * btest.c (test5): Allow global.* as minimal symbol name for global.
501 2019-02-26 Tom de Vries <tdevries@suse.de>
503 * Makefile.am (TESTS): Only add b3test_dwz_buildid if HAVE_DWZ.
504 * Makefile.in: Regenerate.
506 2019-02-12 Tom de Vries <tdevries@suse.de>
508 PR libbacktrace/81983
509 * dwarf.c (dwarf_lookup_pc): Don't call bsearch if nmemb == 0.
511 2019-02-10 Tom de Vries <tdevries@suse.de>
513 * Makefile.am (BUILDTESTS): Add btest_lto.
514 * Makefile.in: Regenerate.
515 * btest.c (test1, f2, f3, test3, f22, f23): Declare with
516 __attribute__((noclone)).
518 2019-02-08 Tom de Vries <tdevries@suse.de>
520 * backtrace.c (backtrace_full): Declare with __attribute__((noinline)).
521 * print.c (backtrace_print): Same.
522 * simple.c (backtrace_simple): Same.
524 2019-02-08 Tom de Vries <tdevries@suse.de>
526 PR libbacktrace/78063
527 * dwarf.c (build_address_map): Keep all parsed units.
528 (read_referenced_name_from_attr): Handle DW_FORM_ref_addr.
530 2019-01-31 Tom de Vries <tdevries@suse.de>
532 PR libbacktrace/89136
533 * elf.c (elf_add): Read build-id if with_buildid_data. Fix
534 'debugaltlink_name_len =+ 1'.
536 2019-01-29 Tom de Vries <tdevries@suse.de>
538 * install-debuginfo-for-buildid.sh.in: New script.
539 * Makefile.am (check_PROGRAMS): Add b2test and b3test.
540 (TESTS): Add b2test_buildid and b3test_dwz_buildid.
541 * Makefile.in: Regenerate.
542 * configure.ac (HAVE_ELF): Set with AM_CONDITIONAL.
543 (READELF): Set with AC_CHECK_PROG.
544 (install-debuginfo-for-buildid.sh): Generate with AC_CONFIG_FILES.
545 * configure: Regenerate.
546 * elf.c (SYSTEM_BUILD_ID_DIR): Factor out of ...
547 (elf_open_debugfile_by_buildid): ... here.
549 2019-01-29 Tom de Vries <tdevries@suse.de>
551 * Makefile.am: Replace check_PROGRAMS with BUILDTESTS, except for
553 (TESTS): Don't add check_PROGRAMS. Add BUILDTESTS.
554 (check_PROGRAMS): Add BUILDTESTS.
555 * Makefile.in: Regenerate.
557 2019-01-28 Tom de Vries <tdevries@suse.de>
559 * Makefile.am (xcoff_%.c): Generate sed result into temporary file.
560 Use $< to access prerequisite.
561 * Makefile.in: Regenerate.
563 2019-01-25 Nathan Sidwell <nathan@acm.org>
565 * elf.c (elf_add): Pass "" filename to recursive call with
568 2019-01-25 Tom de Vries <tdevries@suse.de>
570 * elf.c (elf_add): When handling .gnu_debugaltlink, call elf_add with
572 * Makefile.am (TESTS): Add btest_dwz_gnudebuglink.
573 * Makefile.in: Regenerate.
575 2019-01-25 Tom de Vries <tdevries@suse.de>
577 * Makefile.am: Rewrite dtest rule into "%_gnudebuglink" pattern rule.
578 (TESTS): Rename dtest to btest_gnudebuglink.
579 * Makefile.in: Regenerate.
581 2019-01-23 Tom de Vries <tdevries@suse.de>
583 * dwarf.c (struct unit): Use size_t for low_offset/high_offset fields.
584 (units_search, find_unit): Use size_t for offset.
585 (build_address_map): Use size_t for unit_offset.
587 2019-01-20 Gerald Pfeifer <gerald@pfeifer.com>
589 * allocfail.c (main): Increase portability of printf statement.
591 2019-01-18 Ian Lance Taylor <iant@golang.org>
593 PR libbacktrace/88890
594 * mmapio.c (backtrace_get_view): Change size parameter to
595 uint64_t. Check that value fits in size_t.
596 * read.c (backtrace_get_view): Likewise.
597 * internal.h (backtrace_get_view): Update declaration.
598 * elf.c (elf_add): Pass shstrhdr->sh_size to backtrace_get_view.
600 2019-01-17 Tom de Vries <tdevries@suse.de>
602 PR libbacktrace/82857
603 * configure.ac (DWZ): Set with AC_CHECK_PROG.
604 (HAVE_DWZ): Set with AM_CONDITIONAL.
605 * configure: Regenerate.
606 * Makefile.am (TESTS): Add btest_dwz.
607 * Makefile.in: Regenerate.
609 2019-01-17 Tom de Vries <tdevries@suse.de>
611 PR libbacktrace/82857
612 * dwarf.c (enum attr_val_encoding): Add ATTR_VAL_REF_ALT_INFO.
613 (read_attribute): Handle DW_FORM_GNU_ref_alt using
614 ATTR_VAL_REF_ALT_INFO.
615 (read_referenced_name_from_attr): Handle DW_FORM_GNU_ref_alt.
617 2019-01-17 Tom de Vries <tdevries@suse.de>
619 * dwarf.c (struct unit): Add low_offset and high_offset fields.
620 (struct unit_vector): New type.
621 (struct dwarf_data): Add units and units_counts fields.
622 (find_unit): New function.
623 (find_address_ranges): Add and handle unit_tag parameter.
624 (build_address_map): Add and handle units_vec parameter.
625 (build_dwarf_data): Pass units_vec to build_address_map. Store resulting
628 2019-01-17 Tom de Vries <tdevries@suse.de>
630 PR libbacktrace/82857
631 * dwarf.c (read_attribute): Handle DW_FORM_GNU_strp_alt
634 2019-01-17 Tom de Vries <tdevries@suse.de>
636 * dwarf.c (enum attr_val_encoding): Add ATTR_VAL_NONE.
637 (read_attribute): Add altlink parameter. Handle missing altlink for
638 DW_FORM_GNU_strp_alt and DW_FORM_GNU_ref_alt.
639 (find_address_ranges, build_address_map, build_dwarf_data): Add and
640 handle altlink parameter.
641 (read_referenced_name, read_function_entry): Add argument to
644 2019-01-17 Tom de Vries <tdevries@suse.de>
646 * dwarf.c (struct dwarf_data): Add altlink field.
647 (backtrace_dwarf_add): Add and handle fileline_altlink parameter.
648 * elf.c (elf_add): Add argument to backtrace_dwarf_add call.
649 (phdr_callback, backtrace_initialize): Add argument to elf_add calls.
650 * internal.h (backtrace_dwarf_add): Add fileline_altlink parameter.
651 * pecoff.c (coff_add): Add argument to backtrace_dwarf_add call.
652 * xcoff.c (xcoff_add): Same.
654 2019-01-17 Tom de Vries <tdevries@suse.de>
656 * internal.h (backtrace_dwarf_add): Add fileline_entry parameter.
657 * dwarf.c (backtrace_dwarf_add): Add and handle fileline_entry parameter.
658 * elf.c (elf_add): Add and handle fileline_entry parameter. Add
659 argument to backtrace_dwarf_add call.
660 (phdr_callback, backtrace_initialize): Add argument to elf_add calls.
661 * pecoff.c (coff_add): Add argument to backtrace_dwarf_add call.
662 * xcoff.c (xcoff_add): Same.
664 2019-01-17 Tom de Vries <tdevries@suse.de>
666 * elf.c (elf_add): Add and handle with_buildid_data and
667 with_buildid_size parameters. Handle .gnu_debugaltlink section.
668 (phdr_callback, backtrace_initialize): Add arguments to elf_add calls.
670 2019-01-16 Tom de Vries <tdevries@suse.de>
672 * dwarf.c (read_referenced_name_from_attr): New function. Factor out
674 (read_referenced_name): ... here, and ...
675 (read_function_entry): ... here.
677 2019-01-16 Tom de Vries <tdevries@suse.de>
679 * dwarf.c (read_referenced_name): Don't allow DW_AT_name to override any
681 (read_function_entry): Same. Don't allow name found via
682 DW_AT_abstract_origin or case DW_AT_specification to override linkage
685 2019-01-09 Sandra Loosemore <sandra@codesourcery.com>
689 * backtrace.h: Mechanically replace "can not" with "cannot".
691 2019-01-01 Jakub Jelinek <jakub@redhat.com>
693 Update copyright years.
695 2018-12-29 Gerald Pfeifer <gerald@pfeifer.com>
697 * Makefile.am (xcoff_%.c): Use an actual newline instead of \n
699 * Makefile.in: Regenerate.
701 2018-12-28 Tom de Vries <tdevries@suse.de>
703 * dwarf.c (build_address_map): Reuse unused units.
705 2018-12-28 Tom de Vries <tdevries@suse.de>
707 * dwarf.c (build_address_map): Simplify by removing local variable
710 2018-12-28 Ian Lance Taylor <iant@golang.org>
711 Tom de Vries <tdevries@suse.de>
713 PR libbacktrace/88063
714 * dwarf.c (free_unit_addrs_vector): Remove.
715 (build_address_map): Keep track of allocated units in vector. Free
716 allocated units and corresponding abbrevs upon failure. Remove now
717 redundant call to free_unit_addrs_vector. Free addrs vector upon
718 failure. Free allocated unit vector.
720 2018-12-28 Tom de Vries <tdevries@suse.de>
722 * dwarf.c (build_address_map): Free addrs vector upon failure.
724 2018-12-14 Tom de Vries <tdevries@suse.de>
727 * allocfail.sh: Remove "set -o pipefail".
729 2018-12-12 Tom de Vries <tdevries@suse.de>
731 * Makefile.am (TESTS): Add allocfail.sh.
732 (check_PROGRAMS): Add allocfail.
733 * Makefile.in: Regenerate.
734 * instrumented_alloc.c: New file. Redefine malloc and realloc.
736 * allocfail.c: New file.
737 * allocfail.sh: New file.
739 2018-11-30 Tom de Vries <tdevries@suse.de>
741 * Makefile.am (check_PROGRAMS): Add test_elf, test_xcoff_32,
742 test_xcoff_64, test_pecoff and test_unknown.
743 * Makefile.in: Regenerate.
744 * test_format.c: New file.
746 2018-11-30 Tom de Vries <tdevries@suse.de>
748 * Makefile.am : Add _with_alloc version for each test in
750 * Makefile.in: Regenerate.
752 2018-11-30 Tom de Vries <tdevries@suse.de>
754 * internal.h (backtrace_vector_free): New static inline fuction,
756 * dwarf.c (read_line_info): ... here.
758 2018-11-28 Tom de Vries <tdevries@suse.de>
760 * dwarf.c (read_abbrevs): Fix handling of abbrevs->abbrevs allocation
763 2018-11-27 Tom de Vries <tdevries@suse.de>
765 * mmap.c (backtrace_vector_release): Same.
766 * unittest.c (test1): Add check.
768 2018-11-27 Tom de Vries <tdevries@suse.de>
770 * alloc.c (backtrace_vector_release): Handle vec->size == 0 using free
772 * Makefile.am (check_PROGRAMS): Add unittest.
773 * Makefile.in: Regenerate.
774 * unittest.c: New file.
776 2018-11-22 Tom de Vries <tdevries@suse.de>
778 * dwarf.c (read_initial_length): Factor out of ...
779 (build_address_map, read_line_info): ... here.
781 2018-11-21 Tom de Vries <tdevries@suse.de>
783 * dwarf.c (read_string): Factor out of ...
784 (read_attribute, read_line_header, read_line_program): ... here.
786 2018-10-31 Joseph Myers <joseph@codesourcery.com>
789 * Makefile.am: Include multilib.am.
790 * configure.ac: Remove AC_PREREQ. Use AC_LANG_SOURCE.
791 * Makefile.in, aclocal.m4, config.h.in, configure: Regenerate.
793 2018-10-05 Ian Lance Taylor <iant@golang.org>
795 PR libbacktrace/87529
796 * backtrace.h: Document that backtrace_create_state should be
799 2018-08-05 Iain Buclaw <ibuclaw@gdcproject.org>
801 * configure.ac: Move define of HAVE_ZLIB into check for -lz.
802 * Makefile.in: Regenerate.
803 * config.h.in: Likewise.
804 * configure: Likewise.
806 2018-08-01 Tony Reix <tony.reix@atos.net>
808 * xcoff.c (struct xcoff_line, struct xcoff_line_vector): Remove.
809 (struct xcoff_func, struct xcoff_func_vector): New structs.
810 (xcoff_syminfo): Drop leading dot from symbol name.
811 (xcoff_line_compare, xcoff_line_search): Remove.
812 (xcoff_func_compare, xcoff_func_search): New static functions.
813 (xcoff_lookup_pc): Search function table.
814 (xcoff_add_line, xcoff_process_linenos): Remove.
815 (xcoff_initialize_fileline): Build function table.
817 2018-06-21 Denis Khalikov <d.khalikov@partner.samsung.com>
820 * elf.c (elf_add): Increase ".note.gnu.build-id" section size
821 checking up to 36 bytes.
823 2018-04-24 H.J. Lu <hongjiu.lu@intel.com>
825 * configure: Regenerated.
827 2018-04-19 Jakub Jelinek <jakub@redhat.com>
829 * configure: Regenerated.
831 2018-04-17 Ian Lance Taylor <iant@golang.org>
833 * backtrace.c: Revert last two changes. Don't call mmap
836 2018-04-17 Ian Lance Taylor <iant@golang.org>
838 * backtrace.c: Include backtrace-supported.h before checking
839 BACKTRACE_USES_MALLOC.
841 2018-04-17 Ian Lance Taylor <iant@golang.org>
843 * backtrace.c (backtrace_full): When testing whether we can
844 allocate memory, call mmap directly, and munmap the memory.
846 2018-04-04 Jakub Jelinek <jakub@redhat.com>
849 * elf.c (elf_zlib_fetch): Fix up predefined macro names in test for
850 big endian, only use 32-bit loads if endianity macros are predefined
851 and indicate big or little endian.
853 2018-02-14 Igor Tsimbalist <igor.v.tsimbalist@intel.com>
856 * configure: Regenerate.
858 2018-02-15 Jakub Jelinek <jakub@redhat.com>
861 * elf.c (SHT_PROGBITS): Undefine and define.
863 2018-02-14 Jakub Jelinek <jakub@redhat.com>
866 * elf.c (EM_PPC64, EF_PPC64_ABI): Undefine and define.
867 (struct elf_ppc64_opd_data): New type.
868 (elf_initialize_syminfo): Add opd argument, handle symbols
869 pointing into the PowerPC64 ELFv1 .opd section.
870 (elf_add): Read .opd section on PowerPC64 ELFv1, pass pointer
871 to structure with .opd data to elf_initialize_syminfo.
873 2018-01-31 Ian Lance Taylor <iant@golang.org>
875 * elf.c (elf_add): Close descriptor if we use a debugfile.
876 * btest.c (check_open_files): New static function.
877 (main): Call check_open_files.
879 2018-01-25 Ian Lance Taylor <iant@golang.org>
881 * elf.c (elf_open_debugfile_by_debuglink): Don't check CRC if the
883 (elf_add): Don't clear *found_sym and *found_dwarf if debuginfo.
885 2018-01-25 Ian Lance Taylor <iant@golang.org>
887 * pecoff.c (coff_add): Only release syms_view if it is valid.
889 2018-01-25 Ian Lance Taylor <iant@golang.org>
891 * pecoff.c (coff_add): Another memcpy -> coff_read4 fix.
893 2018-01-24 Ian Lance Taylor <iant@golang.org>
895 * pecoff.c (coff_add): Use coff_read4, not memcpy.
897 2018-01-24 Ian Lance Taylor <iant@golang.org>
900 * mmap.c (backtrace_free_locked): Don't put more than 16 entries
903 2018-01-19 Tony Reix <tony.reix@atos.net>
905 * xcoff.c (xcoff_incl_compare): New function.
906 (xcoff_incl_search): New function.
907 (xcoff_process_linenos): Use bsearch to find include file.
908 (xcoff_initialize_fileline): Sort include file information.
910 2018-01-16 Ian Lance Taylor <iant@golang.org>
912 * elf.c (codes) [GENERATE_FIXED_HUFFMAN_TABLE]: Fix size to be
914 (main) [GENERATE_FIXED_HUFFMAN_TABLE]: Pass 288 to
915 elf_zlib_inflate_table. Generate elf_zlib_default_dist_table.
916 (elf_zlib_default_table): Update.
917 (elf_zlib_default_dist_table): New static array.
918 (elf_zlib_inflate): Use elf_zlib_default_dist_table for dist table
920 * ztest.c (struct zlib_test): Add uncompressed_len.
921 (tests): Initialize uncompressed_len field. Add new test case.
922 (test_samples): Use uncompressed_len field.
924 2018-01-03 Jakub Jelinek <jakub@redhat.com>
926 Update copyright years.
928 2017-11-17 Igor Tsimbalist <igor.v.tsimbalist@intel.com>
930 * configure.ac: Add CET_FLAGS to EXTRA_FLAGS.
931 * aclocal.m4: Regenerate.
932 * Makefile.in: Likewise.
933 * configure: Likewise.
935 2017-10-06 Ian Lance Taylor <iant@golang.org>
937 * ztest.c (test_large): Pass unsigned long *, not size_t *, to
938 zlib uncompress function.
940 2017-10-05 Ian Lance Taylor <iant@golang.org>
942 * elf.c (elf_zlib_fetch): Change pval argument to uint64_t *.
943 Read a four byte integer.
944 (elf_zlib_inflate): Change val to uint64_t. Align pin to a 32-bit
945 boundary before ever calling elf_zlib_fetch.
946 * ztest.c (test_large): Simplify print statements a bit.
948 2017-10-02 Ian Lance Taylor <iant@golang.org>
950 * ztest.c: #include <errno.h>.
951 (TEST_TIMING): Don't define, don't test.
952 (xclock_gettime, xclockid_t): Define if !HAVE_CLOCK_GETTIME.
953 (clockid_t, clock_gettime, CLOCK_REALTIME): Likewise.
954 (ZLIB_CLOCK_GETTIME_ARG): Define.
955 * configure.ac: Change clock_gettime_link to CLOCK_GETTIME_LINK.
956 * Makefile.am: Likewise.
957 * configure, Makefile.in: Rebuild.
959 2017-10-02 Thomas Schwinge <thomas@codesourcery.com>
962 * Makefile.am: Append the content of clock_gettime_link to
964 * configure.ac: Test for the case that clock_gettime is in librt.
965 * Makefile.in: Regenerate.
966 * configure: Likewise.
969 * configure.ac: Check for clock_gettime.
970 * config.h.in: Regenerate.
971 * configure: Likewise.
972 * ztest.c (average_time, test_large): Conditionalize test timing
973 on clock_gettime availability.
975 2017-09-29 Tony Reix <tony.reix@atos.net>
977 * xcoff.c: Initial support for DWARF debug sections in XCOFF.
978 (STYP_DWARF, SSUBTYP_DW*): Define.
979 (enum dwarf_section): Define.
980 (struct dwsect_info): Define.
981 (xcoff_add): Look for DWARF sections, pass them to
984 2017-09-28 Ian Lance Taylor <iant@golang.org>
987 * elf.c (__builtin_prefetch): Define if not __GNUC__.
989 (SHF_UNCOMPRESSED, ELFCOMPRESS_ZLIB): Define.
990 (b_elf_chdr): Define type.
991 (enum debug_section): Add ZDEBUG_xxx values.
992 (debug_section_names): Add names for new sections.
993 (struct debug_section_info): Add compressed field.
994 (elf_zlib_failed, elf_zlib_fetch): New static functions.
995 (HUFFMAN_TABLE_SIZE, HUFFMAN_VALUE_MASK): Define.
996 (HUFFMAN_BITS_SHIFT, HUFFMAN_BITS_MASK): Define.
997 (HUFFMAN_SECONDARY_SHIFT): Define.
998 (ZDEBUG_TABLE_SIZE): Define.
999 (ZDEBUG_TABLE_CODELEN_OFFSET, ZDEBUG_TABLE_WORK_OFFSET): Define.
1000 (final_next_secondary): New static variable if
1001 BACKTRACE_GENERATE_FIXED_HUFFMAN_TABLE.
1002 (elf_zlib_inflate_table): New static function.
1003 (BACKTRACE_GENERATE_FIXED_HUFFMAN_TABLE): If define, define main
1004 function to produce fixed Huffman table.
1005 (elf_zlib_default_table): New static variable.
1006 (elf_zlib_inflate): New static function.
1007 (elf_zlib_verify_checksum): Likewise.
1008 (elf_zlib_inflate_and_verify): Likewise.
1009 (elf_uncompress_zdebug): Likewise.
1010 (elf_uncompress_chdr): Likewise.
1011 (backtrace_uncompress_zdebug): New extern function.
1012 (elf_add): Look for .zdebug sections and SHF_COMPRESSED debug
1013 sections, and uncompress them.
1014 * internal.h (backtrace_compress_zdebug): Declare.
1015 * ztest.c: New file.
1016 * configure.ac: Check for -lz and check whether the linker
1017 supports --compress-debug-sections.
1018 * Makefile.am (ztest_SOURCES): New variable.
1019 (ztest_CFLAGS, ztest_LDADD): New variables.
1020 (check_PROGRAMS): Add ztest.
1021 (ctestg_SOURCES): New variable.
1022 (ctestg_CFLAGS, ctestg_LDFLAGS, ctestg_LDADD): New variables.
1023 (ctesta_SOURCES): New variable.
1024 (ctesta_CFLAGS, ctesta_LDFLAGS, ctesta_LDADD): New variables.
1025 (check_PROGRAMS): Add ctestg and ctesta.
1026 * configure, config.h.in, Makefile.in: Rebuild.
1028 2017-09-22 Ian Lance Taylor <iant@golang.org>
1031 * configure.ac: Check for lstat and readlink.
1032 * elf.c (lstat, readlink): Provide dummy versions if real versions
1034 * configure, config.h.in: Rebuild.
1036 2017-09-21 Ian Lance Taylor <iant@google.com>
1039 * elf.c (backtrace_initialize): Set pd.exe_filename.
1041 2017-09-20 Ian Lance Taylor <iant@golang.org>
1042 Denis Khalikov <d.khalikov@partner.samsung.com>
1045 Support for external debug info.
1046 * elf.c: Include <errno.h>, <sys/stat.h>, <unistd.h>.
1047 (S_ISLNK): Define if not defined.
1048 (xstrnlen): Define if strnlen is not available.
1049 (b_elf_note): Define type.
1050 (NT_GNU_BUILD_ID): Define macro.
1051 (elf_crc32, elf_crc32_file): New static functions.
1052 (elf_is_symlink, elf_readlink): New static functions.
1053 (elf_open_debugfile_by_buildid): New static function.
1054 (elf_try_debugfile): New static function.
1055 (elf_find_debugfile_by_debuglink): New static function.
1056 (elf_open_debugfile_by_debuglink): New static function.
1057 (elf_add): Add filename and debuginfo parameters. Adjust all
1058 callers. Look for external debug info notes, and try to fetch
1059 debug info from external file.
1060 (struct phdr_data): Add exe_filename field.
1061 (phdr_callback): Pass filename to elf_add.
1062 (backtrace_initialize): Add filename parameter.
1063 * internal.h (backtrace_initialize): Add filename parameter.
1064 * fileline.c (fileline_initialize): Pass filename to
1065 backtrace_initialize.
1066 * pecoff.c (fileline_initialize): Add unused filename parameter.
1067 * unknown.c (fileline_initialize): Likewise.
1068 * xcoff.c (fileline_initialize): Likewise.
1069 * configure.ac: Check for objcopy --add-gnu-debuglink.
1070 * Makefile.am (dtest): New test target.
1071 * configure, Makefile.in: Rebuild.
1073 2017-09-12 Steve Ellcey <sellcey@cavium.com>
1076 * Makefile.am (ttest_CFLAGS): Add $(AM_CFLAGS)
1077 * Makefile.in: Regenerate.
1079 2017-09-12 Steve Ellcey <sellcey@cavium.com>
1082 * libbacktrace/Makefile.in
1083 (HAVE_PTHREAD_TRUE@@NATIVE_TRUE@ttest_CFLAGS): Add $(AM_CFLAGS)
1085 2017-08-02 David Edelsohn <dje.gcc@gmail.com>
1088 * xcoff.c (xcoff_process_linenos): Initialize incl to NULL.
1090 2017-07-28 Tony Reix <tony.reix@atos.net>
1092 * xcoff.c: Don't leak a file descriptor if an archive is malformed.
1094 2017-07-28 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
1096 * fileline.c (fileline_initialize): Print pid_t as long.
1098 2017-07-26 Tony Reix <tony.reix@atos.net>
1100 * configure.ac: Check for XCOFF32/XCOFF64. Check for loadquery.
1101 * filetype.awk: Separate AIX XCOFF32 and XCOFF64.
1102 * xcoff.c: Add support for AIX XCOFF32 and XCOFF64 formats.
1103 * configure, config.h.in: Regenerate.
1105 2017-07-21 Tony Reix <tony.reix@atos.net>
1107 * filetype.awk: Add AIX XCOFF type detection.
1108 * configure.ac: Recognize xcoff format.
1109 * Makefile.am (FORMAT_FILES): Add xcoff.c.
1110 * fileline.c: Include <unistd.h>.
1111 (fileline_initialize): Add case for AIX procfs.
1112 * xcoff.c: New file.
1113 * configure, Makefile.in: Rebuild.
1115 2017-06-21 Richard Biener <rguenther@suse.de>
1117 * configure.ac: Add AC_SYS_LARGEFILE.
1118 * config.h.in: Regenerate.
1119 * configure: Likewise.
1121 2017-06-11 Ian Lance Taylor <iant@golang.org>
1123 * elf.c (backtrace_initialize): Always set *fileline_fn.
1124 * ttest.c: New file.
1125 * btest.c: Move support functions into testlib.c. Change calls to
1126 check to pass file name.
1127 * testlib.c: New file, copied from (part of) btest.c.
1128 * testlib.h: New file, declarations for testlib.c.
1129 * edtest.c: Use testlib.h and testlib.c.
1130 * configure.ac: Test for -pthread, set HAVE_PTHREAD conditional.
1131 * Makefile.am (btest_SOURCES): Add testlib.c.
1132 (edtest_SOURCES): Likewise.
1133 (CHECK_PROGRAMS): Add ttest if HAVE_PTHREAD.
1134 (ttest_SOURCES, ttest_CFLAGS, ttest_LDADD): Define.
1135 * configure, Makefile.in: Rebuild.
1137 2017-05-19 Than McIntosh <thanm@google.com>
1139 * dwarf.c (free_line_header): Don't free dirs if dirs_count == 0.
1140 (read_line_header): Don't allocate dirs if dirs_count == 0.
1141 * edtest.c: New file.
1142 * edtest2.c: New file.
1143 * Makefile.am (edtest_SOURCES, edtest_LDADD): Define.
1144 (check_PROGRAMS): Add edtest.
1145 (edtest2_build.c, gen_edtest2_build): New targets.
1146 * Makefile.in: Rebuild.
1148 2017-03-08 Sam Thursfield <sam.thursfield@codethink.co.uk>
1150 * btest.c (test5): Replace #ifdef guard with 'unused' attribute
1151 to fix compile warning when BACKTRACE_SUPPORTED isn't defined.
1153 2017-01-01 Jakub Jelinek <jakub@redhat.com>
1155 Update copyright years.
1157 2016-11-15 Matthias Klose <doko@ubuntu.com>
1159 * configure: Regenerate.
1161 2016-09-11 Carlos Liam <carlos@aarzee.me>
1163 * all: Remove meaningless trailing whitespace.
1165 2016-05-18 Uros Bizjak <ubizjak@gmail.com>
1168 * elf.c (phdr_callback) [__i386__]: Add
1169 __attribute__((__force_align_arg_pointer__)).
1171 2016-03-02 Maxim Ostapenko <m.ostapenko@partner.samsung.com>
1173 * elf.c (backtrace_initialize): Properly initialize elf_fileline_fn to
1174 avoid possible crash.
1175 (elf_add): Don't set *fileline_fn to elf_nodebug value in case of
1176 missing debug info anymore.
1178 2016-02-06 John David Anglin <danglin@gcc.gnu.org>
1180 * mmap.c (MAP_FAILED): Define if not defined.
1182 2016-01-04 Jakub Jelinek <jakub@redhat.com>
1184 Update copyright years.
1186 2015-12-18 Andris Pavenis <andris.pavenis@iki.fi>
1188 * configure.ac: Specify that DJGPP do not have mmap
1189 even when sys/mman.h exists.
1190 * configure: Regenerate
1192 2015-12-09 John David Anglin <danglin@gcc.gnu.org>
1194 PR libgfortran/68115
1195 * configure.ac: Set libbacktrace_cv_sys_sync to no on hppa*-*-hpux*.
1196 * configure: Regenerate.
1197 * elf.c (backtrace_initialize): Cast __sync_bool_compare_and_swap call
1200 2015-09-17 Ian Lance Taylor <iant@google.com>
1202 * posix.c (backtrace_open): Cast second argument of open() to int.
1204 2015-09-11 Ian Lance Taylor <iant@google.com>
1206 * Makefile.am (backtrace.lo): Depend on internal.h.
1207 (sort.lo, stest.lo): Add explicit dependencies.
1208 * Makefile.in: Rebuild.
1210 2015-09-09 Hans-Peter Nilsson <hp@axis.com>
1212 * backtrace.c: #include <sys/types.h>.
1214 2015-09-08 Ian Lance Taylor <iant@google.com>
1217 * backtrace.c: #include "internal.h".
1218 (struct backtrace_data): Add can_alloc field.
1219 (unwind): If can_alloc is false, don't try to get file/line
1221 (backtrace_full): Set can_alloc field in bdata.
1222 * alloc.c (backtrace_alloc): Don't call error_callback if it is
1224 * mmap.c (backtrace_alloc): Likewise.
1225 * internal.h: Update comments for backtrace_alloc and
1228 2015-09-08 Ian Lance Taylor <iant@google.com>
1231 * mmap.c (backtrace_alloc): Correct test for mmap failure.
1233 2015-08-31 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
1235 * configure.ac: For spu-*-* targets, set have_fcntl to no.
1236 * configure: Regenerate.
1238 2015-08-27 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
1240 * configure.ac: Remove [disable-shared] argument to LT_INIT.
1241 Remove setting PIC_FLAG when building as target library.
1242 * configure: Regenerate.
1244 2015-08-26 Hans-Peter Nilsson <hp@axis.com>
1246 * configure.ac: Only compile with -fPIC if the target
1248 * configure: Regenerate.
1250 2015-08-24 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
1252 * configure.ac: Set have_mmap to no on spu-*-* targets.
1253 * configure: Regenerate.
1255 2015-08-13 Ian Lance Taylor <iant@google.com>
1257 * dwarf.c (read_function_entry): Add vec_inlined parameter.
1260 2015-06-11 Martin Sebor <msebor@redhat.com>
1263 * dwarf.c (struct line): Add new field idx.
1264 (line_compare): Use it.
1266 (read_line_info): Reset it.
1268 2015-05-29 Tristan Gingold <gingold@adacore.com>
1270 * pecoff.c: New file.
1271 * Makefile.am (FORMAT_FILES): Add pecoff.c and dependencies.
1272 * Makefile.in: Regenerate.
1273 * filetype.awk: Detect pecoff.
1274 * configure.ac: Define BACKTRACE_SUPPORTS_DATA on elf platforms.
1276 * btest.c (test5): Test enabled only if BACKTRACE_SUPPORTS_DATA is
1278 * backtrace-supported.h.in (BACKTRACE_SUPPORTS_DATA): Define.
1279 * configure: Regenerate.
1280 * pecoff.c: New file.
1282 2015-05-13 Michael Haubenwallner <michael.haubenwallner@ssi-schaefer.com>
1284 * Makefile.in: Regenerated with automake-1.11.6.
1285 * aclocal.m4: Likewise.
1286 * configure: Likewise.
1288 2015-01-24 Matthias Klose <doko@ubuntu.com>
1290 * configure.ac: Move AM_ENABLE_MULTILIB before AC_PROG_CC.
1291 * configure: Regenerate.
1293 2015-01-05 Jakub Jelinek <jakub@redhat.com>
1295 Update copyright years.
1297 2014-11-21 H.J. Lu <hongjiu.lu@intel.com>
1300 * configure: Regenerated.
1302 2014-11-11 David Malcolm <dmalcolm@redhat.com>
1304 * ChangeLog.jit: New.
1306 2014-11-11 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
1309 * configure: Regenerate.
1311 2014-10-23 Ian Lance Taylor <iant@google.com>
1313 * internal.h (backtrace_atomic_load_pointer) [no atomic or sync]:
1314 Fix to return void *.
1316 2014-05-08 Ian Lance Taylor <iant@google.com>
1318 * mmap.c (backtrace_free): If freeing a large aligned block of
1319 memory, call munmap rather than holding onto it.
1320 (backtrace_vector_grow): When growing a vector, double the number
1321 of pages requested. When releasing the old version of a grown
1322 vector, pass the correct size to backtrace_free.
1324 2014-03-07 Ian Lance Taylor <iant@google.com>
1326 * sort.c (backtrace_qsort): Use middle element as pivot.
1328 2014-03-06 Ian Lance Taylor <iant@google.com>
1331 * stest.c: New file.
1332 * internal.h (backtrace_qsort): Declare.
1333 * dwarf.c (read_abbrevs): Call backtrace_qsort instead of qsort.
1334 (read_line_info, read_function_entry): Likewise.
1335 (read_function_info, build_dwarf_data): Likewise.
1336 * elf.c (elf_initialize_syminfo): Likewise.
1337 * Makefile.am (libbacktrace_la_SOURCES): Add sort.c.
1338 (stest_SOURCES, stest_LDADD): Define.
1339 (check_PROGRAMS): Add stest.
1341 2014-02-07 Misty De Meo <misty@brew.sh>
1344 * configure.ac: Use AC_LINK_IFELSE in check for
1346 * configure: Regenerate.
1348 2014-01-02 Richard Sandiford <rdsandiford@googlemail.com>
1350 Update copyright years
1352 2013-12-06 Jakub Jelinek <jakub@redhat.com>
1354 * elf.c (ET_DYN): Undefine and define again.
1355 (elf_add): Add exe argument, if true and ehdr.e_type is ET_DYN,
1356 return early -1 without closing the descriptor.
1357 (struct phdr_data): Add exe_descriptor.
1358 (phdr_callback): If pd->exe_descriptor is not -1, for very first
1359 call if dlpi_name is NULL just call elf_add with the exe_descriptor,
1360 otherwise backtrace_close the exe_descriptor if not -1. Adjust
1362 (backtrace_initialize): Adjust call to elf_add. If it returns
1363 -1, set pd.exe_descriptor to descriptor, otherwise set it to -1.
1365 2013-12-05 Ian Lance Taylor <iant@google.com>
1367 * alloc.c (backtrace_vector_finish): Add error_callback and data
1368 parameters. Call backtrace_vector_release. Return address base.
1369 * mmap.c (backtrace_vector_finish): Add error_callback and data
1370 parameters. Return address base.
1371 * dwarf.c (read_function_info): Get new address base from
1372 backtrace_vector_finish.
1373 * internal.h (backtrace_vector_finish): Update declaration.
1375 2013-11-27 Ian Lance Taylor <iant@google.com>
1377 * dwarf.c (find_address_ranges): New static function, broken out
1378 of build_address_map.
1379 (build_address_map): Call it.
1380 * btest.c (check): Check for missing filename or function, rather
1382 (f3): Check that enough frames were returned.
1384 2013-11-19 Jakub Jelinek <jakub@redhat.com>
1386 * backtrace.h (backtrace_syminfo_callback): Add symsize argument.
1387 * elf.c (elf_syminfo): Pass 0 or sym->size to the callback as
1389 * btest.c (struct symdata): Add size field.
1390 (callback_three): Add symsize argument. Copy it to the data->size
1392 (f23): Set symdata.size to 0.
1393 (test5): Likewise. If sizeof (int) > 1, lookup address of
1394 ((uintptr_t) &global) + 1. Verify symdata.val and symdata.size
1397 * atomic.c: Include sys/types.h.
1399 2013-11-18 Ian Lance Taylor <iant@google.com>
1401 * configure.ac: Check for support of __atomic extensions.
1402 * internal.h: Declare or #define atomic functions for use in
1404 * atomic.c: New file.
1405 * dwarf.c (dwarf_lookup_pc): Use atomic functions.
1406 (dwarf_fileline, backtrace_dwarf_add): Likewise.
1407 * elf.c (elf_add_syminfo_data, elf_syminfo): Likewise.
1408 (backtrace_initialize): Likewise.
1409 * fileline.c (fileline_initialize): Likewise.
1410 * Makefile.am (libbacktrace_la_SOURCES): Add atomic.c.
1411 * configure, config.h.in, Makefile.in: Rebuild.
1413 2013-11-18 Jakub Jelinek <jakub@redhat.com>
1415 * elf.c (SHN_UNDEF): Define.
1416 (elf_initialize_syminfo): Add base_address argument. Ignore symbols
1417 with st_shndx == SHN_UNDEF. Add base_address to address fields.
1418 (elf_add): Adjust caller.
1420 * elf.c (phdr_callback): Process info->dlpi_addr == 0 normally.
1422 2013-11-16 Ian Lance Taylor <iant@google.com>
1424 * backtrace.h (backtrace_create_state): Correct comment about
1427 2013-11-15 Ian Lance Taylor <iant@google.com>
1429 * backtrace.h (backtrace_syminfo): Update comment and parameter
1430 name to take any address, not just a PC value.
1431 * elf.c (STT_OBJECT): Define.
1432 (elf_nosyms): Rename parameter pc to addr.
1433 (elf_symbol_search): Rename local variable pc to addr.
1434 (elf_initialize_syminfo): Add STT_OBJECT symbols to elf_symbols.
1435 (elf_syminfo): Rename parameter pc to addr.
1436 * btest.c (global): New global variable.
1440 2013-10-17 Ian Lance Taylor <iant@google.com>
1442 * elf.c (elf_add): Don't get the wrong offsets if a debug section
1445 2013-10-15 David Malcolm <dmalcolm@redhat.com>
1447 * configure.ac: Add --enable-host-shared, setting up
1448 pre-existing PIC_FLAG variable within Makefile.am et al.
1449 * configure: Regenerate.
1451 2013-09-20 Alan Modra <amodra@gmail.com>
1453 * configure: Regenerate.
1455 2013-07-23 Alexander Monakov <amonakov@ispras.ru>
1457 * elf.c (elf_syminfo): Loop over the elf_syminfo_data chain.
1459 2013-07-23 Alexander Monakov <amonakov@ispras.ru>
1461 * elf.c (backtrace_initialize): Pass elf_fileline_fn to
1462 dl_iterate_phdr callbacks.
1464 2013-03-25 Ian Lance Taylor <iant@google.com>
1466 * alloc.c: #include <sys/types.h>.
1469 2013-01-31 Ian Lance Taylor <iant@google.com>
1471 * dwarf.c (read_function_info): Permit fvec parameter to be NULL.
1472 (dwarf_lookup_pc): Don't use ddata->fvec if threaded.
1474 2013-01-25 Jakub Jelinek <jakub@redhat.com>
1477 * dwarf.c (read_line_header): Don't crash if DW_AT_comp_dir
1478 attribute was not seen.
1480 2013-01-16 Ian Lance Taylor <iant@google.com>
1482 * dwarf.c (struct unit): Add filename and abs_filename fields.
1483 (build_address_map): Set new fields when reading unit.
1484 (dwarf_lookup_pc): If we don't find an entry in the line table,
1485 just return the main file name.
1487 2013-01-14 Richard Sandiford <rdsandiford@googlemail.com>
1489 Update copyright years.
1491 2013-01-01 Ian Lance Taylor <iant@google.com>
1494 * Makefile.am (AM_CPPFLAGS): Remove -I ../gcc/include and -I
1495 $(MULTIBUILDTOP)/../../gcc/include.
1496 * Makefile.in: Rebuild.
1498 2013-01-01 Ian Lance Taylor <iant@google.com>
1501 * mmap.c (backtrace_alloc): Don't call sync functions if not
1503 (backtrace_free): Likewise.
1505 2012-12-12 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
1507 * mmapio.c: Define MAP_FAILED if not defined.
1509 2012-12-11 Jakub Jelinek <jakub@redhat.com>
1512 * Makefile.am (AM_CFLAGS): Remove -frandom-seed=$@.
1513 * configure.ac: If --with-target-subdir, add -frandom-seed=$@
1514 to EXTRA_FLAGS unconditionally, otherwise check whether the compiler
1516 * Makefile.in: Regenerated.
1517 * configure: Regenerated.
1519 2012-12-07 Jakub Jelinek <jakub@redhat.com>
1522 * Makefile.am (AM_CFLAGS): Add -frandom-seed=$@.
1523 * Makefile.in: Regenerated.
1525 2012-11-20 Ian Lance Taylor <iant@google.com>
1527 * dwarf.c (read_attribute): Always clear val.
1529 2012-11-13 Ian Lance Taylor <iant@google.com>
1532 * configure.ac: Only add -Werror if building a target library.
1533 * configure: Rebuild.
1535 2012-11-12 Ian Lance Taylor <iant@google.com>
1536 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
1537 Gerald Pfeifer <gerald@pfeifer.com>
1539 * configure.ac: Check for getexecname.
1540 * fileline.c: #include <errno.h>. Define getexecname if not
1542 (fileline_initialize): Try to find the executable in a few
1544 * print.c (error_callback): Only print the filename if it came
1545 from the backtrace state.
1546 * configure, config.h.in: Rebuild.
1548 2012-10-29 Ian Lance Taylor <iant@google.com>
1550 * mmap.c (backtrace_vector_release): Correct last patch: add
1553 2012-10-29 Ian Lance Taylor <iant@google.com>
1555 * mmap.c (backtrace_vector_release): Make sure freed block is
1556 aligned on 8-byte boundary.
1558 2012-10-26 Ian Lance Taylor <iant@google.com>
1561 * posix.c (backtrace_open): Add does_not_exist parameter.
1562 * elf.c (phdr_callback): Do not warn if shared library could not
1564 * fileline.c (fileline_initialize): Update calls to
1566 * internal.h (backtrace_open): Update declaration.
1568 2012-10-26 Jack Howarth <howarth@bromo.med.uc.edu>
1571 * configure.ac: Check for _Unwind_GetIPInfo function declaration.
1572 * configure: Regenerate.
1574 2012-10-24 Ian Lance Taylor <iant@google.com>
1577 * configure.ac: Check whether -funwind-tables option works.
1578 * configure: Rebuild.
1580 2012-10-11 Ian Lance Taylor <iant@google.com>
1582 * configure.ac: Do not use dl_iterate_phdr on Solaris 10.
1583 * configure: Rebuild.
1585 2012-10-10 Ian Lance Taylor <iant@google.com>
1587 * elf.c: Rename all Elf typedefs to start with b_elf, and be all
1590 2012-10-10 Hans-Peter Nilsson <hp@bitrange.com>
1592 * elf.c (elf_add_syminfo_data): Add casts to avoid warning.
1594 2012-10-09 Ian Lance Taylor <iant@google.com>
1596 * dwarf.c (dwarf_fileline): Add cast to avoid warning.
1597 (backtrace_dwarf_add): Likewise.
1599 2012-10-09 Ian Lance Taylor <iant@google.com>
1601 Add support for tracing through shared libraries.
1602 * configure.ac: Check for link.h and dl_iterate_phdr.
1603 * elf.c: #include <link.h> if system has dl_iterate_phdr. #undef
1604 ELF macros before #defining them.
1605 (dl_phdr_info, dl_iterate_phdr): Define if system does not have
1607 (struct elf_syminfo_data): Add next field.
1608 (elf_initialize_syminfo): Initialize next field.
1609 (elf_add_syminfo_data): New static function.
1610 (elf_add): New static function, broken out of
1611 backtrace_initialize. Call backtrace_dwarf_add instead of
1612 backtrace_dwarf_initialize.
1613 (struct phdr_data): Define.
1614 (phdr_callback): New static function.
1615 (backtrace_initialize): Call elf_add.
1616 * dwarf.c (struct dwarf_data): Add next and base_address fields.
1617 (add_unit_addr): Add base_address parameter. Change all callers.
1618 (add_unit_ranges, build_address_map): Likewise.
1619 (add_line): Add ddata parameter. Change all callers.
1620 (read_line_program, add_function_range): Likewise.
1621 (dwarf_lookup_pc): New static function, broken out of
1623 (dwarf_fileline): Call dwarf_lookup_pc.
1624 (build_dwarf_data): New static function.
1625 (backtrace_dwarf_add): New function.
1626 (backtrace_dwarf_initialize): Remove.
1627 * internal.h (backtrace_dwarf_initialize): Don't declare.
1628 (backtrace_dwarf_add): Declare.
1629 * configure, config.h.in: Rebuild.
1631 2012-10-04 Gerald Pfeifer <gerald@pfeifer.com>
1633 * btest.c (f23): Avoid uninitialized variable warning.
1635 2012-10-04 Ian Lance Taylor <iant@google.com>
1637 * dwarf.c: If the system header files do not declare strnlen,
1638 provide our own version.
1640 2012-10-03 Ian Lance Taylor <iant@google.com>
1642 * dwarf.c (read_uleb128): Fix overflow test.
1643 (read_sleb128): Likewise.
1644 (build_address_map): Don't change unit_buf.start.
1646 2012-10-02 Uros Bizjak <ubizjak@gmail.com>
1649 * configure.ac (EXTRA_FLAGS): New.
1650 * Makefile.am (AM_FLAGS): Add $(EXTRA_FLAGS).
1651 * configure, Makefile.in: Regenerate.
1653 2012-09-29 Ian Lance Taylor <iant@google.com>
1656 * fileline.c (fileline_initialize): Pass errnum as -1 when
1657 reporting that we could not read executable information after a
1660 2012-09-27 Ian Lance Taylor <iant@google.com>
1663 * configure.ac: Add no-dependencies to AM_INIT_AUTOMAKE.
1664 * Makefile.am: Add dependencies for all objects.
1665 * configure, aclocal.m4, Makefile.in: Rebuild.
1667 2012-09-27 Ian Lance Taylor <iant@google.com>
1670 * elf.c (backtrace_initialize): Set *fileln_fn, not
1673 2012-09-19 Ian Lance Taylor <iant@google.com>
1675 * configure.ac: Only use GCC_CHECK_UNWIND_GETIPINFO when compiled
1676 as a target library.
1677 * configure: Rebuild.
1679 2012-09-19 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
1680 Ian Lance Taylor <iant@google.com>
1682 * configure.ac (GCC_HEADER_STDINT): Invoke.
1683 * backtrace.h: If we can't find <stdint.h>, use "gstdint.h".
1684 * btest.c: Don't include <stdint.h>.
1685 * dwarf.c: Likewise.
1686 * configure, aclocal.m4, Makefile.in, config.h.in: Rebuild.
1688 2012-09-18 Ian Lance Taylor <iant@google.com>
1691 * Makefile.am (AM_CPPFLAGS): Define.
1692 (AM_CFLAGS): Remove -I options.
1693 * Makefile.in: Rebuild.
1695 2012-09-18 Ian Lance Taylor <iant@google.com>
1697 * posix.c (O_BINARY): Define if not defined.
1698 (backtrace_open): Pass O_BINARY to open. Only call fcntl if
1699 HAVE_FCNTL is defined.
1700 * configure.ac: Test for the fcntl function.
1701 * configure, config.h.in: Rebuild.
1703 2012-09-18 Ian Lance Taylor <iant@google.com>
1705 * btest.c (test1, test2, test3, test4): Add the unused attribute.
1707 2012-09-18 Ian Lance Taylor <iant@google.com>
1709 * dwarf.c: Correct test of HAVE_DECL_STRNLEN.
1711 2012-09-18 Ian Lance Taylor <iant@google.com>
1713 * configure.ac: Add AC_USE_SYSTEM_EXTENSIONS.
1714 * mmapio.c: Don't define _GNU_SOURCE.
1715 * configure, config.h.in: Rebuild.
1717 2012-09-18 Ian Lance Taylor <iant@google.com>
1719 * configure.ac: Check whether strnlen is declared.
1720 * dwarf.c: Declare strnlen if not declared.
1721 * configure, config.h.in: Rebuild.
1723 2012-09-18 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
1725 * fileline.c: Include <stdlib.h>.
1728 2012-09-17 Ian Lance Taylor <iant@google.com>
1731 * nounwind.c (backtrace_full): Rename from backtrace. Add state
1734 2012-09-17 Gerald Pfeifer <gerald@pfeifer.com>
1737 * nounwind.c (backtrace_simple): Add state parameter.
1739 2012-09-17 Ian Lance Taylor <iant@google.com>
1742 * unknown.c (unknown_fileline): Add state parameter, remove
1743 fileline_data parameter, name error_callback parameter.
1744 (backtrace_initialize): Add state parameter.
1746 2012-09-17 Ian Lance Taylor <iant@google.com>
1748 * Initial implementation.
1750 Copyright (C) 2012-2021 Free Software Foundation, Inc.
1752 Copying and distribution of this file, with or without modification,
1753 are permitted in any medium without royalty provided the copyright
1754 notice and this notice are preserved.