1 2020-12-05 Iain Sandoe <iain@sandoe.co.uk>
4 * configure: Regenerate.
6 2020-12-02 Ian Lance Taylor <iant@golang.org>
8 * dwarf.c (resolve_string): Use > rather than >= to check whether
9 string index extends past buffer.
10 (resolve_addr_index): Similarly for address index.
12 2020-11-29 John David Anglin <danglin@gcc.gnu.org>
14 * configure: Regenerate.
16 2020-10-20 Ian Lance Taylor <iant@golang.org>
18 * internal.h (ATTRIBUTE_FALLTHROUGH): Define.
19 * elf.c (elf_zlib_inflate): Use ATTRIBUTE_FALLTHROUGH.
21 2020-09-28 Ian Lance Taylor <iant@golang.org>
24 * Makefile.am (check_DATA): Add mtest.dSYM if USE_DSYMUTIL.
25 * Makefile.in: Regenerate.
27 2020-09-28 Ian Lance Taylor <iant@golang.org>
30 * configure.ac (USE_DSYMUTIL): Define instead of HAVE_DSYMUTIL.
31 * Makefile.am: Change all uses of HAVE_DSYMUTIL to USE_DSYMUTIL.
32 * configure: Regenerate.
33 * Makefile.in: Regenerate.
35 2020-09-23 Ian Lance Taylor <iant@golang.org>
37 * dwarf.c (report_inlined_functions): Handle PC == -1 and PC ==
39 (dwarf_lookup_pc): Likewise.
41 2020-09-17 Ian Lance Taylor <iant@golang.org>
44 * fileline.c (backtrace_syminfo_to_full_callback): New function.
45 (backtrace_syminfo_to_full_error_callback): New function.
46 * elf.c (elf_nodebug): Call syminfo_fn if possible.
47 * internal.h (struct backtrace_call_full): Define.
48 (backtrace_syminfo_to_full_callback): Declare.
49 (backtrace_syminfo_to_full_error_callback): Declare.
50 * mtest.c (f3): Only check all[i] if data.index permits.
52 2020-09-16 Iain Sandoe <iain@sandoe.co.uk>
54 * macho.c (MACH_O_CPU_TYPE_PPC): New.
55 (MACH_O_CPU_TYPE_PPC64): New.
56 Add compile-tests for powerpc to the Mach-O variants.
58 2020-09-14 Ian Lance Taylor <iant@golang.org>
61 Add support for MiniDebugInfo.
62 * elf.c (struct elf_view): Define. Replace most uses of
63 backtrace_view with elf_view.
64 (elf_get_view): New static functions. Replace most calls of
65 backtrace_get_view with elf_get_view.
66 (elf_release_view): New static functions. Replace most calls of
67 backtrace_release_view with elf_release_view.
68 (elf_uncompress_failed): Rename from elf_zlib_failed. Change all
70 (LZMA_STATES, LZMA_POS_STATES, LZMA_DIST_STATES): Define.
71 (LZMA_DIST_SLOTS, LZMA_DIST_MODEL_START): Define.
72 (LZMA_DIST_MODEL_END, LZMA_FULL_DISTANCES): Define.
73 (LZMA_ALIGN_SIZE, LZMA_LEN_LOW_SYMBOLS): Define.
74 (LZMA_LEN_MID_SYMBOLS, LZMA_LEN_HIGH_SYMBOLS): Define.
75 (LZMA_LITERAL_CODERS_MAX, LZMA_LITERAL_CODER_SIZE): Define.
76 (LZMA_PROB_IS_MATCH_LEN, LZMA_PROB_IS_REP_LEN): Define.
77 (LZMA_PROB_IS_REP0_LEN, LZMA_PROB_IS_REP1_LEN): Define.
78 (LZMA_PROB_IS_REP2_LEN, LZMA_PROB_IS_REP0_LONG_LEN): Define.
79 (LZMA_PROB_DIST_SLOT_LEN, LZMA_PROB_DIST_SPECIAL_LEN): Define.
80 (LZMA_PROB_DIST_ALIGN_LEN): Define.
81 (LZMA_PROB_MATCH_LEN_CHOICE_LEN): Define.
82 (LZMA_PROB_MATCH_LEN_CHOICE2_LEN): Define.
83 (LZMA_PROB_MATCH_LEN_LOW_LEN): Define.
84 (LZMA_PROB_MATCH_LEN_MID_LEN): Define.
85 (LZMA_PROB_MATCH_LEN_HIGH_LEN): Define.
86 (LZMA_PROB_REP_LEN_CHOICE_LEN): Define.
87 (LZMA_PROB_REP_LEN_CHOICE2_LEN): Define.
88 (LZMA_PROB_REP_LEN_LOW_LEN): Define.
89 (LZMA_PROB_REP_LEN_MID_LEN): Define.
90 (LZMA_PROB_REP_LEN_HIGH_LEN): Define.
91 (LZMA_PROB_LITERAL_LEN): Define.
92 (LZMA_PROB_IS_MATCH_OFFSET, LZMA_PROB_IS_REP_OFFSET): Define.
93 (LZMA_PROB_IS_REP0_OFFSET, LZMA_PROB_IS_REP1_OFFSET): Define.
94 (LZMA_PROB_IS_REP2_OFFSET): Define.
95 (LZMA_PROB_IS_REP0_LONG_OFFSET): Define.
96 (LZMA_PROB_DIST_SLOT_OFFSET): Define.
97 (LZMA_PROB_DIST_SPECIAL_OFFSET): Define.
98 (LZMA_PROB_DIST_ALIGN_OFFSET): Define.
99 (LZMA_PROB_MATCH_LEN_CHOICE_OFFSET): Define.
100 (LZMA_PROB_MATCH_LEN_CHOICE2_OFFSET): Define.
101 (LZMA_PROB_MATCH_LEN_LOW_OFFSET): Define.
102 (LZMA_PROB_MATCH_LEN_MID_OFFSET): Define.
103 (LZMA_PROB_MATCH_LEN_HIGH_OFFSET): Define.
104 (LZMA_PROB_REP_LEN_CHOICE_OFFSET): Define.
105 (LZMA_PROB_REP_LEN_CHOICE2_OFFSET): Define.
106 (LZMA_PROB_REP_LEN_LOW_OFFSET): Define.
107 (LZMA_PROB_REP_LEN_MID_OFFSET): Define.
108 (LZMA_PROB_REP_LEN_HIGH_OFFSET): Define.
109 (LZMA_PROB_LITERAL_OFFSET): Define.
110 (LZMA_PROB_TOTAL_COUNT): Define.
111 (LZMA_IS_MATCH, LZMA_IS_REP, LZMA_IS_REP0): Define.
112 (LZMA_IS_REP1, LZMA_IS_REP2, LZMA_IS_REP0_LONG): Define.
113 (LZMA_DIST_SLOT, LZMA_DIST_SPECIAL, LZMA_DIST_ALIGN): Define.
114 (LZMA_MATCH_LEN_CHOICE, LZMA_MATCH_LEN_CHOICE2): Define.
115 (LZMA_MATCH_LEN_LOW, LZMA_MATCH_LEN_MID): Define.
116 (LZMA_MATCH_LEN_HIGH, LZMA_REP_LEN_CHOICE): Define.
117 (LZMA_REP_LEN_CHOICE2, LZMA_REP_LEN_LOW): Define.
118 (LZMA_REP_LEN_MID, LZMA_REP_LEN_HIGH, LZMA_LITERAL): Define.
119 (elf_lzma_varint): New static function.
120 (elf_lzma_range_normalize): New static function.
121 (elf_lzma_bit, elf_lzma_integer): New static functions.
122 (elf_lzma_reverse_integer): New static function.
123 (elf_lzma_len, elf_uncompress_lzma_block): New static functions.
124 (elf_uncompress_lzma): New static function.
125 (backtrace_uncompress_lzma): New function.
126 (elf_add): Add memory and memory_size parameters. Change all
127 callers. Look for .gnu_debugdata section, and, if found,
128 decompress it and use it for symbols and debug info. Permit the
129 descriptor parameter to be -1.
130 * internal.h (backtrace_uncompress_lzma): Declare.
132 * xztest.c: New file.
133 * configure.ac: Check for nm, xz, and comm programs. Check for
135 (HAVE_MINIDEBUG): Define.
136 * Makefile.am (mtest_SOURCES): Define.
137 (mtest_CFLAGS, mtest_LDADD): Define.
138 (TESTS): Add mtest_minidebug if HAVE_MINIDEBUG.
139 (%_minidebug): New pattern rule, if HAVE_MINIDEBUG.
140 (xztest_SOURCES, xztest_CFLAGS, xztest_LDADD): Define.
141 (xztest_alloc_SOURCES, xztest_alloc_CFLAGS): Define
142 (xztest_alloc_LDADD): Define.
143 (BUILDTESTS): Add mtest, xztest, xztest_alloc.
144 (CLEANFILES): Add files created by minidebug pattern.
145 (btest.lo): Correct INCDIR reference.
146 (mtest.lo, xztest.lo, ztest.lo): New targets.
147 * configure: Regenerate.
148 * config.h.in: Regenerate.
149 * Makefile.in: Regenerate.
151 2020-09-09 Ian Lance Taylor <iant@golang.org>
153 * pecoff.c (coff_initialize_syminfo): Add is_64 parameter.
154 (coff_add): Determine and pass is_64.
156 2020-09-09 Ian Lance Taylor <iant@golang.org>
158 PR libbacktrace/96973
159 * fileline.c (macho_get_executable_path): New static function.
160 (fileline_initialize): Call macho_get_executable_path.
162 2020-09-09 Ian Lance Taylor <iant@golang.org>
164 * dwarf.c (function_addrs_search): Compare against the next entry
165 low address, not the high address.
166 (unit_addrs_search): Likewise.
167 (build_address_map): Add a trailing unit_addrs.
168 (read_function_entry): Add a trailing function_addrs.
169 (read_function_info): Likewise.
170 (report_inlined_functions): Search backward for function_addrs
172 (dwarf_lookup_pc): Search backward for unit_addrs and
173 function_addrs matches.
175 2020-09-08 Ian Lance Taylor <iant@golang.org>
177 * simple.c (simple_unwind): Correct comment spelling.
179 2020-09-08 Ian Lance Taylor <iant@golang.org>
181 * macho.c (macho_add_dsym): Make space for '/' in dsym. Use
182 correct length when freeing diralc.
184 2020-09-08 Ian Lance Taylor <iant@golang.org>
186 PR libbacktrace/96973
187 * macho.c (macho_add_fat): Correctly swap 32-bit file offset.
189 2020-09-08 Ian Lance Taylor <iant@golang.org>
191 PR libbacktrace/96971
192 * filetype.awk: Only match magic number at start of line.
194 2020-08-24 Ian Lance Taylor <iant@golang.org>
196 * macho.c (MACH_O_MH_MAGIC_FAT_64): Define.
197 (MACH_O_MH_CIGAM_FAT_64): Define.
198 (struct macho_fat_arch_64): Define.
199 (macho_add_fat): Add and use is_64 parameter.
200 (macho_add): Recognize 64-bit fat files.
202 2020-07-30 H.J. Lu <hjl.tools@gmail.com>
205 * configure: Regenerated.
207 2020-07-08 Ian Lance Taylor <iant@golang.org>
209 * configure.ac: Test linker support for DWARF5
210 * configure: Regenerate
212 2020-05-29 H.J. Lu <hjl.tools@gmail.com>
215 * configure: Regenerated.
217 2020-05-15 H.J. Lu <hongjiu.lu@intel.com>
220 * configure: Regenerated.
222 2020-05-14 H.J. Lu <hongjiu.lu@intel.com>
224 * configure: Regenerated.
226 2020-05-13 Ian Lance Taylor <iant@golang.org>
228 * ztest.c (test_large): Mark state ATTRIBUTE_UNUSED.
230 2020-05-13 Ian Lance Taylor <iant@golang.org>
233 * posix.c (backtrace_open): Treat EACCESS like ENOENT.
235 2020-05-12 H.J. Lu <hongjiu.lu@intel.com>
237 * Makefile.am (AM_CFLAGS): Add $(CET_HOST_FLAGS).
238 * configure.ac: Add GCC_CET_HOST_FLAGS(CET_HOST_FLAGS) and
239 AC_SUBST(CET_HOST_FLAGS). Clear CET_HOST_FLAGS if jit isn't
241 * Makefile.in: Regenerated.
242 * configure: Likewise.
244 2020-05-11 Ian Lance Taylor <iant@golang.org>
246 PR libbacktrace/95012
247 * configure.ac: Check for getpagesize declaration.
248 * mmap.c: Declare getpagesize if necessary.
249 * mmapio.c: Likewise.
250 * configure: Regenerate.
251 * config.h.in: Regenerate.
252 * Makefile.in: Regenerate.
254 2020-05-09 Roland McGrath <mcgrathr@google.com>
256 * elf.c (elf_add): Bail early if there are no section headers at all.
258 2020-05-09 Ian Lance Taylor <iant@golang.org>
260 * elf.c (elf_add): Don't free strtab if an error occurs after
261 recording symbol information.
263 2020-05-09 Ian Lance Taylor <iant@golang.org>
265 PR libbacktrace/88745
267 * filetype.awk: Recognize Mach-O files.
268 * Makefile.am (FORMAT_FILES): Add macho.c.
269 (check_DATA): New variable. Set to .dSYM if HAVE_DSYMUTIL.
270 (%.dSYM): New pattern target.
271 (test_macho_SOURCES, test_macho_CFLAGS): New targets.
272 (test_macho_LDADD): New target.
273 (BUILDTESTS): Add test_macho.
274 (macho.lo): Add dependencies.
275 * configure.ac: Recognize macho file type. Check for
276 mach-o/dyld.h. Don't try to run objcopy if we don't find it.
277 Look for dsymutil and define a HAVE_DSYMUTIL conditional.
278 * Makefile.in: Regenerate.
279 * configure: Regenerate.
280 * config.h.in: Regenerate.
282 2020-05-09 Ian Lance Taylor <iant@golang.org>
284 * read.c (backtrace_get_view): Support short read.
286 2020-05-09 Ian Lance Taylor <iant@golang.org>
288 * elf.c (elf_add): If debug sections are very large or far apart,
289 read them individually rather than as a single view.
291 2020-05-08 Ian Lance Taylor <iant@golang.org>
293 * fileline.c (sysctl_exec_name): New static function.
294 (sysctl_exec_name1): New macro or static function.
295 (sysctl_exec_name2): Likewise.
296 (fileline_initialize): Try sysctl_exec_name[12].
297 * configure.ac: Check for sysctl args to fetch executable name.
298 * configure: Regenerate.
299 * config.h.in: Regenerate.
301 2020-02-15 Ian Lance Taylor <iant@golang.org>
303 * ztest.c (test_large): Update file to current libgo test file.
305 2020-02-03 Ian Lance Taylor <iant@golang.org>
307 * Makefile.am (libbacktrace_TEST_CFLAGS): Define.
308 (test_elf32_CFLAGS): Use $(libbacktrace_test_CFLAGS).
309 (test_elf_64_CFLAGS, test_xcoff_32_CFLAGS): Likewise.
310 (test_xcoff_64_CFLAGS, test_pecoff_CFLAGS): Likewise.
311 (test_unknown_CFLAGS, unittest_CFLAGS): Likewise.
312 (unittest_alloc_CFLAGS, allocfail_CFLAGS): Likewise.
313 (b2test_CFLAGS, b3test_CFLAGS, btest_CFLAGS): Likewise.
314 (btest_lto_CFLAGS, btest_alloc_CFLAGS, stest_CFLAGS): Likewise.
315 (stest_alloc_CFLAGS): Likewise.
316 * Makefile.in: Regenerate.
317 * ztest.c (error_callback_compress): Mark vdata unused.
318 (test_large): Add casts to avoid warnings.
320 2020-01-01 Jakub Jelinek <jakub@redhat.com>
322 Update copyright years.
324 2019-12-13 Ian Lance Taylor <iant@golang.org>
327 * dwarf.c (struct attr): Add val field.
328 (enum attr_val_encoding): Add ATTR_VAL_ADDDRESS_INDEX,
329 ATTR_VAL_STRING_INDEX, ATTR_VAL_RNGLISTS_INDEX.
330 (struct line_header): Add addrsize field.
331 (struct line_header_format): Define.
332 (struct unit): Add str_offsets_base, addr_base, and rnglists_base
334 (read_uint24): New static function.
335 (read_attribute): Add implicit_val parameter. Replace dwarf_str
336 and dwarf_str_size parameters with dwarf_sections parameter. Add
337 support for new DWARF 5 forms. Change all callers.
338 (resolve_string): New static function.
339 (resolve_addr_index): Likewise.
340 (read_abbrevs): Support DW_FORM_implicit_const.
341 (struct pcrange): Add lowpc_is_addr_index, highpc_is_addr_Index,
342 and ranges_is_index fields.
343 (update_pcrange): Support DWARF 5 encodings.
344 (add_high_low_range): New static function, split out of
346 (add_ranges_from_ranges): Likewise.
347 (add_ranges_from_rnglists): New static function.
348 (add_ranges): Just call new helper functions.
349 (find_address_ranges): Use resolve_string for strings, after
350 reading all attributes. Handle new DWARF 5 attributes.
351 (build_address_map): Support DWARF 5 compilation units.
352 (read_v2_paths): New static function, split out of
354 (read_lnct): New static function.
355 (read_line_header_format_entries): Likewise.
356 (read_line_header): Add ddata parameter. Support DWARF 5 line
357 headers. Call new helper functions. Change all callers.
358 (read_line_program): Use addrsize from line program header. Don't
359 special case directory index 0 for DWARF 5.
360 (read_referenced_name): Use resolve_string.
361 (read_function_entry): Handle DWARF 5 encodings. Use
363 * internal.h (enum dwarf_section): Add DEBUG_ADDR,
364 DEBUG_STR_OFFSETS, DEBUG_LINE_STR, DEBUG_RNGLISTS.
365 * elf.c (dwarf_section_names): Add new section names.
366 * pecoff.c (dwarf_section_names): Likewise.
367 * xcoff.c (xcoff_add): Clear dwarf_sections before setting
369 * configure.ac: Define HAVE_DWARF5 automake conditional.
370 * Makefile.am (dwarf5_SOURCES): New variable if HAVE_DWARF5.
371 (dwarf5_CFLAGS, dwarf5_LDADD): Likewise.
372 (dwarf5_alloc_SOURCES, dwarf5_alloc_CFLAGS): Likewise.
373 (dwarf5_alloc_LDADD): Likewise.
374 (BUILDTESTS): Add dwarf5 tests if HAVE_DWARF5.
375 (CLEANFILES, clean-local): Define.
377 2019-12-08 Ian Lance Taylor <iant@golang.org>
379 * dwarf.c (struct pcrange): Define.
380 (update_pcrange, add_ranges): New static functions.
381 (add_unit_addr): Change signature to work with add_ranges. Don't
382 add base_address here.
383 (add_unit_ranges): Remove.
384 (find_address_ranges): Replace str/ranges parameters with
385 dwarf_sections. Use update_pcrange and add_ranges. Change all
387 (add_function_range): Change signature to work with add_ranges.
388 Don't add base_address here.
389 (add_function_ranges): Remove.
390 (read_function_entry): Use update_pcrange and add_ranges.
392 2019-12-04 Ian Lance Taylor <iant@golang.org>
394 * edtest.c (test1): Add noclone attribute.
396 2019-12-04 Ian Lance Taylor <iant@golang.org>
398 * internal.h (enum dwarf_section): Define.
399 (struct dwarf_sections): Define.
400 (backtrace_dwarf_add): Update declaration to replace specific
401 section parameters with dwarf_sections parameter.
402 * dwarf.c (struct dwarf_data): Replace specific section fields
403 with dwarf_sections field.
404 (read_attribute): Use dwarf_sections with altlink.
405 (build_address_map): Replace specific section parameters with
406 dwarf_sections parameter. Change all callers.
407 (read_line_info): Use dwarf_sections with ddata.
408 (read_referenced_name): Likewise.
409 (add_function_ranges): Likewise.
410 (read_function_entry): Likewise.
411 (read_function_info): Likewise.
412 (build_dwarf_data): Replace specific section parameters with
413 dwarf_sections parameter. Change all callers.
414 (backtrace_dwarf_add): Likewise.
415 * elf.c (enum debug_section): Remove.
416 (dwarf_section_names): Remove .zdebug names.
417 (elf_add): Track zsections separately. Build dwarf_sections.
418 * pecoff.c (enum debug_section): Remove.
419 (struct debug_section_info): Remove data field.
420 (coff_add): Build dwarf_sections.
421 * xcoff.c (enum dwarf_section): Remove. Replace DWSECT_xxx
422 references with DEBUG_xxx references.
423 (xcoff_add): Build dwarf_sections.
425 2019-09-27 Maciej W. Rozycki <macro@wdc.com>
427 * configure: Regenerate.
429 2019-09-26 Ian Lance Taylor <iant@golang.org>
431 PR libbacktrace/91908
432 * pecoff.c (backtrace_initialize): Explicitly cast unchecked
433 __sync_bool_compare_and_swap to void.
434 * xcoff.c (backtrace_initialize): Likewise.
436 2019-09-03 Ulrich Weigand <uweigand@de.ibm.com>
438 * configure.ac: Remove references to spu.
439 * configure: Regenerate.
441 2019-05-24 Clement Chigot <clement.chigot@atos.net>
443 * Makefile.am (BUILDTESTS): Remove test_elf, add test_elf_32 and
445 * Makefile.in: Regenerate.
447 2019-05-14 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
449 * configure.ac (have_dl_iterate_phdr): Remove *-*-solaris2.10*
451 * configure: Regenerate.
453 2019-03-11 Ian Lance Taylor <iant@golang.org>
455 PR libbacktrace/89669
456 * Makefile.am (BUILDTESTS): Only add ztest and ztest_alloc if
458 * Makefile.in: Regenerate.
460 2019-02-26 Tom de Vries <tdevries@suse.de>
462 * btest.c (test5): Allow global.* as minimal symbol name for global.
464 2019-02-26 Tom de Vries <tdevries@suse.de>
466 * Makefile.am (TESTS): Only add b3test_dwz_buildid if HAVE_DWZ.
467 * Makefile.in: Regenerate.
469 2019-02-12 Tom de Vries <tdevries@suse.de>
471 PR libbacktrace/81983
472 * dwarf.c (dwarf_lookup_pc): Don't call bsearch if nmemb == 0.
474 2019-02-10 Tom de Vries <tdevries@suse.de>
476 * Makefile.am (BUILDTESTS): Add btest_lto.
477 * Makefile.in: Regenerate.
478 * btest.c (test1, f2, f3, test3, f22, f23): Declare with
479 __attribute__((noclone)).
481 2019-02-08 Tom de Vries <tdevries@suse.de>
483 * backtrace.c (backtrace_full): Declare with __attribute__((noinline)).
484 * print.c (backtrace_print): Same.
485 * simple.c (backtrace_simple): Same.
487 2019-02-08 Tom de Vries <tdevries@suse.de>
489 PR libbacktrace/78063
490 * dwarf.c (build_address_map): Keep all parsed units.
491 (read_referenced_name_from_attr): Handle DW_FORM_ref_addr.
493 2019-01-31 Tom de Vries <tdevries@suse.de>
495 PR libbacktrace/89136
496 * elf.c (elf_add): Read build-id if with_buildid_data. Fix
497 'debugaltlink_name_len =+ 1'.
499 2019-01-29 Tom de Vries <tdevries@suse.de>
501 * install-debuginfo-for-buildid.sh.in: New script.
502 * Makefile.am (check_PROGRAMS): Add b2test and b3test.
503 (TESTS): Add b2test_buildid and b3test_dwz_buildid.
504 * Makefile.in: Regenerate.
505 * configure.ac (HAVE_ELF): Set with AM_CONDITIONAL.
506 (READELF): Set with AC_CHECK_PROG.
507 (install-debuginfo-for-buildid.sh): Generate with AC_CONFIG_FILES.
508 * configure: Regenerate.
509 * elf.c (SYSTEM_BUILD_ID_DIR): Factor out of ...
510 (elf_open_debugfile_by_buildid): ... here.
512 2019-01-29 Tom de Vries <tdevries@suse.de>
514 * Makefile.am: Replace check_PROGRAMS with BUILDTESTS, except for
516 (TESTS): Don't add check_PROGRAMS. Add BUILDTESTS.
517 (check_PROGRAMS): Add BUILDTESTS.
518 * Makefile.in: Regenerate.
520 2019-01-28 Tom de Vries <tdevries@suse.de>
522 * Makefile.am (xcoff_%.c): Generate sed result into temporary file.
523 Use $< to access prerequisite.
524 * Makefile.in: Regenerate.
526 2019-01-25 Nathan Sidwell <nathan@acm.org>
528 * elf.c (elf_add): Pass "" filename to recursive call with
531 2019-01-25 Tom de Vries <tdevries@suse.de>
533 * elf.c (elf_add): When handling .gnu_debugaltlink, call elf_add with
535 * Makefile.am (TESTS): Add btest_dwz_gnudebuglink.
536 * Makefile.in: Regenerate.
538 2019-01-25 Tom de Vries <tdevries@suse.de>
540 * Makefile.am: Rewrite dtest rule into "%_gnudebuglink" pattern rule.
541 (TESTS): Rename dtest to btest_gnudebuglink.
542 * Makefile.in: Regenerate.
544 2019-01-23 Tom de Vries <tdevries@suse.de>
546 * dwarf.c (struct unit): Use size_t for low_offset/high_offset fields.
547 (units_search, find_unit): Use size_t for offset.
548 (build_address_map): Use size_t for unit_offset.
550 2019-01-20 Gerald Pfeifer <gerald@pfeifer.com>
552 * allocfail.c (main): Increase portability of printf statement.
554 2019-01-18 Ian Lance Taylor <iant@golang.org>
556 PR libbacktrace/88890
557 * mmapio.c (backtrace_get_view): Change size parameter to
558 uint64_t. Check that value fits in size_t.
559 * read.c (backtrace_get_view): Likewise.
560 * internal.h (backtrace_get_view): Update declaration.
561 * elf.c (elf_add): Pass shstrhdr->sh_size to backtrace_get_view.
563 2019-01-17 Tom de Vries <tdevries@suse.de>
565 PR libbacktrace/82857
566 * configure.ac (DWZ): Set with AC_CHECK_PROG.
567 (HAVE_DWZ): Set with AM_CONDITIONAL.
568 * configure: Regenerate.
569 * Makefile.am (TESTS): Add btest_dwz.
570 * Makefile.in: Regenerate.
572 2019-01-17 Tom de Vries <tdevries@suse.de>
574 PR libbacktrace/82857
575 * dwarf.c (enum attr_val_encoding): Add ATTR_VAL_REF_ALT_INFO.
576 (read_attribute): Handle DW_FORM_GNU_ref_alt using
577 ATTR_VAL_REF_ALT_INFO.
578 (read_referenced_name_from_attr): Handle DW_FORM_GNU_ref_alt.
580 2019-01-17 Tom de Vries <tdevries@suse.de>
582 * dwarf.c (struct unit): Add low_offset and high_offset fields.
583 (struct unit_vector): New type.
584 (struct dwarf_data): Add units and units_counts fields.
585 (find_unit): New function.
586 (find_address_ranges): Add and handle unit_tag parameter.
587 (build_address_map): Add and handle units_vec parameter.
588 (build_dwarf_data): Pass units_vec to build_address_map. Store resulting
591 2019-01-17 Tom de Vries <tdevries@suse.de>
593 PR libbacktrace/82857
594 * dwarf.c (read_attribute): Handle DW_FORM_GNU_strp_alt
597 2019-01-17 Tom de Vries <tdevries@suse.de>
599 * dwarf.c (enum attr_val_encoding): Add ATTR_VAL_NONE.
600 (read_attribute): Add altlink parameter. Handle missing altlink for
601 DW_FORM_GNU_strp_alt and DW_FORM_GNU_ref_alt.
602 (find_address_ranges, build_address_map, build_dwarf_data): Add and
603 handle altlink parameter.
604 (read_referenced_name, read_function_entry): Add argument to
607 2019-01-17 Tom de Vries <tdevries@suse.de>
609 * dwarf.c (struct dwarf_data): Add altlink field.
610 (backtrace_dwarf_add): Add and handle fileline_altlink parameter.
611 * elf.c (elf_add): Add argument to backtrace_dwarf_add call.
612 (phdr_callback, backtrace_initialize): Add argument to elf_add calls.
613 * internal.h (backtrace_dwarf_add): Add fileline_altlink parameter.
614 * pecoff.c (coff_add): Add argument to backtrace_dwarf_add call.
615 * xcoff.c (xcoff_add): Same.
617 2019-01-17 Tom de Vries <tdevries@suse.de>
619 * internal.h (backtrace_dwarf_add): Add fileline_entry parameter.
620 * dwarf.c (backtrace_dwarf_add): Add and handle fileline_entry parameter.
621 * elf.c (elf_add): Add and handle fileline_entry parameter. Add
622 argument to backtrace_dwarf_add call.
623 (phdr_callback, backtrace_initialize): Add argument to elf_add calls.
624 * pecoff.c (coff_add): Add argument to backtrace_dwarf_add call.
625 * xcoff.c (xcoff_add): Same.
627 2019-01-17 Tom de Vries <tdevries@suse.de>
629 * elf.c (elf_add): Add and handle with_buildid_data and
630 with_buildid_size parameters. Handle .gnu_debugaltlink section.
631 (phdr_callback, backtrace_initialize): Add arguments to elf_add calls.
633 2019-01-16 Tom de Vries <tdevries@suse.de>
635 * dwarf.c (read_referenced_name_from_attr): New function. Factor out
637 (read_referenced_name): ... here, and ...
638 (read_function_entry): ... here.
640 2019-01-16 Tom de Vries <tdevries@suse.de>
642 * dwarf.c (read_referenced_name): Don't allow DW_AT_name to override any
644 (read_function_entry): Same. Don't allow name found via
645 DW_AT_abstract_origin or case DW_AT_specification to override linkage
648 2019-01-09 Sandra Loosemore <sandra@codesourcery.com>
652 * backtrace.h: Mechanically replace "can not" with "cannot".
654 2019-01-01 Jakub Jelinek <jakub@redhat.com>
656 Update copyright years.
658 2018-12-29 Gerald Pfeifer <gerald@pfeifer.com>
660 * Makefile.am (xcoff_%.c): Use an actual newline instead of \n
662 * Makefile.in: Regenerate.
664 2018-12-28 Tom de Vries <tdevries@suse.de>
666 * dwarf.c (build_address_map): Reuse unused units.
668 2018-12-28 Tom de Vries <tdevries@suse.de>
670 * dwarf.c (build_address_map): Simplify by removing local variable
673 2018-12-28 Ian Lance Taylor <iant@golang.org>
674 Tom de Vries <tdevries@suse.de>
676 PR libbacktrace/88063
677 * dwarf.c (free_unit_addrs_vector): Remove.
678 (build_address_map): Keep track of allocated units in vector. Free
679 allocated units and corresponding abbrevs upon failure. Remove now
680 redundant call to free_unit_addrs_vector. Free addrs vector upon
681 failure. Free allocated unit vector.
683 2018-12-28 Tom de Vries <tdevries@suse.de>
685 * dwarf.c (build_address_map): Free addrs vector upon failure.
687 2018-12-14 Tom de Vries <tdevries@suse.de>
690 * allocfail.sh: Remove "set -o pipefail".
692 2018-12-12 Tom de Vries <tdevries@suse.de>
694 * Makefile.am (TESTS): Add allocfail.sh.
695 (check_PROGRAMS): Add allocfail.
696 * Makefile.in: Regenerate.
697 * instrumented_alloc.c: New file. Redefine malloc and realloc.
699 * allocfail.c: New file.
700 * allocfail.sh: New file.
702 2018-11-30 Tom de Vries <tdevries@suse.de>
704 * Makefile.am (check_PROGRAMS): Add test_elf, test_xcoff_32,
705 test_xcoff_64, test_pecoff and test_unknown.
706 * Makefile.in: Regenerate.
707 * test_format.c: New file.
709 2018-11-30 Tom de Vries <tdevries@suse.de>
711 * Makefile.am : Add _with_alloc version for each test in
713 * Makefile.in: Regenerate.
715 2018-11-30 Tom de Vries <tdevries@suse.de>
717 * internal.h (backtrace_vector_free): New static inline fuction,
719 * dwarf.c (read_line_info): ... here.
721 2018-11-28 Tom de Vries <tdevries@suse.de>
723 * dwarf.c (read_abbrevs): Fix handling of abbrevs->abbrevs allocation
726 2018-11-27 Tom de Vries <tdevries@suse.de>
728 * mmap.c (backtrace_vector_release): Same.
729 * unittest.c (test1): Add check.
731 2018-11-27 Tom de Vries <tdevries@suse.de>
733 * alloc.c (backtrace_vector_release): Handle vec->size == 0 using free
735 * Makefile.am (check_PROGRAMS): Add unittest.
736 * Makefile.in: Regenerate.
737 * unittest.c: New file.
739 2018-11-22 Tom de Vries <tdevries@suse.de>
741 * dwarf.c (read_initial_length): Factor out of ...
742 (build_address_map, read_line_info): ... here.
744 2018-11-21 Tom de Vries <tdevries@suse.de>
746 * dwarf.c (read_string): Factor out of ...
747 (read_attribute, read_line_header, read_line_program): ... here.
749 2018-10-31 Joseph Myers <joseph@codesourcery.com>
752 * Makefile.am: Include multilib.am.
753 * configure.ac: Remove AC_PREREQ. Use AC_LANG_SOURCE.
754 * Makefile.in, aclocal.m4, config.h.in, configure: Regenerate.
756 2018-10-05 Ian Lance Taylor <iant@golang.org>
758 PR libbacktrace/87529
759 * backtrace.h: Document that backtrace_create_state should be
762 2018-08-05 Iain Buclaw <ibuclaw@gdcproject.org>
764 * configure.ac: Move define of HAVE_ZLIB into check for -lz.
765 * Makefile.in: Regenerate.
766 * config.h.in: Likewise.
767 * configure: Likewise.
769 2018-08-01 Tony Reix <tony.reix@atos.net>
771 * xcoff.c (struct xcoff_line, struct xcoff_line_vector): Remove.
772 (struct xcoff_func, struct xcoff_func_vector): New structs.
773 (xcoff_syminfo): Drop leading dot from symbol name.
774 (xcoff_line_compare, xcoff_line_search): Remove.
775 (xcoff_func_compare, xcoff_func_search): New static functions.
776 (xcoff_lookup_pc): Search function table.
777 (xcoff_add_line, xcoff_process_linenos): Remove.
778 (xcoff_initialize_fileline): Build function table.
780 2018-06-21 Denis Khalikov <d.khalikov@partner.samsung.com>
783 * elf.c (elf_add): Increase ".note.gnu.build-id" section size
784 checking up to 36 bytes.
786 2018-04-24 H.J. Lu <hongjiu.lu@intel.com>
788 * configure: Regenerated.
790 2018-04-19 Jakub Jelinek <jakub@redhat.com>
792 * configure: Regenerated.
794 2018-04-17 Ian Lance Taylor <iant@golang.org>
796 * backtrace.c: Revert last two changes. Don't call mmap
799 2018-04-17 Ian Lance Taylor <iant@golang.org>
801 * backtrace.c: Include backtrace-supported.h before checking
802 BACKTRACE_USES_MALLOC.
804 2018-04-17 Ian Lance Taylor <iant@golang.org>
806 * backtrace.c (backtrace_full): When testing whether we can
807 allocate memory, call mmap directly, and munmap the memory.
809 2018-04-04 Jakub Jelinek <jakub@redhat.com>
812 * elf.c (elf_zlib_fetch): Fix up predefined macro names in test for
813 big endian, only use 32-bit loads if endianity macros are predefined
814 and indicate big or little endian.
816 2018-02-14 Igor Tsimbalist <igor.v.tsimbalist@intel.com>
819 * configure: Regenerate.
821 2018-02-15 Jakub Jelinek <jakub@redhat.com>
824 * elf.c (SHT_PROGBITS): Undefine and define.
826 2018-02-14 Jakub Jelinek <jakub@redhat.com>
829 * elf.c (EM_PPC64, EF_PPC64_ABI): Undefine and define.
830 (struct elf_ppc64_opd_data): New type.
831 (elf_initialize_syminfo): Add opd argument, handle symbols
832 pointing into the PowerPC64 ELFv1 .opd section.
833 (elf_add): Read .opd section on PowerPC64 ELFv1, pass pointer
834 to structure with .opd data to elf_initialize_syminfo.
836 2018-01-31 Ian Lance Taylor <iant@golang.org>
838 * elf.c (elf_add): Close descriptor if we use a debugfile.
839 * btest.c (check_open_files): New static function.
840 (main): Call check_open_files.
842 2018-01-25 Ian Lance Taylor <iant@golang.org>
844 * elf.c (elf_open_debugfile_by_debuglink): Don't check CRC if the
846 (elf_add): Don't clear *found_sym and *found_dwarf if debuginfo.
848 2018-01-25 Ian Lance Taylor <iant@golang.org>
850 * pecoff.c (coff_add): Only release syms_view if it is valid.
852 2018-01-25 Ian Lance Taylor <iant@golang.org>
854 * pecoff.c (coff_add): Another memcpy -> coff_read4 fix.
856 2018-01-24 Ian Lance Taylor <iant@golang.org>
858 * pecoff.c (coff_add): Use coff_read4, not memcpy.
860 2018-01-24 Ian Lance Taylor <iant@golang.org>
863 * mmap.c (backtrace_free_locked): Don't put more than 16 entries
866 2018-01-19 Tony Reix <tony.reix@atos.net>
868 * xcoff.c (xcoff_incl_compare): New function.
869 (xcoff_incl_search): New function.
870 (xcoff_process_linenos): Use bsearch to find include file.
871 (xcoff_initialize_fileline): Sort include file information.
873 2018-01-16 Ian Lance Taylor <iant@golang.org>
875 * elf.c (codes) [GENERATE_FIXED_HUFFMAN_TABLE]: Fix size to be
877 (main) [GENERATE_FIXED_HUFFMAN_TABLE]: Pass 288 to
878 elf_zlib_inflate_table. Generate elf_zlib_default_dist_table.
879 (elf_zlib_default_table): Update.
880 (elf_zlib_default_dist_table): New static array.
881 (elf_zlib_inflate): Use elf_zlib_default_dist_table for dist table
883 * ztest.c (struct zlib_test): Add uncompressed_len.
884 (tests): Initialize uncompressed_len field. Add new test case.
885 (test_samples): Use uncompressed_len field.
887 2018-01-03 Jakub Jelinek <jakub@redhat.com>
889 Update copyright years.
891 2017-11-17 Igor Tsimbalist <igor.v.tsimbalist@intel.com>
893 * configure.ac: Add CET_FLAGS to EXTRA_FLAGS.
894 * aclocal.m4: Regenerate.
895 * Makefile.in: Likewise.
896 * configure: Likewise.
898 2017-10-06 Ian Lance Taylor <iant@golang.org>
900 * ztest.c (test_large): Pass unsigned long *, not size_t *, to
901 zlib uncompress function.
903 2017-10-05 Ian Lance Taylor <iant@golang.org>
905 * elf.c (elf_zlib_fetch): Change pval argument to uint64_t *.
906 Read a four byte integer.
907 (elf_zlib_inflate): Change val to uint64_t. Align pin to a 32-bit
908 boundary before ever calling elf_zlib_fetch.
909 * ztest.c (test_large): Simplify print statements a bit.
911 2017-10-02 Ian Lance Taylor <iant@golang.org>
913 * ztest.c: #include <errno.h>.
914 (TEST_TIMING): Don't define, don't test.
915 (xclock_gettime, xclockid_t): Define if !HAVE_CLOCK_GETTIME.
916 (clockid_t, clock_gettime, CLOCK_REALTIME): Likewise.
917 (ZLIB_CLOCK_GETTIME_ARG): Define.
918 * configure.ac: Change clock_gettime_link to CLOCK_GETTIME_LINK.
919 * Makefile.am: Likewise.
920 * configure, Makefile.in: Rebuild.
922 2017-10-02 Thomas Schwinge <thomas@codesourcery.com>
925 * Makefile.am: Append the content of clock_gettime_link to
927 * configure.ac: Test for the case that clock_gettime is in librt.
928 * Makefile.in: Regenerate.
929 * configure: Likewise.
932 * configure.ac: Check for clock_gettime.
933 * config.h.in: Regenerate.
934 * configure: Likewise.
935 * ztest.c (average_time, test_large): Conditionalize test timing
936 on clock_gettime availability.
938 2017-09-29 Tony Reix <tony.reix@atos.net>
940 * xcoff.c: Initial support for DWARF debug sections in XCOFF.
941 (STYP_DWARF, SSUBTYP_DW*): Define.
942 (enum dwarf_section): Define.
943 (struct dwsect_info): Define.
944 (xcoff_add): Look for DWARF sections, pass them to
947 2017-09-28 Ian Lance Taylor <iant@golang.org>
950 * elf.c (__builtin_prefetch): Define if not __GNUC__.
952 (SHF_UNCOMPRESSED, ELFCOMPRESS_ZLIB): Define.
953 (b_elf_chdr): Define type.
954 (enum debug_section): Add ZDEBUG_xxx values.
955 (debug_section_names): Add names for new sections.
956 (struct debug_section_info): Add compressed field.
957 (elf_zlib_failed, elf_zlib_fetch): New static functions.
958 (HUFFMAN_TABLE_SIZE, HUFFMAN_VALUE_MASK): Define.
959 (HUFFMAN_BITS_SHIFT, HUFFMAN_BITS_MASK): Define.
960 (HUFFMAN_SECONDARY_SHIFT): Define.
961 (ZDEBUG_TABLE_SIZE): Define.
962 (ZDEBUG_TABLE_CODELEN_OFFSET, ZDEBUG_TABLE_WORK_OFFSET): Define.
963 (final_next_secondary): New static variable if
964 BACKTRACE_GENERATE_FIXED_HUFFMAN_TABLE.
965 (elf_zlib_inflate_table): New static function.
966 (BACKTRACE_GENERATE_FIXED_HUFFMAN_TABLE): If define, define main
967 function to produce fixed Huffman table.
968 (elf_zlib_default_table): New static variable.
969 (elf_zlib_inflate): New static function.
970 (elf_zlib_verify_checksum): Likewise.
971 (elf_zlib_inflate_and_verify): Likewise.
972 (elf_uncompress_zdebug): Likewise.
973 (elf_uncompress_chdr): Likewise.
974 (backtrace_uncompress_zdebug): New extern function.
975 (elf_add): Look for .zdebug sections and SHF_COMPRESSED debug
976 sections, and uncompress them.
977 * internal.h (backtrace_compress_zdebug): Declare.
979 * configure.ac: Check for -lz and check whether the linker
980 supports --compress-debug-sections.
981 * Makefile.am (ztest_SOURCES): New variable.
982 (ztest_CFLAGS, ztest_LDADD): New variables.
983 (check_PROGRAMS): Add ztest.
984 (ctestg_SOURCES): New variable.
985 (ctestg_CFLAGS, ctestg_LDFLAGS, ctestg_LDADD): New variables.
986 (ctesta_SOURCES): New variable.
987 (ctesta_CFLAGS, ctesta_LDFLAGS, ctesta_LDADD): New variables.
988 (check_PROGRAMS): Add ctestg and ctesta.
989 * configure, config.h.in, Makefile.in: Rebuild.
991 2017-09-22 Ian Lance Taylor <iant@golang.org>
994 * configure.ac: Check for lstat and readlink.
995 * elf.c (lstat, readlink): Provide dummy versions if real versions
997 * configure, config.h.in: Rebuild.
999 2017-09-21 Ian Lance Taylor <iant@google.com>
1002 * elf.c (backtrace_initialize): Set pd.exe_filename.
1004 2017-09-20 Ian Lance Taylor <iant@golang.org>
1005 Denis Khalikov <d.khalikov@partner.samsung.com>
1008 Support for external debug info.
1009 * elf.c: Include <errno.h>, <sys/stat.h>, <unistd.h>.
1010 (S_ISLNK): Define if not defined.
1011 (xstrnlen): Define if strnlen is not available.
1012 (b_elf_note): Define type.
1013 (NT_GNU_BUILD_ID): Define macro.
1014 (elf_crc32, elf_crc32_file): New static functions.
1015 (elf_is_symlink, elf_readlink): New static functions.
1016 (elf_open_debugfile_by_buildid): New static function.
1017 (elf_try_debugfile): New static function.
1018 (elf_find_debugfile_by_debuglink): New static function.
1019 (elf_open_debugfile_by_debuglink): New static function.
1020 (elf_add): Add filename and debuginfo parameters. Adjust all
1021 callers. Look for external debug info notes, and try to fetch
1022 debug info from external file.
1023 (struct phdr_data): Add exe_filename field.
1024 (phdr_callback): Pass filename to elf_add.
1025 (backtrace_initialize): Add filename parameter.
1026 * internal.h (backtrace_initialize): Add filename parameter.
1027 * fileline.c (fileline_initialize): Pass filename to
1028 backtrace_initialize.
1029 * pecoff.c (fileline_initialize): Add unused filename parameter.
1030 * unknown.c (fileline_initialize): Likewise.
1031 * xcoff.c (fileline_initialize): Likewise.
1032 * configure.ac: Check for objcopy --add-gnu-debuglink.
1033 * Makefile.am (dtest): New test target.
1034 * configure, Makefile.in: Rebuild.
1036 2017-09-12 Steve Ellcey <sellcey@cavium.com>
1039 * Makefile.am (ttest_CFLAGS): Add $(AM_CFLAGS)
1040 * Makefile.in: Regenerate.
1042 2017-09-12 Steve Ellcey <sellcey@cavium.com>
1045 * libbacktrace/Makefile.in
1046 (HAVE_PTHREAD_TRUE@@NATIVE_TRUE@ttest_CFLAGS): Add $(AM_CFLAGS)
1048 2017-08-02 David Edelsohn <dje.gcc@gmail.com>
1051 * xcoff.c (xcoff_process_linenos): Initialize incl to NULL.
1053 2017-07-28 Tony Reix <tony.reix@atos.net>
1055 * xcoff.c: Don't leak a file descriptor if an archive is malformed.
1057 2017-07-28 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
1059 * fileline.c (fileline_initialize): Print pid_t as long.
1061 2017-07-26 Tony Reix <tony.reix@atos.net>
1063 * configure.ac: Check for XCOFF32/XCOFF64. Check for loadquery.
1064 * filetype.awk: Separate AIX XCOFF32 and XCOFF64.
1065 * xcoff.c: Add support for AIX XCOFF32 and XCOFF64 formats.
1066 * configure, config.h.in: Regenerate.
1068 2017-07-21 Tony Reix <tony.reix@atos.net>
1070 * filetype.awk: Add AIX XCOFF type detection.
1071 * configure.ac: Recognize xcoff format.
1072 * Makefile.am (FORMAT_FILES): Add xcoff.c.
1073 * fileline.c: Include <unistd.h>.
1074 (fileline_initialize): Add case for AIX procfs.
1075 * xcoff.c: New file.
1076 * configure, Makefile.in: Rebuild.
1078 2017-06-21 Richard Biener <rguenther@suse.de>
1080 * configure.ac: Add AC_SYS_LARGEFILE.
1081 * config.h.in: Regenerate.
1082 * configure: Likewise.
1084 2017-06-11 Ian Lance Taylor <iant@golang.org>
1086 * elf.c (backtrace_initialize): Always set *fileline_fn.
1087 * ttest.c: New file.
1088 * btest.c: Move support functions into testlib.c. Change calls to
1089 check to pass file name.
1090 * testlib.c: New file, copied from (part of) btest.c.
1091 * testlib.h: New file, declarations for testlib.c.
1092 * edtest.c: Use testlib.h and testlib.c.
1093 * configure.ac: Test for -pthread, set HAVE_PTHREAD conditional.
1094 * Makefile.am (btest_SOURCES): Add testlib.c.
1095 (edtest_SOURCES): Likewise.
1096 (CHECK_PROGRAMS): Add ttest if HAVE_PTHREAD.
1097 (ttest_SOURCES, ttest_CFLAGS, ttest_LDADD): Define.
1098 * configure, Makefile.in: Rebuild.
1100 2017-05-19 Than McIntosh <thanm@google.com>
1102 * dwarf.c (free_line_header): Don't free dirs if dirs_count == 0.
1103 (read_line_header): Don't allocate dirs if dirs_count == 0.
1104 * edtest.c: New file.
1105 * edtest2.c: New file.
1106 * Makefile.am (edtest_SOURCES, edtest_LDADD): Define.
1107 (check_PROGRAMS): Add edtest.
1108 (edtest2_build.c, gen_edtest2_build): New targets.
1109 * Makefile.in: Rebuild.
1111 2017-03-08 Sam Thursfield <sam.thursfield@codethink.co.uk>
1113 * btest.c (test5): Replace #ifdef guard with 'unused' attribute
1114 to fix compile warning when BACKTRACE_SUPPORTED isn't defined.
1116 2017-01-01 Jakub Jelinek <jakub@redhat.com>
1118 Update copyright years.
1120 2016-11-15 Matthias Klose <doko@ubuntu.com>
1122 * configure: Regenerate.
1124 2016-09-11 Carlos Liam <carlos@aarzee.me>
1126 * all: Remove meaningless trailing whitespace.
1128 2016-05-18 Uros Bizjak <ubizjak@gmail.com>
1131 * elf.c (phdr_callback) [__i386__]: Add
1132 __attribute__((__force_align_arg_pointer__)).
1134 2016-03-02 Maxim Ostapenko <m.ostapenko@partner.samsung.com>
1136 * elf.c (backtrace_initialize): Properly initialize elf_fileline_fn to
1137 avoid possible crash.
1138 (elf_add): Don't set *fileline_fn to elf_nodebug value in case of
1139 missing debug info anymore.
1141 2016-02-06 John David Anglin <danglin@gcc.gnu.org>
1143 * mmap.c (MAP_FAILED): Define if not defined.
1145 2016-01-04 Jakub Jelinek <jakub@redhat.com>
1147 Update copyright years.
1149 2015-12-18 Andris Pavenis <andris.pavenis@iki.fi>
1151 * configure.ac: Specify that DJGPP do not have mmap
1152 even when sys/mman.h exists.
1153 * configure: Regenerate
1155 2015-12-09 John David Anglin <danglin@gcc.gnu.org>
1157 PR libgfortran/68115
1158 * configure.ac: Set libbacktrace_cv_sys_sync to no on hppa*-*-hpux*.
1159 * configure: Regenerate.
1160 * elf.c (backtrace_initialize): Cast __sync_bool_compare_and_swap call
1163 2015-09-17 Ian Lance Taylor <iant@google.com>
1165 * posix.c (backtrace_open): Cast second argument of open() to int.
1167 2015-09-11 Ian Lance Taylor <iant@google.com>
1169 * Makefile.am (backtrace.lo): Depend on internal.h.
1170 (sort.lo, stest.lo): Add explicit dependencies.
1171 * Makefile.in: Rebuild.
1173 2015-09-09 Hans-Peter Nilsson <hp@axis.com>
1175 * backtrace.c: #include <sys/types.h>.
1177 2015-09-08 Ian Lance Taylor <iant@google.com>
1180 * backtrace.c: #include "internal.h".
1181 (struct backtrace_data): Add can_alloc field.
1182 (unwind): If can_alloc is false, don't try to get file/line
1184 (backtrace_full): Set can_alloc field in bdata.
1185 * alloc.c (backtrace_alloc): Don't call error_callback if it is
1187 * mmap.c (backtrace_alloc): Likewise.
1188 * internal.h: Update comments for backtrace_alloc and
1191 2015-09-08 Ian Lance Taylor <iant@google.com>
1194 * mmap.c (backtrace_alloc): Correct test for mmap failure.
1196 2015-08-31 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
1198 * configure.ac: For spu-*-* targets, set have_fcntl to no.
1199 * configure: Regenerate.
1201 2015-08-27 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
1203 * configure.ac: Remove [disable-shared] argument to LT_INIT.
1204 Remove setting PIC_FLAG when building as target library.
1205 * configure: Regenerate.
1207 2015-08-26 Hans-Peter Nilsson <hp@axis.com>
1209 * configure.ac: Only compile with -fPIC if the target
1211 * configure: Regenerate.
1213 2015-08-24 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
1215 * configure.ac: Set have_mmap to no on spu-*-* targets.
1216 * configure: Regenerate.
1218 2015-08-13 Ian Lance Taylor <iant@google.com>
1220 * dwarf.c (read_function_entry): Add vec_inlined parameter.
1223 2015-06-11 Martin Sebor <msebor@redhat.com>
1226 * dwarf.c (struct line): Add new field idx.
1227 (line_compare): Use it.
1229 (read_line_info): Reset it.
1231 2015-05-29 Tristan Gingold <gingold@adacore.com>
1233 * pecoff.c: New file.
1234 * Makefile.am (FORMAT_FILES): Add pecoff.c and dependencies.
1235 * Makefile.in: Regenerate.
1236 * filetype.awk: Detect pecoff.
1237 * configure.ac: Define BACKTRACE_SUPPORTS_DATA on elf platforms.
1239 * btest.c (test5): Test enabled only if BACKTRACE_SUPPORTS_DATA is
1241 * backtrace-supported.h.in (BACKTRACE_SUPPORTS_DATA): Define.
1242 * configure: Regenerate.
1243 * pecoff.c: New file.
1245 2015-05-13 Michael Haubenwallner <michael.haubenwallner@ssi-schaefer.com>
1247 * Makefile.in: Regenerated with automake-1.11.6.
1248 * aclocal.m4: Likewise.
1249 * configure: Likewise.
1251 2015-01-24 Matthias Klose <doko@ubuntu.com>
1253 * configure.ac: Move AM_ENABLE_MULTILIB before AC_PROG_CC.
1254 * configure: Regenerate.
1256 2015-01-05 Jakub Jelinek <jakub@redhat.com>
1258 Update copyright years.
1260 2014-11-21 H.J. Lu <hongjiu.lu@intel.com>
1263 * configure: Regenerated.
1265 2014-11-11 David Malcolm <dmalcolm@redhat.com>
1267 * ChangeLog.jit: New.
1269 2014-11-11 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
1272 * configure: Regenerate.
1274 2014-10-23 Ian Lance Taylor <iant@google.com>
1276 * internal.h (backtrace_atomic_load_pointer) [no atomic or sync]:
1277 Fix to return void *.
1279 2014-05-08 Ian Lance Taylor <iant@google.com>
1281 * mmap.c (backtrace_free): If freeing a large aligned block of
1282 memory, call munmap rather than holding onto it.
1283 (backtrace_vector_grow): When growing a vector, double the number
1284 of pages requested. When releasing the old version of a grown
1285 vector, pass the correct size to backtrace_free.
1287 2014-03-07 Ian Lance Taylor <iant@google.com>
1289 * sort.c (backtrace_qsort): Use middle element as pivot.
1291 2014-03-06 Ian Lance Taylor <iant@google.com>
1294 * stest.c: New file.
1295 * internal.h (backtrace_qsort): Declare.
1296 * dwarf.c (read_abbrevs): Call backtrace_qsort instead of qsort.
1297 (read_line_info, read_function_entry): Likewise.
1298 (read_function_info, build_dwarf_data): Likewise.
1299 * elf.c (elf_initialize_syminfo): Likewise.
1300 * Makefile.am (libbacktrace_la_SOURCES): Add sort.c.
1301 (stest_SOURCES, stest_LDADD): Define.
1302 (check_PROGRAMS): Add stest.
1304 2014-02-07 Misty De Meo <misty@brew.sh>
1307 * configure.ac: Use AC_LINK_IFELSE in check for
1309 * configure: Regenerate.
1311 2014-01-02 Richard Sandiford <rdsandiford@googlemail.com>
1313 Update copyright years
1315 2013-12-06 Jakub Jelinek <jakub@redhat.com>
1317 * elf.c (ET_DYN): Undefine and define again.
1318 (elf_add): Add exe argument, if true and ehdr.e_type is ET_DYN,
1319 return early -1 without closing the descriptor.
1320 (struct phdr_data): Add exe_descriptor.
1321 (phdr_callback): If pd->exe_descriptor is not -1, for very first
1322 call if dlpi_name is NULL just call elf_add with the exe_descriptor,
1323 otherwise backtrace_close the exe_descriptor if not -1. Adjust
1325 (backtrace_initialize): Adjust call to elf_add. If it returns
1326 -1, set pd.exe_descriptor to descriptor, otherwise set it to -1.
1328 2013-12-05 Ian Lance Taylor <iant@google.com>
1330 * alloc.c (backtrace_vector_finish): Add error_callback and data
1331 parameters. Call backtrace_vector_release. Return address base.
1332 * mmap.c (backtrace_vector_finish): Add error_callback and data
1333 parameters. Return address base.
1334 * dwarf.c (read_function_info): Get new address base from
1335 backtrace_vector_finish.
1336 * internal.h (backtrace_vector_finish): Update declaration.
1338 2013-11-27 Ian Lance Taylor <iant@google.com>
1340 * dwarf.c (find_address_ranges): New static function, broken out
1341 of build_address_map.
1342 (build_address_map): Call it.
1343 * btest.c (check): Check for missing filename or function, rather
1345 (f3): Check that enough frames were returned.
1347 2013-11-19 Jakub Jelinek <jakub@redhat.com>
1349 * backtrace.h (backtrace_syminfo_callback): Add symsize argument.
1350 * elf.c (elf_syminfo): Pass 0 or sym->size to the callback as
1352 * btest.c (struct symdata): Add size field.
1353 (callback_three): Add symsize argument. Copy it to the data->size
1355 (f23): Set symdata.size to 0.
1356 (test5): Likewise. If sizeof (int) > 1, lookup address of
1357 ((uintptr_t) &global) + 1. Verify symdata.val and symdata.size
1360 * atomic.c: Include sys/types.h.
1362 2013-11-18 Ian Lance Taylor <iant@google.com>
1364 * configure.ac: Check for support of __atomic extensions.
1365 * internal.h: Declare or #define atomic functions for use in
1367 * atomic.c: New file.
1368 * dwarf.c (dwarf_lookup_pc): Use atomic functions.
1369 (dwarf_fileline, backtrace_dwarf_add): Likewise.
1370 * elf.c (elf_add_syminfo_data, elf_syminfo): Likewise.
1371 (backtrace_initialize): Likewise.
1372 * fileline.c (fileline_initialize): Likewise.
1373 * Makefile.am (libbacktrace_la_SOURCES): Add atomic.c.
1374 * configure, config.h.in, Makefile.in: Rebuild.
1376 2013-11-18 Jakub Jelinek <jakub@redhat.com>
1378 * elf.c (SHN_UNDEF): Define.
1379 (elf_initialize_syminfo): Add base_address argument. Ignore symbols
1380 with st_shndx == SHN_UNDEF. Add base_address to address fields.
1381 (elf_add): Adjust caller.
1383 * elf.c (phdr_callback): Process info->dlpi_addr == 0 normally.
1385 2013-11-16 Ian Lance Taylor <iant@google.com>
1387 * backtrace.h (backtrace_create_state): Correct comment about
1390 2013-11-15 Ian Lance Taylor <iant@google.com>
1392 * backtrace.h (backtrace_syminfo): Update comment and parameter
1393 name to take any address, not just a PC value.
1394 * elf.c (STT_OBJECT): Define.
1395 (elf_nosyms): Rename parameter pc to addr.
1396 (elf_symbol_search): Rename local variable pc to addr.
1397 (elf_initialize_syminfo): Add STT_OBJECT symbols to elf_symbols.
1398 (elf_syminfo): Rename parameter pc to addr.
1399 * btest.c (global): New global variable.
1403 2013-10-17 Ian Lance Taylor <iant@google.com>
1405 * elf.c (elf_add): Don't get the wrong offsets if a debug section
1408 2013-10-15 David Malcolm <dmalcolm@redhat.com>
1410 * configure.ac: Add --enable-host-shared, setting up
1411 pre-existing PIC_FLAG variable within Makefile.am et al.
1412 * configure: Regenerate.
1414 2013-09-20 Alan Modra <amodra@gmail.com>
1416 * configure: Regenerate.
1418 2013-07-23 Alexander Monakov <amonakov@ispras.ru>
1420 * elf.c (elf_syminfo): Loop over the elf_syminfo_data chain.
1422 2013-07-23 Alexander Monakov <amonakov@ispras.ru>
1424 * elf.c (backtrace_initialize): Pass elf_fileline_fn to
1425 dl_iterate_phdr callbacks.
1427 2013-03-25 Ian Lance Taylor <iant@google.com>
1429 * alloc.c: #include <sys/types.h>.
1432 2013-01-31 Ian Lance Taylor <iant@google.com>
1434 * dwarf.c (read_function_info): Permit fvec parameter to be NULL.
1435 (dwarf_lookup_pc): Don't use ddata->fvec if threaded.
1437 2013-01-25 Jakub Jelinek <jakub@redhat.com>
1440 * dwarf.c (read_line_header): Don't crash if DW_AT_comp_dir
1441 attribute was not seen.
1443 2013-01-16 Ian Lance Taylor <iant@google.com>
1445 * dwarf.c (struct unit): Add filename and abs_filename fields.
1446 (build_address_map): Set new fields when reading unit.
1447 (dwarf_lookup_pc): If we don't find an entry in the line table,
1448 just return the main file name.
1450 2013-01-14 Richard Sandiford <rdsandiford@googlemail.com>
1452 Update copyright years.
1454 2013-01-01 Ian Lance Taylor <iant@google.com>
1457 * Makefile.am (AM_CPPFLAGS): Remove -I ../gcc/include and -I
1458 $(MULTIBUILDTOP)/../../gcc/include.
1459 * Makefile.in: Rebuild.
1461 2013-01-01 Ian Lance Taylor <iant@google.com>
1464 * mmap.c (backtrace_alloc): Don't call sync functions if not
1466 (backtrace_free): Likewise.
1468 2012-12-12 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
1470 * mmapio.c: Define MAP_FAILED if not defined.
1472 2012-12-11 Jakub Jelinek <jakub@redhat.com>
1475 * Makefile.am (AM_CFLAGS): Remove -frandom-seed=$@.
1476 * configure.ac: If --with-target-subdir, add -frandom-seed=$@
1477 to EXTRA_FLAGS unconditionally, otherwise check whether the compiler
1479 * Makefile.in: Regenerated.
1480 * configure: Regenerated.
1482 2012-12-07 Jakub Jelinek <jakub@redhat.com>
1485 * Makefile.am (AM_CFLAGS): Add -frandom-seed=$@.
1486 * Makefile.in: Regenerated.
1488 2012-11-20 Ian Lance Taylor <iant@google.com>
1490 * dwarf.c (read_attribute): Always clear val.
1492 2012-11-13 Ian Lance Taylor <iant@google.com>
1495 * configure.ac: Only add -Werror if building a target library.
1496 * configure: Rebuild.
1498 2012-11-12 Ian Lance Taylor <iant@google.com>
1499 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
1500 Gerald Pfeifer <gerald@pfeifer.com>
1502 * configure.ac: Check for getexecname.
1503 * fileline.c: #include <errno.h>. Define getexecname if not
1505 (fileline_initialize): Try to find the executable in a few
1507 * print.c (error_callback): Only print the filename if it came
1508 from the backtrace state.
1509 * configure, config.h.in: Rebuild.
1511 2012-10-29 Ian Lance Taylor <iant@google.com>
1513 * mmap.c (backtrace_vector_release): Correct last patch: add
1516 2012-10-29 Ian Lance Taylor <iant@google.com>
1518 * mmap.c (backtrace_vector_release): Make sure freed block is
1519 aligned on 8-byte boundary.
1521 2012-10-26 Ian Lance Taylor <iant@google.com>
1524 * posix.c (backtrace_open): Add does_not_exist parameter.
1525 * elf.c (phdr_callback): Do not warn if shared library could not
1527 * fileline.c (fileline_initialize): Update calls to
1529 * internal.h (backtrace_open): Update declaration.
1531 2012-10-26 Jack Howarth <howarth@bromo.med.uc.edu>
1534 * configure.ac: Check for _Unwind_GetIPInfo function declaration.
1535 * configure: Regenerate.
1537 2012-10-24 Ian Lance Taylor <iant@google.com>
1540 * configure.ac: Check whether -funwind-tables option works.
1541 * configure: Rebuild.
1543 2012-10-11 Ian Lance Taylor <iant@google.com>
1545 * configure.ac: Do not use dl_iterate_phdr on Solaris 10.
1546 * configure: Rebuild.
1548 2012-10-10 Ian Lance Taylor <iant@google.com>
1550 * elf.c: Rename all Elf typedefs to start with b_elf, and be all
1553 2012-10-10 Hans-Peter Nilsson <hp@bitrange.com>
1555 * elf.c (elf_add_syminfo_data): Add casts to avoid warning.
1557 2012-10-09 Ian Lance Taylor <iant@google.com>
1559 * dwarf.c (dwarf_fileline): Add cast to avoid warning.
1560 (backtrace_dwarf_add): Likewise.
1562 2012-10-09 Ian Lance Taylor <iant@google.com>
1564 Add support for tracing through shared libraries.
1565 * configure.ac: Check for link.h and dl_iterate_phdr.
1566 * elf.c: #include <link.h> if system has dl_iterate_phdr. #undef
1567 ELF macros before #defining them.
1568 (dl_phdr_info, dl_iterate_phdr): Define if system does not have
1570 (struct elf_syminfo_data): Add next field.
1571 (elf_initialize_syminfo): Initialize next field.
1572 (elf_add_syminfo_data): New static function.
1573 (elf_add): New static function, broken out of
1574 backtrace_initialize. Call backtrace_dwarf_add instead of
1575 backtrace_dwarf_initialize.
1576 (struct phdr_data): Define.
1577 (phdr_callback): New static function.
1578 (backtrace_initialize): Call elf_add.
1579 * dwarf.c (struct dwarf_data): Add next and base_address fields.
1580 (add_unit_addr): Add base_address parameter. Change all callers.
1581 (add_unit_ranges, build_address_map): Likewise.
1582 (add_line): Add ddata parameter. Change all callers.
1583 (read_line_program, add_function_range): Likewise.
1584 (dwarf_lookup_pc): New static function, broken out of
1586 (dwarf_fileline): Call dwarf_lookup_pc.
1587 (build_dwarf_data): New static function.
1588 (backtrace_dwarf_add): New function.
1589 (backtrace_dwarf_initialize): Remove.
1590 * internal.h (backtrace_dwarf_initialize): Don't declare.
1591 (backtrace_dwarf_add): Declare.
1592 * configure, config.h.in: Rebuild.
1594 2012-10-04 Gerald Pfeifer <gerald@pfeifer.com>
1596 * btest.c (f23): Avoid uninitialized variable warning.
1598 2012-10-04 Ian Lance Taylor <iant@google.com>
1600 * dwarf.c: If the system header files do not declare strnlen,
1601 provide our own version.
1603 2012-10-03 Ian Lance Taylor <iant@google.com>
1605 * dwarf.c (read_uleb128): Fix overflow test.
1606 (read_sleb128): Likewise.
1607 (build_address_map): Don't change unit_buf.start.
1609 2012-10-02 Uros Bizjak <ubizjak@gmail.com>
1612 * configure.ac (EXTRA_FLAGS): New.
1613 * Makefile.am (AM_FLAGS): Add $(EXTRA_FLAGS).
1614 * configure, Makefile.in: Regenerate.
1616 2012-09-29 Ian Lance Taylor <iant@google.com>
1619 * fileline.c (fileline_initialize): Pass errnum as -1 when
1620 reporting that we could not read executable information after a
1623 2012-09-27 Ian Lance Taylor <iant@google.com>
1626 * configure.ac: Add no-dependencies to AM_INIT_AUTOMAKE.
1627 * Makefile.am: Add dependencies for all objects.
1628 * configure, aclocal.m4, Makefile.in: Rebuild.
1630 2012-09-27 Ian Lance Taylor <iant@google.com>
1633 * elf.c (backtrace_initialize): Set *fileln_fn, not
1636 2012-09-19 Ian Lance Taylor <iant@google.com>
1638 * configure.ac: Only use GCC_CHECK_UNWIND_GETIPINFO when compiled
1639 as a target library.
1640 * configure: Rebuild.
1642 2012-09-19 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
1643 Ian Lance Taylor <iant@google.com>
1645 * configure.ac (GCC_HEADER_STDINT): Invoke.
1646 * backtrace.h: If we can't find <stdint.h>, use "gstdint.h".
1647 * btest.c: Don't include <stdint.h>.
1648 * dwarf.c: Likewise.
1649 * configure, aclocal.m4, Makefile.in, config.h.in: Rebuild.
1651 2012-09-18 Ian Lance Taylor <iant@google.com>
1654 * Makefile.am (AM_CPPFLAGS): Define.
1655 (AM_CFLAGS): Remove -I options.
1656 * Makefile.in: Rebuild.
1658 2012-09-18 Ian Lance Taylor <iant@google.com>
1660 * posix.c (O_BINARY): Define if not defined.
1661 (backtrace_open): Pass O_BINARY to open. Only call fcntl if
1662 HAVE_FCNTL is defined.
1663 * configure.ac: Test for the fcntl function.
1664 * configure, config.h.in: Rebuild.
1666 2012-09-18 Ian Lance Taylor <iant@google.com>
1668 * btest.c (test1, test2, test3, test4): Add the unused attribute.
1670 2012-09-18 Ian Lance Taylor <iant@google.com>
1672 * dwarf.c: Correct test of HAVE_DECL_STRNLEN.
1674 2012-09-18 Ian Lance Taylor <iant@google.com>
1676 * configure.ac: Add AC_USE_SYSTEM_EXTENSIONS.
1677 * mmapio.c: Don't define _GNU_SOURCE.
1678 * configure, config.h.in: Rebuild.
1680 2012-09-18 Ian Lance Taylor <iant@google.com>
1682 * configure.ac: Check whether strnlen is declared.
1683 * dwarf.c: Declare strnlen if not declared.
1684 * configure, config.h.in: Rebuild.
1686 2012-09-18 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
1688 * fileline.c: Include <stdlib.h>.
1691 2012-09-17 Ian Lance Taylor <iant@google.com>
1694 * nounwind.c (backtrace_full): Rename from backtrace. Add state
1697 2012-09-17 Gerald Pfeifer <gerald@pfeifer.com>
1700 * nounwind.c (backtrace_simple): Add state parameter.
1702 2012-09-17 Ian Lance Taylor <iant@google.com>
1705 * unknown.c (unknown_fileline): Add state parameter, remove
1706 fileline_data parameter, name error_callback parameter.
1707 (backtrace_initialize): Add state parameter.
1709 2012-09-17 Ian Lance Taylor <iant@google.com>
1711 * Initial implementation.
1713 Copyright (C) 2012-2020 Free Software Foundation, Inc.
1715 Copying and distribution of this file, with or without modification,
1716 are permitted in any medium without royalty provided the copyright
1717 notice and this notice are preserved.