1 2020-09-23 Ian Lance Taylor <iant@golang.org>
3 * dwarf.c (report_inlined_functions): Handle PC == -1 and PC ==
5 (dwarf_lookup_pc): Likewise.
7 2020-09-17 Ian Lance Taylor <iant@golang.org>
10 * fileline.c (backtrace_syminfo_to_full_callback): New function.
11 (backtrace_syminfo_to_full_error_callback): New function.
12 * elf.c (elf_nodebug): Call syminfo_fn if possible.
13 * internal.h (struct backtrace_call_full): Define.
14 (backtrace_syminfo_to_full_callback): Declare.
15 (backtrace_syminfo_to_full_error_callback): Declare.
16 * mtest.c (f3): Only check all[i] if data.index permits.
18 2020-09-16 Iain Sandoe <iain@sandoe.co.uk>
20 * macho.c (MACH_O_CPU_TYPE_PPC): New.
21 (MACH_O_CPU_TYPE_PPC64): New.
22 Add compile-tests for powerpc to the Mach-O variants.
24 2020-09-14 Ian Lance Taylor <iant@golang.org>
27 Add support for MiniDebugInfo.
28 * elf.c (struct elf_view): Define. Replace most uses of
29 backtrace_view with elf_view.
30 (elf_get_view): New static functions. Replace most calls of
31 backtrace_get_view with elf_get_view.
32 (elf_release_view): New static functions. Replace most calls of
33 backtrace_release_view with elf_release_view.
34 (elf_uncompress_failed): Rename from elf_zlib_failed. Change all
36 (LZMA_STATES, LZMA_POS_STATES, LZMA_DIST_STATES): Define.
37 (LZMA_DIST_SLOTS, LZMA_DIST_MODEL_START): Define.
38 (LZMA_DIST_MODEL_END, LZMA_FULL_DISTANCES): Define.
39 (LZMA_ALIGN_SIZE, LZMA_LEN_LOW_SYMBOLS): Define.
40 (LZMA_LEN_MID_SYMBOLS, LZMA_LEN_HIGH_SYMBOLS): Define.
41 (LZMA_LITERAL_CODERS_MAX, LZMA_LITERAL_CODER_SIZE): Define.
42 (LZMA_PROB_IS_MATCH_LEN, LZMA_PROB_IS_REP_LEN): Define.
43 (LZMA_PROB_IS_REP0_LEN, LZMA_PROB_IS_REP1_LEN): Define.
44 (LZMA_PROB_IS_REP2_LEN, LZMA_PROB_IS_REP0_LONG_LEN): Define.
45 (LZMA_PROB_DIST_SLOT_LEN, LZMA_PROB_DIST_SPECIAL_LEN): Define.
46 (LZMA_PROB_DIST_ALIGN_LEN): Define.
47 (LZMA_PROB_MATCH_LEN_CHOICE_LEN): Define.
48 (LZMA_PROB_MATCH_LEN_CHOICE2_LEN): Define.
49 (LZMA_PROB_MATCH_LEN_LOW_LEN): Define.
50 (LZMA_PROB_MATCH_LEN_MID_LEN): Define.
51 (LZMA_PROB_MATCH_LEN_HIGH_LEN): Define.
52 (LZMA_PROB_REP_LEN_CHOICE_LEN): Define.
53 (LZMA_PROB_REP_LEN_CHOICE2_LEN): Define.
54 (LZMA_PROB_REP_LEN_LOW_LEN): Define.
55 (LZMA_PROB_REP_LEN_MID_LEN): Define.
56 (LZMA_PROB_REP_LEN_HIGH_LEN): Define.
57 (LZMA_PROB_LITERAL_LEN): Define.
58 (LZMA_PROB_IS_MATCH_OFFSET, LZMA_PROB_IS_REP_OFFSET): Define.
59 (LZMA_PROB_IS_REP0_OFFSET, LZMA_PROB_IS_REP1_OFFSET): Define.
60 (LZMA_PROB_IS_REP2_OFFSET): Define.
61 (LZMA_PROB_IS_REP0_LONG_OFFSET): Define.
62 (LZMA_PROB_DIST_SLOT_OFFSET): Define.
63 (LZMA_PROB_DIST_SPECIAL_OFFSET): Define.
64 (LZMA_PROB_DIST_ALIGN_OFFSET): Define.
65 (LZMA_PROB_MATCH_LEN_CHOICE_OFFSET): Define.
66 (LZMA_PROB_MATCH_LEN_CHOICE2_OFFSET): Define.
67 (LZMA_PROB_MATCH_LEN_LOW_OFFSET): Define.
68 (LZMA_PROB_MATCH_LEN_MID_OFFSET): Define.
69 (LZMA_PROB_MATCH_LEN_HIGH_OFFSET): Define.
70 (LZMA_PROB_REP_LEN_CHOICE_OFFSET): Define.
71 (LZMA_PROB_REP_LEN_CHOICE2_OFFSET): Define.
72 (LZMA_PROB_REP_LEN_LOW_OFFSET): Define.
73 (LZMA_PROB_REP_LEN_MID_OFFSET): Define.
74 (LZMA_PROB_REP_LEN_HIGH_OFFSET): Define.
75 (LZMA_PROB_LITERAL_OFFSET): Define.
76 (LZMA_PROB_TOTAL_COUNT): Define.
77 (LZMA_IS_MATCH, LZMA_IS_REP, LZMA_IS_REP0): Define.
78 (LZMA_IS_REP1, LZMA_IS_REP2, LZMA_IS_REP0_LONG): Define.
79 (LZMA_DIST_SLOT, LZMA_DIST_SPECIAL, LZMA_DIST_ALIGN): Define.
80 (LZMA_MATCH_LEN_CHOICE, LZMA_MATCH_LEN_CHOICE2): Define.
81 (LZMA_MATCH_LEN_LOW, LZMA_MATCH_LEN_MID): Define.
82 (LZMA_MATCH_LEN_HIGH, LZMA_REP_LEN_CHOICE): Define.
83 (LZMA_REP_LEN_CHOICE2, LZMA_REP_LEN_LOW): Define.
84 (LZMA_REP_LEN_MID, LZMA_REP_LEN_HIGH, LZMA_LITERAL): Define.
85 (elf_lzma_varint): New static function.
86 (elf_lzma_range_normalize): New static function.
87 (elf_lzma_bit, elf_lzma_integer): New static functions.
88 (elf_lzma_reverse_integer): New static function.
89 (elf_lzma_len, elf_uncompress_lzma_block): New static functions.
90 (elf_uncompress_lzma): New static function.
91 (backtrace_uncompress_lzma): New function.
92 (elf_add): Add memory and memory_size parameters. Change all
93 callers. Look for .gnu_debugdata section, and, if found,
94 decompress it and use it for symbols and debug info. Permit the
95 descriptor parameter to be -1.
96 * internal.h (backtrace_uncompress_lzma): Declare.
99 * configure.ac: Check for nm, xz, and comm programs. Check for
101 (HAVE_MINIDEBUG): Define.
102 * Makefile.am (mtest_SOURCES): Define.
103 (mtest_CFLAGS, mtest_LDADD): Define.
104 (TESTS): Add mtest_minidebug if HAVE_MINIDEBUG.
105 (%_minidebug): New pattern rule, if HAVE_MINIDEBUG.
106 (xztest_SOURCES, xztest_CFLAGS, xztest_LDADD): Define.
107 (xztest_alloc_SOURCES, xztest_alloc_CFLAGS): Define
108 (xztest_alloc_LDADD): Define.
109 (BUILDTESTS): Add mtest, xztest, xztest_alloc.
110 (CLEANFILES): Add files created by minidebug pattern.
111 (btest.lo): Correct INCDIR reference.
112 (mtest.lo, xztest.lo, ztest.lo): New targets.
113 * configure: Regenerate.
114 * config.h.in: Regenerate.
115 * Makefile.in: Regenerate.
117 2020-09-09 Ian Lance Taylor <iant@golang.org>
119 * pecoff.c (coff_initialize_syminfo): Add is_64 parameter.
120 (coff_add): Determine and pass is_64.
122 2020-09-09 Ian Lance Taylor <iant@golang.org>
124 PR libbacktrace/96973
125 * fileline.c (macho_get_executable_path): New static function.
126 (fileline_initialize): Call macho_get_executable_path.
128 2020-09-09 Ian Lance Taylor <iant@golang.org>
130 * dwarf.c (function_addrs_search): Compare against the next entry
131 low address, not the high address.
132 (unit_addrs_search): Likewise.
133 (build_address_map): Add a trailing unit_addrs.
134 (read_function_entry): Add a trailing function_addrs.
135 (read_function_info): Likewise.
136 (report_inlined_functions): Search backward for function_addrs
138 (dwarf_lookup_pc): Search backward for unit_addrs and
139 function_addrs matches.
141 2020-09-08 Ian Lance Taylor <iant@golang.org>
143 * simple.c (simple_unwind): Correct comment spelling.
145 2020-09-08 Ian Lance Taylor <iant@golang.org>
147 * macho.c (macho_add_dsym): Make space for '/' in dsym. Use
148 correct length when freeing diralc.
150 2020-09-08 Ian Lance Taylor <iant@golang.org>
152 PR libbacktrace/96973
153 * macho.c (macho_add_fat): Correctly swap 32-bit file offset.
155 2020-09-08 Ian Lance Taylor <iant@golang.org>
157 PR libbacktrace/96971
158 * filetype.awk: Only match magic number at start of line.
160 2020-08-24 Ian Lance Taylor <iant@golang.org>
162 * macho.c (MACH_O_MH_MAGIC_FAT_64): Define.
163 (MACH_O_MH_CIGAM_FAT_64): Define.
164 (struct macho_fat_arch_64): Define.
165 (macho_add_fat): Add and use is_64 parameter.
166 (macho_add): Recognize 64-bit fat files.
168 2020-07-30 H.J. Lu <hjl.tools@gmail.com>
171 * configure: Regenerated.
173 2020-07-08 Ian Lance Taylor <iant@golang.org>
175 * configure.ac: Test linker support for DWARF5
176 * configure: Regenerate
178 2020-05-29 H.J. Lu <hjl.tools@gmail.com>
181 * configure: Regenerated.
183 2020-05-15 H.J. Lu <hongjiu.lu@intel.com>
186 * configure: Regenerated.
188 2020-05-14 H.J. Lu <hongjiu.lu@intel.com>
190 * configure: Regenerated.
192 2020-05-13 Ian Lance Taylor <iant@golang.org>
194 * ztest.c (test_large): Mark state ATTRIBUTE_UNUSED.
196 2020-05-13 Ian Lance Taylor <iant@golang.org>
199 * posix.c (backtrace_open): Treat EACCESS like ENOENT.
201 2020-05-12 H.J. Lu <hongjiu.lu@intel.com>
203 * Makefile.am (AM_CFLAGS): Add $(CET_HOST_FLAGS).
204 * configure.ac: Add GCC_CET_HOST_FLAGS(CET_HOST_FLAGS) and
205 AC_SUBST(CET_HOST_FLAGS). Clear CET_HOST_FLAGS if jit isn't
207 * Makefile.in: Regenerated.
208 * configure: Likewise.
210 2020-05-11 Ian Lance Taylor <iant@golang.org>
212 PR libbacktrace/95012
213 * configure.ac: Check for getpagesize declaration.
214 * mmap.c: Declare getpagesize if necessary.
215 * mmapio.c: Likewise.
216 * configure: Regenerate.
217 * config.h.in: Regenerate.
218 * Makefile.in: Regenerate.
220 2020-05-09 Roland McGrath <mcgrathr@google.com>
222 * elf.c (elf_add): Bail early if there are no section headers at all.
224 2020-05-09 Ian Lance Taylor <iant@golang.org>
226 * elf.c (elf_add): Don't free strtab if an error occurs after
227 recording symbol information.
229 2020-05-09 Ian Lance Taylor <iant@golang.org>
231 PR libbacktrace/88745
233 * filetype.awk: Recognize Mach-O files.
234 * Makefile.am (FORMAT_FILES): Add macho.c.
235 (check_DATA): New variable. Set to .dSYM if HAVE_DSYMUTIL.
236 (%.dSYM): New pattern target.
237 (test_macho_SOURCES, test_macho_CFLAGS): New targets.
238 (test_macho_LDADD): New target.
239 (BUILDTESTS): Add test_macho.
240 (macho.lo): Add dependencies.
241 * configure.ac: Recognize macho file type. Check for
242 mach-o/dyld.h. Don't try to run objcopy if we don't find it.
243 Look for dsymutil and define a HAVE_DSYMUTIL conditional.
244 * Makefile.in: Regenerate.
245 * configure: Regenerate.
246 * config.h.in: Regenerate.
248 2020-05-09 Ian Lance Taylor <iant@golang.org>
250 * read.c (backtrace_get_view): Support short read.
252 2020-05-09 Ian Lance Taylor <iant@golang.org>
254 * elf.c (elf_add): If debug sections are very large or far apart,
255 read them individually rather than as a single view.
257 2020-05-08 Ian Lance Taylor <iant@golang.org>
259 * fileline.c (sysctl_exec_name): New static function.
260 (sysctl_exec_name1): New macro or static function.
261 (sysctl_exec_name2): Likewise.
262 (fileline_initialize): Try sysctl_exec_name[12].
263 * configure.ac: Check for sysctl args to fetch executable name.
264 * configure: Regenerate.
265 * config.h.in: Regenerate.
267 2020-02-15 Ian Lance Taylor <iant@golang.org>
269 * ztest.c (test_large): Update file to current libgo test file.
271 2020-02-03 Ian Lance Taylor <iant@golang.org>
273 * Makefile.am (libbacktrace_TEST_CFLAGS): Define.
274 (test_elf32_CFLAGS): Use $(libbacktrace_test_CFLAGS).
275 (test_elf_64_CFLAGS, test_xcoff_32_CFLAGS): Likewise.
276 (test_xcoff_64_CFLAGS, test_pecoff_CFLAGS): Likewise.
277 (test_unknown_CFLAGS, unittest_CFLAGS): Likewise.
278 (unittest_alloc_CFLAGS, allocfail_CFLAGS): Likewise.
279 (b2test_CFLAGS, b3test_CFLAGS, btest_CFLAGS): Likewise.
280 (btest_lto_CFLAGS, btest_alloc_CFLAGS, stest_CFLAGS): Likewise.
281 (stest_alloc_CFLAGS): Likewise.
282 * Makefile.in: Regenerate.
283 * ztest.c (error_callback_compress): Mark vdata unused.
284 (test_large): Add casts to avoid warnings.
286 2020-01-01 Jakub Jelinek <jakub@redhat.com>
288 Update copyright years.
290 2019-12-13 Ian Lance Taylor <iant@golang.org>
293 * dwarf.c (struct attr): Add val field.
294 (enum attr_val_encoding): Add ATTR_VAL_ADDDRESS_INDEX,
295 ATTR_VAL_STRING_INDEX, ATTR_VAL_RNGLISTS_INDEX.
296 (struct line_header): Add addrsize field.
297 (struct line_header_format): Define.
298 (struct unit): Add str_offsets_base, addr_base, and rnglists_base
300 (read_uint24): New static function.
301 (read_attribute): Add implicit_val parameter. Replace dwarf_str
302 and dwarf_str_size parameters with dwarf_sections parameter. Add
303 support for new DWARF 5 forms. Change all callers.
304 (resolve_string): New static function.
305 (resolve_addr_index): Likewise.
306 (read_abbrevs): Support DW_FORM_implicit_const.
307 (struct pcrange): Add lowpc_is_addr_index, highpc_is_addr_Index,
308 and ranges_is_index fields.
309 (update_pcrange): Support DWARF 5 encodings.
310 (add_high_low_range): New static function, split out of
312 (add_ranges_from_ranges): Likewise.
313 (add_ranges_from_rnglists): New static function.
314 (add_ranges): Just call new helper functions.
315 (find_address_ranges): Use resolve_string for strings, after
316 reading all attributes. Handle new DWARF 5 attributes.
317 (build_address_map): Support DWARF 5 compilation units.
318 (read_v2_paths): New static function, split out of
320 (read_lnct): New static function.
321 (read_line_header_format_entries): Likewise.
322 (read_line_header): Add ddata parameter. Support DWARF 5 line
323 headers. Call new helper functions. Change all callers.
324 (read_line_program): Use addrsize from line program header. Don't
325 special case directory index 0 for DWARF 5.
326 (read_referenced_name): Use resolve_string.
327 (read_function_entry): Handle DWARF 5 encodings. Use
329 * internal.h (enum dwarf_section): Add DEBUG_ADDR,
330 DEBUG_STR_OFFSETS, DEBUG_LINE_STR, DEBUG_RNGLISTS.
331 * elf.c (dwarf_section_names): Add new section names.
332 * pecoff.c (dwarf_section_names): Likewise.
333 * xcoff.c (xcoff_add): Clear dwarf_sections before setting
335 * configure.ac: Define HAVE_DWARF5 automake conditional.
336 * Makefile.am (dwarf5_SOURCES): New variable if HAVE_DWARF5.
337 (dwarf5_CFLAGS, dwarf5_LDADD): Likewise.
338 (dwarf5_alloc_SOURCES, dwarf5_alloc_CFLAGS): Likewise.
339 (dwarf5_alloc_LDADD): Likewise.
340 (BUILDTESTS): Add dwarf5 tests if HAVE_DWARF5.
341 (CLEANFILES, clean-local): Define.
343 2019-12-08 Ian Lance Taylor <iant@golang.org>
345 * dwarf.c (struct pcrange): Define.
346 (update_pcrange, add_ranges): New static functions.
347 (add_unit_addr): Change signature to work with add_ranges. Don't
348 add base_address here.
349 (add_unit_ranges): Remove.
350 (find_address_ranges): Replace str/ranges parameters with
351 dwarf_sections. Use update_pcrange and add_ranges. Change all
353 (add_function_range): Change signature to work with add_ranges.
354 Don't add base_address here.
355 (add_function_ranges): Remove.
356 (read_function_entry): Use update_pcrange and add_ranges.
358 2019-12-04 Ian Lance Taylor <iant@golang.org>
360 * edtest.c (test1): Add noclone attribute.
362 2019-12-04 Ian Lance Taylor <iant@golang.org>
364 * internal.h (enum dwarf_section): Define.
365 (struct dwarf_sections): Define.
366 (backtrace_dwarf_add): Update declaration to replace specific
367 section parameters with dwarf_sections parameter.
368 * dwarf.c (struct dwarf_data): Replace specific section fields
369 with dwarf_sections field.
370 (read_attribute): Use dwarf_sections with altlink.
371 (build_address_map): Replace specific section parameters with
372 dwarf_sections parameter. Change all callers.
373 (read_line_info): Use dwarf_sections with ddata.
374 (read_referenced_name): Likewise.
375 (add_function_ranges): Likewise.
376 (read_function_entry): Likewise.
377 (read_function_info): Likewise.
378 (build_dwarf_data): Replace specific section parameters with
379 dwarf_sections parameter. Change all callers.
380 (backtrace_dwarf_add): Likewise.
381 * elf.c (enum debug_section): Remove.
382 (dwarf_section_names): Remove .zdebug names.
383 (elf_add): Track zsections separately. Build dwarf_sections.
384 * pecoff.c (enum debug_section): Remove.
385 (struct debug_section_info): Remove data field.
386 (coff_add): Build dwarf_sections.
387 * xcoff.c (enum dwarf_section): Remove. Replace DWSECT_xxx
388 references with DEBUG_xxx references.
389 (xcoff_add): Build dwarf_sections.
391 2019-09-27 Maciej W. Rozycki <macro@wdc.com>
393 * configure: Regenerate.
395 2019-09-26 Ian Lance Taylor <iant@golang.org>
397 PR libbacktrace/91908
398 * pecoff.c (backtrace_initialize): Explicitly cast unchecked
399 __sync_bool_compare_and_swap to void.
400 * xcoff.c (backtrace_initialize): Likewise.
402 2019-09-03 Ulrich Weigand <uweigand@de.ibm.com>
404 * configure.ac: Remove references to spu.
405 * configure: Regenerate.
407 2019-05-24 Clement Chigot <clement.chigot@atos.net>
409 * Makefile.am (BUILDTESTS): Remove test_elf, add test_elf_32 and
411 * Makefile.in: Regenerate.
413 2019-05-14 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
415 * configure.ac (have_dl_iterate_phdr): Remove *-*-solaris2.10*
417 * configure: Regenerate.
419 2019-03-11 Ian Lance Taylor <iant@golang.org>
421 PR libbacktrace/89669
422 * Makefile.am (BUILDTESTS): Only add ztest and ztest_alloc if
424 * Makefile.in: Regenerate.
426 2019-02-26 Tom de Vries <tdevries@suse.de>
428 * btest.c (test5): Allow global.* as minimal symbol name for global.
430 2019-02-26 Tom de Vries <tdevries@suse.de>
432 * Makefile.am (TESTS): Only add b3test_dwz_buildid if HAVE_DWZ.
433 * Makefile.in: Regenerate.
435 2019-02-12 Tom de Vries <tdevries@suse.de>
437 PR libbacktrace/81983
438 * dwarf.c (dwarf_lookup_pc): Don't call bsearch if nmemb == 0.
440 2019-02-10 Tom de Vries <tdevries@suse.de>
442 * Makefile.am (BUILDTESTS): Add btest_lto.
443 * Makefile.in: Regenerate.
444 * btest.c (test1, f2, f3, test3, f22, f23): Declare with
445 __attribute__((noclone)).
447 2019-02-08 Tom de Vries <tdevries@suse.de>
449 * backtrace.c (backtrace_full): Declare with __attribute__((noinline)).
450 * print.c (backtrace_print): Same.
451 * simple.c (backtrace_simple): Same.
453 2019-02-08 Tom de Vries <tdevries@suse.de>
455 PR libbacktrace/78063
456 * dwarf.c (build_address_map): Keep all parsed units.
457 (read_referenced_name_from_attr): Handle DW_FORM_ref_addr.
459 2019-01-31 Tom de Vries <tdevries@suse.de>
461 PR libbacktrace/89136
462 * elf.c (elf_add): Read build-id if with_buildid_data. Fix
463 'debugaltlink_name_len =+ 1'.
465 2019-01-29 Tom de Vries <tdevries@suse.de>
467 * install-debuginfo-for-buildid.sh.in: New script.
468 * Makefile.am (check_PROGRAMS): Add b2test and b3test.
469 (TESTS): Add b2test_buildid and b3test_dwz_buildid.
470 * Makefile.in: Regenerate.
471 * configure.ac (HAVE_ELF): Set with AM_CONDITIONAL.
472 (READELF): Set with AC_CHECK_PROG.
473 (install-debuginfo-for-buildid.sh): Generate with AC_CONFIG_FILES.
474 * configure: Regenerate.
475 * elf.c (SYSTEM_BUILD_ID_DIR): Factor out of ...
476 (elf_open_debugfile_by_buildid): ... here.
478 2019-01-29 Tom de Vries <tdevries@suse.de>
480 * Makefile.am: Replace check_PROGRAMS with BUILDTESTS, except for
482 (TESTS): Don't add check_PROGRAMS. Add BUILDTESTS.
483 (check_PROGRAMS): Add BUILDTESTS.
484 * Makefile.in: Regenerate.
486 2019-01-28 Tom de Vries <tdevries@suse.de>
488 * Makefile.am (xcoff_%.c): Generate sed result into temporary file.
489 Use $< to access prerequisite.
490 * Makefile.in: Regenerate.
492 2019-01-25 Nathan Sidwell <nathan@acm.org>
494 * elf.c (elf_add): Pass "" filename to recursive call with
497 2019-01-25 Tom de Vries <tdevries@suse.de>
499 * elf.c (elf_add): When handling .gnu_debugaltlink, call elf_add with
501 * Makefile.am (TESTS): Add btest_dwz_gnudebuglink.
502 * Makefile.in: Regenerate.
504 2019-01-25 Tom de Vries <tdevries@suse.de>
506 * Makefile.am: Rewrite dtest rule into "%_gnudebuglink" pattern rule.
507 (TESTS): Rename dtest to btest_gnudebuglink.
508 * Makefile.in: Regenerate.
510 2019-01-23 Tom de Vries <tdevries@suse.de>
512 * dwarf.c (struct unit): Use size_t for low_offset/high_offset fields.
513 (units_search, find_unit): Use size_t for offset.
514 (build_address_map): Use size_t for unit_offset.
516 2019-01-20 Gerald Pfeifer <gerald@pfeifer.com>
518 * allocfail.c (main): Increase portability of printf statement.
520 2019-01-18 Ian Lance Taylor <iant@golang.org>
522 PR libbacktrace/88890
523 * mmapio.c (backtrace_get_view): Change size parameter to
524 uint64_t. Check that value fits in size_t.
525 * read.c (backtrace_get_view): Likewise.
526 * internal.h (backtrace_get_view): Update declaration.
527 * elf.c (elf_add): Pass shstrhdr->sh_size to backtrace_get_view.
529 2019-01-17 Tom de Vries <tdevries@suse.de>
531 PR libbacktrace/82857
532 * configure.ac (DWZ): Set with AC_CHECK_PROG.
533 (HAVE_DWZ): Set with AM_CONDITIONAL.
534 * configure: Regenerate.
535 * Makefile.am (TESTS): Add btest_dwz.
536 * Makefile.in: Regenerate.
538 2019-01-17 Tom de Vries <tdevries@suse.de>
540 PR libbacktrace/82857
541 * dwarf.c (enum attr_val_encoding): Add ATTR_VAL_REF_ALT_INFO.
542 (read_attribute): Handle DW_FORM_GNU_ref_alt using
543 ATTR_VAL_REF_ALT_INFO.
544 (read_referenced_name_from_attr): Handle DW_FORM_GNU_ref_alt.
546 2019-01-17 Tom de Vries <tdevries@suse.de>
548 * dwarf.c (struct unit): Add low_offset and high_offset fields.
549 (struct unit_vector): New type.
550 (struct dwarf_data): Add units and units_counts fields.
551 (find_unit): New function.
552 (find_address_ranges): Add and handle unit_tag parameter.
553 (build_address_map): Add and handle units_vec parameter.
554 (build_dwarf_data): Pass units_vec to build_address_map. Store resulting
557 2019-01-17 Tom de Vries <tdevries@suse.de>
559 PR libbacktrace/82857
560 * dwarf.c (read_attribute): Handle DW_FORM_GNU_strp_alt
563 2019-01-17 Tom de Vries <tdevries@suse.de>
565 * dwarf.c (enum attr_val_encoding): Add ATTR_VAL_NONE.
566 (read_attribute): Add altlink parameter. Handle missing altlink for
567 DW_FORM_GNU_strp_alt and DW_FORM_GNU_ref_alt.
568 (find_address_ranges, build_address_map, build_dwarf_data): Add and
569 handle altlink parameter.
570 (read_referenced_name, read_function_entry): Add argument to
573 2019-01-17 Tom de Vries <tdevries@suse.de>
575 * dwarf.c (struct dwarf_data): Add altlink field.
576 (backtrace_dwarf_add): Add and handle fileline_altlink parameter.
577 * elf.c (elf_add): Add argument to backtrace_dwarf_add call.
578 (phdr_callback, backtrace_initialize): Add argument to elf_add calls.
579 * internal.h (backtrace_dwarf_add): Add fileline_altlink parameter.
580 * pecoff.c (coff_add): Add argument to backtrace_dwarf_add call.
581 * xcoff.c (xcoff_add): Same.
583 2019-01-17 Tom de Vries <tdevries@suse.de>
585 * internal.h (backtrace_dwarf_add): Add fileline_entry parameter.
586 * dwarf.c (backtrace_dwarf_add): Add and handle fileline_entry parameter.
587 * elf.c (elf_add): Add and handle fileline_entry parameter. Add
588 argument to backtrace_dwarf_add call.
589 (phdr_callback, backtrace_initialize): Add argument to elf_add calls.
590 * pecoff.c (coff_add): Add argument to backtrace_dwarf_add call.
591 * xcoff.c (xcoff_add): Same.
593 2019-01-17 Tom de Vries <tdevries@suse.de>
595 * elf.c (elf_add): Add and handle with_buildid_data and
596 with_buildid_size parameters. Handle .gnu_debugaltlink section.
597 (phdr_callback, backtrace_initialize): Add arguments to elf_add calls.
599 2019-01-16 Tom de Vries <tdevries@suse.de>
601 * dwarf.c (read_referenced_name_from_attr): New function. Factor out
603 (read_referenced_name): ... here, and ...
604 (read_function_entry): ... here.
606 2019-01-16 Tom de Vries <tdevries@suse.de>
608 * dwarf.c (read_referenced_name): Don't allow DW_AT_name to override any
610 (read_function_entry): Same. Don't allow name found via
611 DW_AT_abstract_origin or case DW_AT_specification to override linkage
614 2019-01-09 Sandra Loosemore <sandra@codesourcery.com>
618 * backtrace.h: Mechanically replace "can not" with "cannot".
620 2019-01-01 Jakub Jelinek <jakub@redhat.com>
622 Update copyright years.
624 2018-12-29 Gerald Pfeifer <gerald@pfeifer.com>
626 * Makefile.am (xcoff_%.c): Use an actual newline instead of \n
628 * Makefile.in: Regenerate.
630 2018-12-28 Tom de Vries <tdevries@suse.de>
632 * dwarf.c (build_address_map): Reuse unused units.
634 2018-12-28 Tom de Vries <tdevries@suse.de>
636 * dwarf.c (build_address_map): Simplify by removing local variable
639 2018-12-28 Ian Lance Taylor <iant@golang.org>
640 Tom de Vries <tdevries@suse.de>
642 PR libbacktrace/88063
643 * dwarf.c (free_unit_addrs_vector): Remove.
644 (build_address_map): Keep track of allocated units in vector. Free
645 allocated units and corresponding abbrevs upon failure. Remove now
646 redundant call to free_unit_addrs_vector. Free addrs vector upon
647 failure. Free allocated unit vector.
649 2018-12-28 Tom de Vries <tdevries@suse.de>
651 * dwarf.c (build_address_map): Free addrs vector upon failure.
653 2018-12-14 Tom de Vries <tdevries@suse.de>
656 * allocfail.sh: Remove "set -o pipefail".
658 2018-12-12 Tom de Vries <tdevries@suse.de>
660 * Makefile.am (TESTS): Add allocfail.sh.
661 (check_PROGRAMS): Add allocfail.
662 * Makefile.in: Regenerate.
663 * instrumented_alloc.c: New file. Redefine malloc and realloc.
665 * allocfail.c: New file.
666 * allocfail.sh: New file.
668 2018-11-30 Tom de Vries <tdevries@suse.de>
670 * Makefile.am (check_PROGRAMS): Add test_elf, test_xcoff_32,
671 test_xcoff_64, test_pecoff and test_unknown.
672 * Makefile.in: Regenerate.
673 * test_format.c: New file.
675 2018-11-30 Tom de Vries <tdevries@suse.de>
677 * Makefile.am : Add _with_alloc version for each test in
679 * Makefile.in: Regenerate.
681 2018-11-30 Tom de Vries <tdevries@suse.de>
683 * internal.h (backtrace_vector_free): New static inline fuction,
685 * dwarf.c (read_line_info): ... here.
687 2018-11-28 Tom de Vries <tdevries@suse.de>
689 * dwarf.c (read_abbrevs): Fix handling of abbrevs->abbrevs allocation
692 2018-11-27 Tom de Vries <tdevries@suse.de>
694 * mmap.c (backtrace_vector_release): Same.
695 * unittest.c (test1): Add check.
697 2018-11-27 Tom de Vries <tdevries@suse.de>
699 * alloc.c (backtrace_vector_release): Handle vec->size == 0 using free
701 * Makefile.am (check_PROGRAMS): Add unittest.
702 * Makefile.in: Regenerate.
703 * unittest.c: New file.
705 2018-11-22 Tom de Vries <tdevries@suse.de>
707 * dwarf.c (read_initial_length): Factor out of ...
708 (build_address_map, read_line_info): ... here.
710 2018-11-21 Tom de Vries <tdevries@suse.de>
712 * dwarf.c (read_string): Factor out of ...
713 (read_attribute, read_line_header, read_line_program): ... here.
715 2018-10-31 Joseph Myers <joseph@codesourcery.com>
718 * Makefile.am: Include multilib.am.
719 * configure.ac: Remove AC_PREREQ. Use AC_LANG_SOURCE.
720 * Makefile.in, aclocal.m4, config.h.in, configure: Regenerate.
722 2018-10-05 Ian Lance Taylor <iant@golang.org>
724 PR libbacktrace/87529
725 * backtrace.h: Document that backtrace_create_state should be
728 2018-08-05 Iain Buclaw <ibuclaw@gdcproject.org>
730 * configure.ac: Move define of HAVE_ZLIB into check for -lz.
731 * Makefile.in: Regenerate.
732 * config.h.in: Likewise.
733 * configure: Likewise.
735 2018-08-01 Tony Reix <tony.reix@atos.net>
737 * xcoff.c (struct xcoff_line, struct xcoff_line_vector): Remove.
738 (struct xcoff_func, struct xcoff_func_vector): New structs.
739 (xcoff_syminfo): Drop leading dot from symbol name.
740 (xcoff_line_compare, xcoff_line_search): Remove.
741 (xcoff_func_compare, xcoff_func_search): New static functions.
742 (xcoff_lookup_pc): Search function table.
743 (xcoff_add_line, xcoff_process_linenos): Remove.
744 (xcoff_initialize_fileline): Build function table.
746 2018-06-21 Denis Khalikov <d.khalikov@partner.samsung.com>
749 * elf.c (elf_add): Increase ".note.gnu.build-id" section size
750 checking up to 36 bytes.
752 2018-04-24 H.J. Lu <hongjiu.lu@intel.com>
754 * configure: Regenerated.
756 2018-04-19 Jakub Jelinek <jakub@redhat.com>
758 * configure: Regenerated.
760 2018-04-17 Ian Lance Taylor <iant@golang.org>
762 * backtrace.c: Revert last two changes. Don't call mmap
765 2018-04-17 Ian Lance Taylor <iant@golang.org>
767 * backtrace.c: Include backtrace-supported.h before checking
768 BACKTRACE_USES_MALLOC.
770 2018-04-17 Ian Lance Taylor <iant@golang.org>
772 * backtrace.c (backtrace_full): When testing whether we can
773 allocate memory, call mmap directly, and munmap the memory.
775 2018-04-04 Jakub Jelinek <jakub@redhat.com>
778 * elf.c (elf_zlib_fetch): Fix up predefined macro names in test for
779 big endian, only use 32-bit loads if endianity macros are predefined
780 and indicate big or little endian.
782 2018-02-14 Igor Tsimbalist <igor.v.tsimbalist@intel.com>
785 * configure: Regenerate.
787 2018-02-15 Jakub Jelinek <jakub@redhat.com>
790 * elf.c (SHT_PROGBITS): Undefine and define.
792 2018-02-14 Jakub Jelinek <jakub@redhat.com>
795 * elf.c (EM_PPC64, EF_PPC64_ABI): Undefine and define.
796 (struct elf_ppc64_opd_data): New type.
797 (elf_initialize_syminfo): Add opd argument, handle symbols
798 pointing into the PowerPC64 ELFv1 .opd section.
799 (elf_add): Read .opd section on PowerPC64 ELFv1, pass pointer
800 to structure with .opd data to elf_initialize_syminfo.
802 2018-01-31 Ian Lance Taylor <iant@golang.org>
804 * elf.c (elf_add): Close descriptor if we use a debugfile.
805 * btest.c (check_open_files): New static function.
806 (main): Call check_open_files.
808 2018-01-25 Ian Lance Taylor <iant@golang.org>
810 * elf.c (elf_open_debugfile_by_debuglink): Don't check CRC if the
812 (elf_add): Don't clear *found_sym and *found_dwarf if debuginfo.
814 2018-01-25 Ian Lance Taylor <iant@golang.org>
816 * pecoff.c (coff_add): Only release syms_view if it is valid.
818 2018-01-25 Ian Lance Taylor <iant@golang.org>
820 * pecoff.c (coff_add): Another memcpy -> coff_read4 fix.
822 2018-01-24 Ian Lance Taylor <iant@golang.org>
824 * pecoff.c (coff_add): Use coff_read4, not memcpy.
826 2018-01-24 Ian Lance Taylor <iant@golang.org>
829 * mmap.c (backtrace_free_locked): Don't put more than 16 entries
832 2018-01-19 Tony Reix <tony.reix@atos.net>
834 * xcoff.c (xcoff_incl_compare): New function.
835 (xcoff_incl_search): New function.
836 (xcoff_process_linenos): Use bsearch to find include file.
837 (xcoff_initialize_fileline): Sort include file information.
839 2018-01-16 Ian Lance Taylor <iant@golang.org>
841 * elf.c (codes) [GENERATE_FIXED_HUFFMAN_TABLE]: Fix size to be
843 (main) [GENERATE_FIXED_HUFFMAN_TABLE]: Pass 288 to
844 elf_zlib_inflate_table. Generate elf_zlib_default_dist_table.
845 (elf_zlib_default_table): Update.
846 (elf_zlib_default_dist_table): New static array.
847 (elf_zlib_inflate): Use elf_zlib_default_dist_table for dist table
849 * ztest.c (struct zlib_test): Add uncompressed_len.
850 (tests): Initialize uncompressed_len field. Add new test case.
851 (test_samples): Use uncompressed_len field.
853 2018-01-03 Jakub Jelinek <jakub@redhat.com>
855 Update copyright years.
857 2017-11-17 Igor Tsimbalist <igor.v.tsimbalist@intel.com>
859 * configure.ac: Add CET_FLAGS to EXTRA_FLAGS.
860 * aclocal.m4: Regenerate.
861 * Makefile.in: Likewise.
862 * configure: Likewise.
864 2017-10-06 Ian Lance Taylor <iant@golang.org>
866 * ztest.c (test_large): Pass unsigned long *, not size_t *, to
867 zlib uncompress function.
869 2017-10-05 Ian Lance Taylor <iant@golang.org>
871 * elf.c (elf_zlib_fetch): Change pval argument to uint64_t *.
872 Read a four byte integer.
873 (elf_zlib_inflate): Change val to uint64_t. Align pin to a 32-bit
874 boundary before ever calling elf_zlib_fetch.
875 * ztest.c (test_large): Simplify print statements a bit.
877 2017-10-02 Ian Lance Taylor <iant@golang.org>
879 * ztest.c: #include <errno.h>.
880 (TEST_TIMING): Don't define, don't test.
881 (xclock_gettime, xclockid_t): Define if !HAVE_CLOCK_GETTIME.
882 (clockid_t, clock_gettime, CLOCK_REALTIME): Likewise.
883 (ZLIB_CLOCK_GETTIME_ARG): Define.
884 * configure.ac: Change clock_gettime_link to CLOCK_GETTIME_LINK.
885 * Makefile.am: Likewise.
886 * configure, Makefile.in: Rebuild.
888 2017-10-02 Thomas Schwinge <thomas@codesourcery.com>
891 * Makefile.am: Append the content of clock_gettime_link to
893 * configure.ac: Test for the case that clock_gettime is in librt.
894 * Makefile.in: Regenerate.
895 * configure: Likewise.
898 * configure.ac: Check for clock_gettime.
899 * config.h.in: Regenerate.
900 * configure: Likewise.
901 * ztest.c (average_time, test_large): Conditionalize test timing
902 on clock_gettime availability.
904 2017-09-29 Tony Reix <tony.reix@atos.net>
906 * xcoff.c: Initial support for DWARF debug sections in XCOFF.
907 (STYP_DWARF, SSUBTYP_DW*): Define.
908 (enum dwarf_section): Define.
909 (struct dwsect_info): Define.
910 (xcoff_add): Look for DWARF sections, pass them to
913 2017-09-28 Ian Lance Taylor <iant@golang.org>
916 * elf.c (__builtin_prefetch): Define if not __GNUC__.
918 (SHF_UNCOMPRESSED, ELFCOMPRESS_ZLIB): Define.
919 (b_elf_chdr): Define type.
920 (enum debug_section): Add ZDEBUG_xxx values.
921 (debug_section_names): Add names for new sections.
922 (struct debug_section_info): Add compressed field.
923 (elf_zlib_failed, elf_zlib_fetch): New static functions.
924 (HUFFMAN_TABLE_SIZE, HUFFMAN_VALUE_MASK): Define.
925 (HUFFMAN_BITS_SHIFT, HUFFMAN_BITS_MASK): Define.
926 (HUFFMAN_SECONDARY_SHIFT): Define.
927 (ZDEBUG_TABLE_SIZE): Define.
928 (ZDEBUG_TABLE_CODELEN_OFFSET, ZDEBUG_TABLE_WORK_OFFSET): Define.
929 (final_next_secondary): New static variable if
930 BACKTRACE_GENERATE_FIXED_HUFFMAN_TABLE.
931 (elf_zlib_inflate_table): New static function.
932 (BACKTRACE_GENERATE_FIXED_HUFFMAN_TABLE): If define, define main
933 function to produce fixed Huffman table.
934 (elf_zlib_default_table): New static variable.
935 (elf_zlib_inflate): New static function.
936 (elf_zlib_verify_checksum): Likewise.
937 (elf_zlib_inflate_and_verify): Likewise.
938 (elf_uncompress_zdebug): Likewise.
939 (elf_uncompress_chdr): Likewise.
940 (backtrace_uncompress_zdebug): New extern function.
941 (elf_add): Look for .zdebug sections and SHF_COMPRESSED debug
942 sections, and uncompress them.
943 * internal.h (backtrace_compress_zdebug): Declare.
945 * configure.ac: Check for -lz and check whether the linker
946 supports --compress-debug-sections.
947 * Makefile.am (ztest_SOURCES): New variable.
948 (ztest_CFLAGS, ztest_LDADD): New variables.
949 (check_PROGRAMS): Add ztest.
950 (ctestg_SOURCES): New variable.
951 (ctestg_CFLAGS, ctestg_LDFLAGS, ctestg_LDADD): New variables.
952 (ctesta_SOURCES): New variable.
953 (ctesta_CFLAGS, ctesta_LDFLAGS, ctesta_LDADD): New variables.
954 (check_PROGRAMS): Add ctestg and ctesta.
955 * configure, config.h.in, Makefile.in: Rebuild.
957 2017-09-22 Ian Lance Taylor <iant@golang.org>
960 * configure.ac: Check for lstat and readlink.
961 * elf.c (lstat, readlink): Provide dummy versions if real versions
963 * configure, config.h.in: Rebuild.
965 2017-09-21 Ian Lance Taylor <iant@google.com>
968 * elf.c (backtrace_initialize): Set pd.exe_filename.
970 2017-09-20 Ian Lance Taylor <iant@golang.org>
971 Denis Khalikov <d.khalikov@partner.samsung.com>
974 Support for external debug info.
975 * elf.c: Include <errno.h>, <sys/stat.h>, <unistd.h>.
976 (S_ISLNK): Define if not defined.
977 (xstrnlen): Define if strnlen is not available.
978 (b_elf_note): Define type.
979 (NT_GNU_BUILD_ID): Define macro.
980 (elf_crc32, elf_crc32_file): New static functions.
981 (elf_is_symlink, elf_readlink): New static functions.
982 (elf_open_debugfile_by_buildid): New static function.
983 (elf_try_debugfile): New static function.
984 (elf_find_debugfile_by_debuglink): New static function.
985 (elf_open_debugfile_by_debuglink): New static function.
986 (elf_add): Add filename and debuginfo parameters. Adjust all
987 callers. Look for external debug info notes, and try to fetch
988 debug info from external file.
989 (struct phdr_data): Add exe_filename field.
990 (phdr_callback): Pass filename to elf_add.
991 (backtrace_initialize): Add filename parameter.
992 * internal.h (backtrace_initialize): Add filename parameter.
993 * fileline.c (fileline_initialize): Pass filename to
994 backtrace_initialize.
995 * pecoff.c (fileline_initialize): Add unused filename parameter.
996 * unknown.c (fileline_initialize): Likewise.
997 * xcoff.c (fileline_initialize): Likewise.
998 * configure.ac: Check for objcopy --add-gnu-debuglink.
999 * Makefile.am (dtest): New test target.
1000 * configure, Makefile.in: Rebuild.
1002 2017-09-12 Steve Ellcey <sellcey@cavium.com>
1005 * Makefile.am (ttest_CFLAGS): Add $(AM_CFLAGS)
1006 * Makefile.in: Regenerate.
1008 2017-09-12 Steve Ellcey <sellcey@cavium.com>
1011 * libbacktrace/Makefile.in
1012 (HAVE_PTHREAD_TRUE@@NATIVE_TRUE@ttest_CFLAGS): Add $(AM_CFLAGS)
1014 2017-08-02 David Edelsohn <dje.gcc@gmail.com>
1017 * xcoff.c (xcoff_process_linenos): Initialize incl to NULL.
1019 2017-07-28 Tony Reix <tony.reix@atos.net>
1021 * xcoff.c: Don't leak a file descriptor if an archive is malformed.
1023 2017-07-28 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
1025 * fileline.c (fileline_initialize): Print pid_t as long.
1027 2017-07-26 Tony Reix <tony.reix@atos.net>
1029 * configure.ac: Check for XCOFF32/XCOFF64. Check for loadquery.
1030 * filetype.awk: Separate AIX XCOFF32 and XCOFF64.
1031 * xcoff.c: Add support for AIX XCOFF32 and XCOFF64 formats.
1032 * configure, config.h.in: Regenerate.
1034 2017-07-21 Tony Reix <tony.reix@atos.net>
1036 * filetype.awk: Add AIX XCOFF type detection.
1037 * configure.ac: Recognize xcoff format.
1038 * Makefile.am (FORMAT_FILES): Add xcoff.c.
1039 * fileline.c: Include <unistd.h>.
1040 (fileline_initialize): Add case for AIX procfs.
1041 * xcoff.c: New file.
1042 * configure, Makefile.in: Rebuild.
1044 2017-06-21 Richard Biener <rguenther@suse.de>
1046 * configure.ac: Add AC_SYS_LARGEFILE.
1047 * config.h.in: Regenerate.
1048 * configure: Likewise.
1050 2017-06-11 Ian Lance Taylor <iant@golang.org>
1052 * elf.c (backtrace_initialize): Always set *fileline_fn.
1053 * ttest.c: New file.
1054 * btest.c: Move support functions into testlib.c. Change calls to
1055 check to pass file name.
1056 * testlib.c: New file, copied from (part of) btest.c.
1057 * testlib.h: New file, declarations for testlib.c.
1058 * edtest.c: Use testlib.h and testlib.c.
1059 * configure.ac: Test for -pthread, set HAVE_PTHREAD conditional.
1060 * Makefile.am (btest_SOURCES): Add testlib.c.
1061 (edtest_SOURCES): Likewise.
1062 (CHECK_PROGRAMS): Add ttest if HAVE_PTHREAD.
1063 (ttest_SOURCES, ttest_CFLAGS, ttest_LDADD): Define.
1064 * configure, Makefile.in: Rebuild.
1066 2017-05-19 Than McIntosh <thanm@google.com>
1068 * dwarf.c (free_line_header): Don't free dirs if dirs_count == 0.
1069 (read_line_header): Don't allocate dirs if dirs_count == 0.
1070 * edtest.c: New file.
1071 * edtest2.c: New file.
1072 * Makefile.am (edtest_SOURCES, edtest_LDADD): Define.
1073 (check_PROGRAMS): Add edtest.
1074 (edtest2_build.c, gen_edtest2_build): New targets.
1075 * Makefile.in: Rebuild.
1077 2017-03-08 Sam Thursfield <sam.thursfield@codethink.co.uk>
1079 * btest.c (test5): Replace #ifdef guard with 'unused' attribute
1080 to fix compile warning when BACKTRACE_SUPPORTED isn't defined.
1082 2017-01-01 Jakub Jelinek <jakub@redhat.com>
1084 Update copyright years.
1086 2016-11-15 Matthias Klose <doko@ubuntu.com>
1088 * configure: Regenerate.
1090 2016-09-11 Carlos Liam <carlos@aarzee.me>
1092 * all: Remove meaningless trailing whitespace.
1094 2016-05-18 Uros Bizjak <ubizjak@gmail.com>
1097 * elf.c (phdr_callback) [__i386__]: Add
1098 __attribute__((__force_align_arg_pointer__)).
1100 2016-03-02 Maxim Ostapenko <m.ostapenko@partner.samsung.com>
1102 * elf.c (backtrace_initialize): Properly initialize elf_fileline_fn to
1103 avoid possible crash.
1104 (elf_add): Don't set *fileline_fn to elf_nodebug value in case of
1105 missing debug info anymore.
1107 2016-02-06 John David Anglin <danglin@gcc.gnu.org>
1109 * mmap.c (MAP_FAILED): Define if not defined.
1111 2016-01-04 Jakub Jelinek <jakub@redhat.com>
1113 Update copyright years.
1115 2015-12-18 Andris Pavenis <andris.pavenis@iki.fi>
1117 * configure.ac: Specify that DJGPP do not have mmap
1118 even when sys/mman.h exists.
1119 * configure: Regenerate
1121 2015-12-09 John David Anglin <danglin@gcc.gnu.org>
1123 PR libgfortran/68115
1124 * configure.ac: Set libbacktrace_cv_sys_sync to no on hppa*-*-hpux*.
1125 * configure: Regenerate.
1126 * elf.c (backtrace_initialize): Cast __sync_bool_compare_and_swap call
1129 2015-09-17 Ian Lance Taylor <iant@google.com>
1131 * posix.c (backtrace_open): Cast second argument of open() to int.
1133 2015-09-11 Ian Lance Taylor <iant@google.com>
1135 * Makefile.am (backtrace.lo): Depend on internal.h.
1136 (sort.lo, stest.lo): Add explicit dependencies.
1137 * Makefile.in: Rebuild.
1139 2015-09-09 Hans-Peter Nilsson <hp@axis.com>
1141 * backtrace.c: #include <sys/types.h>.
1143 2015-09-08 Ian Lance Taylor <iant@google.com>
1146 * backtrace.c: #include "internal.h".
1147 (struct backtrace_data): Add can_alloc field.
1148 (unwind): If can_alloc is false, don't try to get file/line
1150 (backtrace_full): Set can_alloc field in bdata.
1151 * alloc.c (backtrace_alloc): Don't call error_callback if it is
1153 * mmap.c (backtrace_alloc): Likewise.
1154 * internal.h: Update comments for backtrace_alloc and
1157 2015-09-08 Ian Lance Taylor <iant@google.com>
1160 * mmap.c (backtrace_alloc): Correct test for mmap failure.
1162 2015-08-31 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
1164 * configure.ac: For spu-*-* targets, set have_fcntl to no.
1165 * configure: Regenerate.
1167 2015-08-27 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
1169 * configure.ac: Remove [disable-shared] argument to LT_INIT.
1170 Remove setting PIC_FLAG when building as target library.
1171 * configure: Regenerate.
1173 2015-08-26 Hans-Peter Nilsson <hp@axis.com>
1175 * configure.ac: Only compile with -fPIC if the target
1177 * configure: Regenerate.
1179 2015-08-24 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
1181 * configure.ac: Set have_mmap to no on spu-*-* targets.
1182 * configure: Regenerate.
1184 2015-08-13 Ian Lance Taylor <iant@google.com>
1186 * dwarf.c (read_function_entry): Add vec_inlined parameter.
1189 2015-06-11 Martin Sebor <msebor@redhat.com>
1192 * dwarf.c (struct line): Add new field idx.
1193 (line_compare): Use it.
1195 (read_line_info): Reset it.
1197 2015-05-29 Tristan Gingold <gingold@adacore.com>
1199 * pecoff.c: New file.
1200 * Makefile.am (FORMAT_FILES): Add pecoff.c and dependencies.
1201 * Makefile.in: Regenerate.
1202 * filetype.awk: Detect pecoff.
1203 * configure.ac: Define BACKTRACE_SUPPORTS_DATA on elf platforms.
1205 * btest.c (test5): Test enabled only if BACKTRACE_SUPPORTS_DATA is
1207 * backtrace-supported.h.in (BACKTRACE_SUPPORTS_DATA): Define.
1208 * configure: Regenerate.
1209 * pecoff.c: New file.
1211 2015-05-13 Michael Haubenwallner <michael.haubenwallner@ssi-schaefer.com>
1213 * Makefile.in: Regenerated with automake-1.11.6.
1214 * aclocal.m4: Likewise.
1215 * configure: Likewise.
1217 2015-01-24 Matthias Klose <doko@ubuntu.com>
1219 * configure.ac: Move AM_ENABLE_MULTILIB before AC_PROG_CC.
1220 * configure: Regenerate.
1222 2015-01-05 Jakub Jelinek <jakub@redhat.com>
1224 Update copyright years.
1226 2014-11-21 H.J. Lu <hongjiu.lu@intel.com>
1229 * configure: Regenerated.
1231 2014-11-11 David Malcolm <dmalcolm@redhat.com>
1233 * ChangeLog.jit: New.
1235 2014-11-11 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
1238 * configure: Regenerate.
1240 2014-10-23 Ian Lance Taylor <iant@google.com>
1242 * internal.h (backtrace_atomic_load_pointer) [no atomic or sync]:
1243 Fix to return void *.
1245 2014-05-08 Ian Lance Taylor <iant@google.com>
1247 * mmap.c (backtrace_free): If freeing a large aligned block of
1248 memory, call munmap rather than holding onto it.
1249 (backtrace_vector_grow): When growing a vector, double the number
1250 of pages requested. When releasing the old version of a grown
1251 vector, pass the correct size to backtrace_free.
1253 2014-03-07 Ian Lance Taylor <iant@google.com>
1255 * sort.c (backtrace_qsort): Use middle element as pivot.
1257 2014-03-06 Ian Lance Taylor <iant@google.com>
1260 * stest.c: New file.
1261 * internal.h (backtrace_qsort): Declare.
1262 * dwarf.c (read_abbrevs): Call backtrace_qsort instead of qsort.
1263 (read_line_info, read_function_entry): Likewise.
1264 (read_function_info, build_dwarf_data): Likewise.
1265 * elf.c (elf_initialize_syminfo): Likewise.
1266 * Makefile.am (libbacktrace_la_SOURCES): Add sort.c.
1267 (stest_SOURCES, stest_LDADD): Define.
1268 (check_PROGRAMS): Add stest.
1270 2014-02-07 Misty De Meo <misty@brew.sh>
1273 * configure.ac: Use AC_LINK_IFELSE in check for
1275 * configure: Regenerate.
1277 2014-01-02 Richard Sandiford <rdsandiford@googlemail.com>
1279 Update copyright years
1281 2013-12-06 Jakub Jelinek <jakub@redhat.com>
1283 * elf.c (ET_DYN): Undefine and define again.
1284 (elf_add): Add exe argument, if true and ehdr.e_type is ET_DYN,
1285 return early -1 without closing the descriptor.
1286 (struct phdr_data): Add exe_descriptor.
1287 (phdr_callback): If pd->exe_descriptor is not -1, for very first
1288 call if dlpi_name is NULL just call elf_add with the exe_descriptor,
1289 otherwise backtrace_close the exe_descriptor if not -1. Adjust
1291 (backtrace_initialize): Adjust call to elf_add. If it returns
1292 -1, set pd.exe_descriptor to descriptor, otherwise set it to -1.
1294 2013-12-05 Ian Lance Taylor <iant@google.com>
1296 * alloc.c (backtrace_vector_finish): Add error_callback and data
1297 parameters. Call backtrace_vector_release. Return address base.
1298 * mmap.c (backtrace_vector_finish): Add error_callback and data
1299 parameters. Return address base.
1300 * dwarf.c (read_function_info): Get new address base from
1301 backtrace_vector_finish.
1302 * internal.h (backtrace_vector_finish): Update declaration.
1304 2013-11-27 Ian Lance Taylor <iant@google.com>
1306 * dwarf.c (find_address_ranges): New static function, broken out
1307 of build_address_map.
1308 (build_address_map): Call it.
1309 * btest.c (check): Check for missing filename or function, rather
1311 (f3): Check that enough frames were returned.
1313 2013-11-19 Jakub Jelinek <jakub@redhat.com>
1315 * backtrace.h (backtrace_syminfo_callback): Add symsize argument.
1316 * elf.c (elf_syminfo): Pass 0 or sym->size to the callback as
1318 * btest.c (struct symdata): Add size field.
1319 (callback_three): Add symsize argument. Copy it to the data->size
1321 (f23): Set symdata.size to 0.
1322 (test5): Likewise. If sizeof (int) > 1, lookup address of
1323 ((uintptr_t) &global) + 1. Verify symdata.val and symdata.size
1326 * atomic.c: Include sys/types.h.
1328 2013-11-18 Ian Lance Taylor <iant@google.com>
1330 * configure.ac: Check for support of __atomic extensions.
1331 * internal.h: Declare or #define atomic functions for use in
1333 * atomic.c: New file.
1334 * dwarf.c (dwarf_lookup_pc): Use atomic functions.
1335 (dwarf_fileline, backtrace_dwarf_add): Likewise.
1336 * elf.c (elf_add_syminfo_data, elf_syminfo): Likewise.
1337 (backtrace_initialize): Likewise.
1338 * fileline.c (fileline_initialize): Likewise.
1339 * Makefile.am (libbacktrace_la_SOURCES): Add atomic.c.
1340 * configure, config.h.in, Makefile.in: Rebuild.
1342 2013-11-18 Jakub Jelinek <jakub@redhat.com>
1344 * elf.c (SHN_UNDEF): Define.
1345 (elf_initialize_syminfo): Add base_address argument. Ignore symbols
1346 with st_shndx == SHN_UNDEF. Add base_address to address fields.
1347 (elf_add): Adjust caller.
1349 * elf.c (phdr_callback): Process info->dlpi_addr == 0 normally.
1351 2013-11-16 Ian Lance Taylor <iant@google.com>
1353 * backtrace.h (backtrace_create_state): Correct comment about
1356 2013-11-15 Ian Lance Taylor <iant@google.com>
1358 * backtrace.h (backtrace_syminfo): Update comment and parameter
1359 name to take any address, not just a PC value.
1360 * elf.c (STT_OBJECT): Define.
1361 (elf_nosyms): Rename parameter pc to addr.
1362 (elf_symbol_search): Rename local variable pc to addr.
1363 (elf_initialize_syminfo): Add STT_OBJECT symbols to elf_symbols.
1364 (elf_syminfo): Rename parameter pc to addr.
1365 * btest.c (global): New global variable.
1369 2013-10-17 Ian Lance Taylor <iant@google.com>
1371 * elf.c (elf_add): Don't get the wrong offsets if a debug section
1374 2013-10-15 David Malcolm <dmalcolm@redhat.com>
1376 * configure.ac: Add --enable-host-shared, setting up
1377 pre-existing PIC_FLAG variable within Makefile.am et al.
1378 * configure: Regenerate.
1380 2013-09-20 Alan Modra <amodra@gmail.com>
1382 * configure: Regenerate.
1384 2013-07-23 Alexander Monakov <amonakov@ispras.ru>
1386 * elf.c (elf_syminfo): Loop over the elf_syminfo_data chain.
1388 2013-07-23 Alexander Monakov <amonakov@ispras.ru>
1390 * elf.c (backtrace_initialize): Pass elf_fileline_fn to
1391 dl_iterate_phdr callbacks.
1393 2013-03-25 Ian Lance Taylor <iant@google.com>
1395 * alloc.c: #include <sys/types.h>.
1398 2013-01-31 Ian Lance Taylor <iant@google.com>
1400 * dwarf.c (read_function_info): Permit fvec parameter to be NULL.
1401 (dwarf_lookup_pc): Don't use ddata->fvec if threaded.
1403 2013-01-25 Jakub Jelinek <jakub@redhat.com>
1406 * dwarf.c (read_line_header): Don't crash if DW_AT_comp_dir
1407 attribute was not seen.
1409 2013-01-16 Ian Lance Taylor <iant@google.com>
1411 * dwarf.c (struct unit): Add filename and abs_filename fields.
1412 (build_address_map): Set new fields when reading unit.
1413 (dwarf_lookup_pc): If we don't find an entry in the line table,
1414 just return the main file name.
1416 2013-01-14 Richard Sandiford <rdsandiford@googlemail.com>
1418 Update copyright years.
1420 2013-01-01 Ian Lance Taylor <iant@google.com>
1423 * Makefile.am (AM_CPPFLAGS): Remove -I ../gcc/include and -I
1424 $(MULTIBUILDTOP)/../../gcc/include.
1425 * Makefile.in: Rebuild.
1427 2013-01-01 Ian Lance Taylor <iant@google.com>
1430 * mmap.c (backtrace_alloc): Don't call sync functions if not
1432 (backtrace_free): Likewise.
1434 2012-12-12 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
1436 * mmapio.c: Define MAP_FAILED if not defined.
1438 2012-12-11 Jakub Jelinek <jakub@redhat.com>
1441 * Makefile.am (AM_CFLAGS): Remove -frandom-seed=$@.
1442 * configure.ac: If --with-target-subdir, add -frandom-seed=$@
1443 to EXTRA_FLAGS unconditionally, otherwise check whether the compiler
1445 * Makefile.in: Regenerated.
1446 * configure: Regenerated.
1448 2012-12-07 Jakub Jelinek <jakub@redhat.com>
1451 * Makefile.am (AM_CFLAGS): Add -frandom-seed=$@.
1452 * Makefile.in: Regenerated.
1454 2012-11-20 Ian Lance Taylor <iant@google.com>
1456 * dwarf.c (read_attribute): Always clear val.
1458 2012-11-13 Ian Lance Taylor <iant@google.com>
1461 * configure.ac: Only add -Werror if building a target library.
1462 * configure: Rebuild.
1464 2012-11-12 Ian Lance Taylor <iant@google.com>
1465 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
1466 Gerald Pfeifer <gerald@pfeifer.com>
1468 * configure.ac: Check for getexecname.
1469 * fileline.c: #include <errno.h>. Define getexecname if not
1471 (fileline_initialize): Try to find the executable in a few
1473 * print.c (error_callback): Only print the filename if it came
1474 from the backtrace state.
1475 * configure, config.h.in: Rebuild.
1477 2012-10-29 Ian Lance Taylor <iant@google.com>
1479 * mmap.c (backtrace_vector_release): Correct last patch: add
1482 2012-10-29 Ian Lance Taylor <iant@google.com>
1484 * mmap.c (backtrace_vector_release): Make sure freed block is
1485 aligned on 8-byte boundary.
1487 2012-10-26 Ian Lance Taylor <iant@google.com>
1490 * posix.c (backtrace_open): Add does_not_exist parameter.
1491 * elf.c (phdr_callback): Do not warn if shared library could not
1493 * fileline.c (fileline_initialize): Update calls to
1495 * internal.h (backtrace_open): Update declaration.
1497 2012-10-26 Jack Howarth <howarth@bromo.med.uc.edu>
1500 * configure.ac: Check for _Unwind_GetIPInfo function declaration.
1501 * configure: Regenerate.
1503 2012-10-24 Ian Lance Taylor <iant@google.com>
1506 * configure.ac: Check whether -funwind-tables option works.
1507 * configure: Rebuild.
1509 2012-10-11 Ian Lance Taylor <iant@google.com>
1511 * configure.ac: Do not use dl_iterate_phdr on Solaris 10.
1512 * configure: Rebuild.
1514 2012-10-10 Ian Lance Taylor <iant@google.com>
1516 * elf.c: Rename all Elf typedefs to start with b_elf, and be all
1519 2012-10-10 Hans-Peter Nilsson <hp@bitrange.com>
1521 * elf.c (elf_add_syminfo_data): Add casts to avoid warning.
1523 2012-10-09 Ian Lance Taylor <iant@google.com>
1525 * dwarf.c (dwarf_fileline): Add cast to avoid warning.
1526 (backtrace_dwarf_add): Likewise.
1528 2012-10-09 Ian Lance Taylor <iant@google.com>
1530 Add support for tracing through shared libraries.
1531 * configure.ac: Check for link.h and dl_iterate_phdr.
1532 * elf.c: #include <link.h> if system has dl_iterate_phdr. #undef
1533 ELF macros before #defining them.
1534 (dl_phdr_info, dl_iterate_phdr): Define if system does not have
1536 (struct elf_syminfo_data): Add next field.
1537 (elf_initialize_syminfo): Initialize next field.
1538 (elf_add_syminfo_data): New static function.
1539 (elf_add): New static function, broken out of
1540 backtrace_initialize. Call backtrace_dwarf_add instead of
1541 backtrace_dwarf_initialize.
1542 (struct phdr_data): Define.
1543 (phdr_callback): New static function.
1544 (backtrace_initialize): Call elf_add.
1545 * dwarf.c (struct dwarf_data): Add next and base_address fields.
1546 (add_unit_addr): Add base_address parameter. Change all callers.
1547 (add_unit_ranges, build_address_map): Likewise.
1548 (add_line): Add ddata parameter. Change all callers.
1549 (read_line_program, add_function_range): Likewise.
1550 (dwarf_lookup_pc): New static function, broken out of
1552 (dwarf_fileline): Call dwarf_lookup_pc.
1553 (build_dwarf_data): New static function.
1554 (backtrace_dwarf_add): New function.
1555 (backtrace_dwarf_initialize): Remove.
1556 * internal.h (backtrace_dwarf_initialize): Don't declare.
1557 (backtrace_dwarf_add): Declare.
1558 * configure, config.h.in: Rebuild.
1560 2012-10-04 Gerald Pfeifer <gerald@pfeifer.com>
1562 * btest.c (f23): Avoid uninitialized variable warning.
1564 2012-10-04 Ian Lance Taylor <iant@google.com>
1566 * dwarf.c: If the system header files do not declare strnlen,
1567 provide our own version.
1569 2012-10-03 Ian Lance Taylor <iant@google.com>
1571 * dwarf.c (read_uleb128): Fix overflow test.
1572 (read_sleb128): Likewise.
1573 (build_address_map): Don't change unit_buf.start.
1575 2012-10-02 Uros Bizjak <ubizjak@gmail.com>
1578 * configure.ac (EXTRA_FLAGS): New.
1579 * Makefile.am (AM_FLAGS): Add $(EXTRA_FLAGS).
1580 * configure, Makefile.in: Regenerate.
1582 2012-09-29 Ian Lance Taylor <iant@google.com>
1585 * fileline.c (fileline_initialize): Pass errnum as -1 when
1586 reporting that we could not read executable information after a
1589 2012-09-27 Ian Lance Taylor <iant@google.com>
1592 * configure.ac: Add no-dependencies to AM_INIT_AUTOMAKE.
1593 * Makefile.am: Add dependencies for all objects.
1594 * configure, aclocal.m4, Makefile.in: Rebuild.
1596 2012-09-27 Ian Lance Taylor <iant@google.com>
1599 * elf.c (backtrace_initialize): Set *fileln_fn, not
1602 2012-09-19 Ian Lance Taylor <iant@google.com>
1604 * configure.ac: Only use GCC_CHECK_UNWIND_GETIPINFO when compiled
1605 as a target library.
1606 * configure: Rebuild.
1608 2012-09-19 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
1609 Ian Lance Taylor <iant@google.com>
1611 * configure.ac (GCC_HEADER_STDINT): Invoke.
1612 * backtrace.h: If we can't find <stdint.h>, use "gstdint.h".
1613 * btest.c: Don't include <stdint.h>.
1614 * dwarf.c: Likewise.
1615 * configure, aclocal.m4, Makefile.in, config.h.in: Rebuild.
1617 2012-09-18 Ian Lance Taylor <iant@google.com>
1620 * Makefile.am (AM_CPPFLAGS): Define.
1621 (AM_CFLAGS): Remove -I options.
1622 * Makefile.in: Rebuild.
1624 2012-09-18 Ian Lance Taylor <iant@google.com>
1626 * posix.c (O_BINARY): Define if not defined.
1627 (backtrace_open): Pass O_BINARY to open. Only call fcntl if
1628 HAVE_FCNTL is defined.
1629 * configure.ac: Test for the fcntl function.
1630 * configure, config.h.in: Rebuild.
1632 2012-09-18 Ian Lance Taylor <iant@google.com>
1634 * btest.c (test1, test2, test3, test4): Add the unused attribute.
1636 2012-09-18 Ian Lance Taylor <iant@google.com>
1638 * dwarf.c: Correct test of HAVE_DECL_STRNLEN.
1640 2012-09-18 Ian Lance Taylor <iant@google.com>
1642 * configure.ac: Add AC_USE_SYSTEM_EXTENSIONS.
1643 * mmapio.c: Don't define _GNU_SOURCE.
1644 * configure, config.h.in: Rebuild.
1646 2012-09-18 Ian Lance Taylor <iant@google.com>
1648 * configure.ac: Check whether strnlen is declared.
1649 * dwarf.c: Declare strnlen if not declared.
1650 * configure, config.h.in: Rebuild.
1652 2012-09-18 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
1654 * fileline.c: Include <stdlib.h>.
1657 2012-09-17 Ian Lance Taylor <iant@google.com>
1660 * nounwind.c (backtrace_full): Rename from backtrace. Add state
1663 2012-09-17 Gerald Pfeifer <gerald@pfeifer.com>
1666 * nounwind.c (backtrace_simple): Add state parameter.
1668 2012-09-17 Ian Lance Taylor <iant@google.com>
1671 * unknown.c (unknown_fileline): Add state parameter, remove
1672 fileline_data parameter, name error_callback parameter.
1673 (backtrace_initialize): Add state parameter.
1675 2012-09-17 Ian Lance Taylor <iant@google.com>
1677 * Initial implementation.
1679 Copyright (C) 2012-2020 Free Software Foundation, Inc.
1681 Copying and distribution of this file, with or without modification,
1682 are permitted in any medium without royalty provided the copyright
1683 notice and this notice are preserved.