1 2018-11-28 Tom de Vries <tdevries@suse.de>
3 * dwarf.c (read_abbrevs): Fix handling of abbrevs->abbrevs allocation
6 2018-11-27 Tom de Vries <tdevries@suse.de>
8 * mmap.c (backtrace_vector_release): Same.
9 * unittest.c (test1): Add check.
11 2018-11-27 Tom de Vries <tdevries@suse.de>
13 * alloc.c (backtrace_vector_release): Handle vec->size == 0 using free
15 * Makefile.am (check_PROGRAMS): Add unittest.
16 * Makefile.in: Regenerate.
17 * unittest.c: New file.
19 2018-11-22 Tom de Vries <tdevries@suse.de>
21 * dwarf.c (read_initial_length): Factor out of ...
22 (build_address_map, read_line_info): ... here.
24 2018-11-21 Tom de Vries <tdevries@suse.de>
26 * dwarf.c (read_string): Factor out of ...
27 (read_attribute, read_line_header, read_line_program): ... here.
29 2018-10-31 Joseph Myers <joseph@codesourcery.com>
32 * Makefile.am: Include multilib.am.
33 * configure.ac: Remove AC_PREREQ. Use AC_LANG_SOURCE.
34 * Makefile.in, aclocal.m4, config.h.in, configure: Regenerate.
36 2018-10-05 Ian Lance Taylor <iant@golang.org>
39 * backtrace.h: Document that backtrace_create_state should be
42 2018-08-05 Iain Buclaw <ibuclaw@gdcproject.org>
44 * configure.ac: Move define of HAVE_ZLIB into check for -lz.
45 * Makefile.in: Regenerate.
46 * config.h.in: Likewise.
47 * configure: Likewise.
49 2018-08-01 Tony Reix <tony.reix@atos.net>
51 * xcoff.c (struct xcoff_line, struct xcoff_line_vector): Remove.
52 (struct xcoff_func, struct xcoff_func_vector): New structs.
53 (xcoff_syminfo): Drop leading dot from symbol name.
54 (xcoff_line_compare, xcoff_line_search): Remove.
55 (xcoff_func_compare, xcoff_func_search): New static functions.
56 (xcoff_lookup_pc): Search function table.
57 (xcoff_add_line, xcoff_process_linenos): Remove.
58 (xcoff_initialize_fileline): Build function table.
60 2018-06-21 Denis Khalikov <d.khalikov@partner.samsung.com>
63 * elf.c (elf_add): Increase ".note.gnu.build-id" section size
64 checking up to 36 bytes.
66 2018-04-24 H.J. Lu <hongjiu.lu@intel.com>
68 * configure: Regenerated.
70 2018-04-19 Jakub Jelinek <jakub@redhat.com>
72 * configure: Regenerated.
74 2018-04-17 Ian Lance Taylor <iant@golang.org>
76 * backtrace.c: Revert last two changes. Don't call mmap
79 2018-04-17 Ian Lance Taylor <iant@golang.org>
81 * backtrace.c: Include backtrace-supported.h before checking
82 BACKTRACE_USES_MALLOC.
84 2018-04-17 Ian Lance Taylor <iant@golang.org>
86 * backtrace.c (backtrace_full): When testing whether we can
87 allocate memory, call mmap directly, and munmap the memory.
89 2018-04-04 Jakub Jelinek <jakub@redhat.com>
92 * elf.c (elf_zlib_fetch): Fix up predefined macro names in test for
93 big endian, only use 32-bit loads if endianity macros are predefined
94 and indicate big or little endian.
96 2018-02-14 Igor Tsimbalist <igor.v.tsimbalist@intel.com>
99 * configure: Regenerate.
101 2018-02-15 Jakub Jelinek <jakub@redhat.com>
104 * elf.c (SHT_PROGBITS): Undefine and define.
106 2018-02-14 Jakub Jelinek <jakub@redhat.com>
109 * elf.c (EM_PPC64, EF_PPC64_ABI): Undefine and define.
110 (struct elf_ppc64_opd_data): New type.
111 (elf_initialize_syminfo): Add opd argument, handle symbols
112 pointing into the PowerPC64 ELFv1 .opd section.
113 (elf_add): Read .opd section on PowerPC64 ELFv1, pass pointer
114 to structure with .opd data to elf_initialize_syminfo.
116 2018-01-31 Ian Lance Taylor <iant@golang.org>
118 * elf.c (elf_add): Close descriptor if we use a debugfile.
119 * btest.c (check_open_files): New static function.
120 (main): Call check_open_files.
122 2018-01-25 Ian Lance Taylor <iant@golang.org>
124 * elf.c (elf_open_debugfile_by_debuglink): Don't check CRC if the
126 (elf_add): Don't clear *found_sym and *found_dwarf if debuginfo.
128 2018-01-25 Ian Lance Taylor <iant@golang.org>
130 * pecoff.c (coff_add): Only release syms_view if it is valid.
132 2018-01-25 Ian Lance Taylor <iant@golang.org>
134 * pecoff.c (coff_add): Another memcpy -> coff_read4 fix.
136 2018-01-24 Ian Lance Taylor <iant@golang.org>
138 * pecoff.c (coff_add): Use coff_read4, not memcpy.
140 2018-01-24 Ian Lance Taylor <iant@golang.org>
143 * mmap.c (backtrace_free_locked): Don't put more than 16 entries
146 2018-01-19 Tony Reix <tony.reix@atos.net>
148 * xcoff.c (xcoff_incl_compare): New function.
149 (xcoff_incl_search): New function.
150 (xcoff_process_linenos): Use bsearch to find include file.
151 (xcoff_initialize_fileline): Sort include file information.
153 2018-01-16 Ian Lance Taylor <iant@golang.org>
155 * elf.c (codes) [GENERATE_FIXED_HUFFMAN_TABLE]: Fix size to be
157 (main) [GENERATE_FIXED_HUFFMAN_TABLE]: Pass 288 to
158 elf_zlib_inflate_table. Generate elf_zlib_default_dist_table.
159 (elf_zlib_default_table): Update.
160 (elf_zlib_default_dist_table): New static array.
161 (elf_zlib_inflate): Use elf_zlib_default_dist_table for dist table
163 * ztest.c (struct zlib_test): Add uncompressed_len.
164 (tests): Initialize uncompressed_len field. Add new test case.
165 (test_samples): Use uncompressed_len field.
167 2018-01-03 Jakub Jelinek <jakub@redhat.com>
169 Update copyright years.
171 2017-11-17 Igor Tsimbalist <igor.v.tsimbalist@intel.com>
173 * configure.ac: Add CET_FLAGS to EXTRA_FLAGS.
174 * aclocal.m4: Regenerate.
175 * Makefile.in: Likewise.
176 * configure: Likewise.
178 2017-10-06 Ian Lance Taylor <iant@golang.org>
180 * ztest.c (test_large): Pass unsigned long *, not size_t *, to
181 zlib uncompress function.
183 2017-10-05 Ian Lance Taylor <iant@golang.org>
185 * elf.c (elf_zlib_fetch): Change pval argument to uint64_t *.
186 Read a four byte integer.
187 (elf_zlib_inflate): Change val to uint64_t. Align pin to a 32-bit
188 boundary before ever calling elf_zlib_fetch.
189 * ztest.c (test_large): Simplify print statements a bit.
191 2017-10-02 Ian Lance Taylor <iant@golang.org>
193 * ztest.c: #include <errno.h>.
194 (TEST_TIMING): Don't define, don't test.
195 (xclock_gettime, xclockid_t): Define if !HAVE_CLOCK_GETTIME.
196 (clockid_t, clock_gettime, CLOCK_REALTIME): Likewise.
197 (ZLIB_CLOCK_GETTIME_ARG): Define.
198 * configure.ac: Change clock_gettime_link to CLOCK_GETTIME_LINK.
199 * Makefile.am: Likewise.
200 * configure, Makefile.in: Rebuild.
202 2017-10-02 Thomas Schwinge <thomas@codesourcery.com>
205 * Makefile.am: Append the content of clock_gettime_link to
207 * configure.ac: Test for the case that clock_gettime is in librt.
208 * Makefile.in: Regenerate.
209 * configure: Likewise.
212 * configure.ac: Check for clock_gettime.
213 * config.h.in: Regenerate.
214 * configure: Likewise.
215 * ztest.c (average_time, test_large): Conditionalize test timing
216 on clock_gettime availability.
218 2017-09-29 Tony Reix <tony.reix@atos.net>
220 * xcoff.c: Initial support for DWARF debug sections in XCOFF.
221 (STYP_DWARF, SSUBTYP_DW*): Define.
222 (enum dwarf_section): Define.
223 (struct dwsect_info): Define.
224 (xcoff_add): Look for DWARF sections, pass them to
227 2017-09-28 Ian Lance Taylor <iant@golang.org>
230 * elf.c (__builtin_prefetch): Define if not __GNUC__.
232 (SHF_UNCOMPRESSED, ELFCOMPRESS_ZLIB): Define.
233 (b_elf_chdr): Define type.
234 (enum debug_section): Add ZDEBUG_xxx values.
235 (debug_section_names): Add names for new sections.
236 (struct debug_section_info): Add compressed field.
237 (elf_zlib_failed, elf_zlib_fetch): New static functions.
238 (HUFFMAN_TABLE_SIZE, HUFFMAN_VALUE_MASK): Define.
239 (HUFFMAN_BITS_SHIFT, HUFFMAN_BITS_MASK): Define.
240 (HUFFMAN_SECONDARY_SHIFT): Define.
241 (ZDEBUG_TABLE_SIZE): Define.
242 (ZDEBUG_TABLE_CODELEN_OFFSET, ZDEBUG_TABLE_WORK_OFFSET): Define.
243 (final_next_secondary): New static variable if
244 BACKTRACE_GENERATE_FIXED_HUFFMAN_TABLE.
245 (elf_zlib_inflate_table): New static function.
246 (BACKTRACE_GENERATE_FIXED_HUFFMAN_TABLE): If define, define main
247 function to produce fixed Huffman table.
248 (elf_zlib_default_table): New static variable.
249 (elf_zlib_inflate): New static function.
250 (elf_zlib_verify_checksum): Likewise.
251 (elf_zlib_inflate_and_verify): Likewise.
252 (elf_uncompress_zdebug): Likewise.
253 (elf_uncompress_chdr): Likewise.
254 (backtrace_uncompress_zdebug): New extern function.
255 (elf_add): Look for .zdebug sections and SHF_COMPRESSED debug
256 sections, and uncompress them.
257 * internal.h (backtrace_compress_zdebug): Declare.
259 * configure.ac: Check for -lz and check whether the linker
260 supports --compress-debug-sections.
261 * Makefile.am (ztest_SOURCES): New variable.
262 (ztest_CFLAGS, ztest_LDADD): New variables.
263 (check_PROGRAMS): Add ztest.
264 (ctestg_SOURCES): New variable.
265 (ctestg_CFLAGS, ctestg_LDFLAGS, ctestg_LDADD): New variables.
266 (ctesta_SOURCES): New variable.
267 (ctesta_CFLAGS, ctesta_LDFLAGS, ctesta_LDADD): New variables.
268 (check_PROGRAMS): Add ctestg and ctesta.
269 * configure, config.h.in, Makefile.in: Rebuild.
271 2017-09-22 Ian Lance Taylor <iant@golang.org>
274 * configure.ac: Check for lstat and readlink.
275 * elf.c (lstat, readlink): Provide dummy versions if real versions
277 * configure, config.h.in: Rebuild.
279 2017-09-21 Ian Lance Taylor <iant@google.com>
282 * elf.c (backtrace_initialize): Set pd.exe_filename.
284 2017-09-20 Ian Lance Taylor <iant@golang.org>
285 Denis Khalikov <d.khalikov@partner.samsung.com>
288 Support for external debug info.
289 * elf.c: Include <errno.h>, <sys/stat.h>, <unistd.h>.
290 (S_ISLNK): Define if not defined.
291 (xstrnlen): Define if strnlen is not available.
292 (b_elf_note): Define type.
293 (NT_GNU_BUILD_ID): Define macro.
294 (elf_crc32, elf_crc32_file): New static functions.
295 (elf_is_symlink, elf_readlink): New static functions.
296 (elf_open_debugfile_by_buildid): New static function.
297 (elf_try_debugfile): New static function.
298 (elf_find_debugfile_by_debuglink): New static function.
299 (elf_open_debugfile_by_debuglink): New static function.
300 (elf_add): Add filename and debuginfo parameters. Adjust all
301 callers. Look for external debug info notes, and try to fetch
302 debug info from external file.
303 (struct phdr_data): Add exe_filename field.
304 (phdr_callback): Pass filename to elf_add.
305 (backtrace_initialize): Add filename parameter.
306 * internal.h (backtrace_initialize): Add filename parameter.
307 * fileline.c (fileline_initialize): Pass filename to
308 backtrace_initialize.
309 * pecoff.c (fileline_initialize): Add unused filename parameter.
310 * unknown.c (fileline_initialize): Likewise.
311 * xcoff.c (fileline_initialize): Likewise.
312 * configure.ac: Check for objcopy --add-gnu-debuglink.
313 * Makefile.am (dtest): New test target.
314 * configure, Makefile.in: Rebuild.
316 2017-09-12 Steve Ellcey <sellcey@cavium.com>
319 * Makefile.am (ttest_CFLAGS): Add $(AM_CFLAGS)
320 * Makefile.in: Regenerate.
322 2017-09-12 Steve Ellcey <sellcey@cavium.com>
325 * libbacktrace/Makefile.in
326 (HAVE_PTHREAD_TRUE@@NATIVE_TRUE@ttest_CFLAGS): Add $(AM_CFLAGS)
328 2017-08-02 David Edelsohn <dje.gcc@gmail.com>
331 * xcoff.c (xcoff_process_linenos): Initialize incl to NULL.
333 2017-07-28 Tony Reix <tony.reix@atos.net>
335 * xcoff.c: Don't leak a file descriptor if an archive is malformed.
337 2017-07-28 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
339 * fileline.c (fileline_initialize): Print pid_t as long.
341 2017-07-26 Tony Reix <tony.reix@atos.net>
343 * configure.ac: Check for XCOFF32/XCOFF64. Check for loadquery.
344 * filetype.awk: Separate AIX XCOFF32 and XCOFF64.
345 * xcoff.c: Add support for AIX XCOFF32 and XCOFF64 formats.
346 * configure, config.h.in: Regenerate.
348 2017-07-21 Tony Reix <tony.reix@atos.net>
350 * filetype.awk: Add AIX XCOFF type detection.
351 * configure.ac: Recognize xcoff format.
352 * Makefile.am (FORMAT_FILES): Add xcoff.c.
353 * fileline.c: Include <unistd.h>.
354 (fileline_initialize): Add case for AIX procfs.
356 * configure, Makefile.in: Rebuild.
358 2017-06-21 Richard Biener <rguenther@suse.de>
360 * configure.ac: Add AC_SYS_LARGEFILE.
361 * config.h.in: Regenerate.
362 * configure: Likewise.
364 2017-06-11 Ian Lance Taylor <iant@golang.org>
366 * elf.c (backtrace_initialize): Always set *fileline_fn.
368 * btest.c: Move support functions into testlib.c. Change calls to
369 check to pass file name.
370 * testlib.c: New file, copied from (part of) btest.c.
371 * testlib.h: New file, declarations for testlib.c.
372 * edtest.c: Use testlib.h and testlib.c.
373 * configure.ac: Test for -pthread, set HAVE_PTHREAD conditional.
374 * Makefile.am (btest_SOURCES): Add testlib.c.
375 (edtest_SOURCES): Likewise.
376 (CHECK_PROGRAMS): Add ttest if HAVE_PTHREAD.
377 (ttest_SOURCES, ttest_CFLAGS, ttest_LDADD): Define.
378 * configure, Makefile.in: Rebuild.
380 2017-05-19 Than McIntosh <thanm@google.com>
382 * dwarf.c (free_line_header): Don't free dirs if dirs_count == 0.
383 (read_line_header): Don't allocate dirs if dirs_count == 0.
384 * edtest.c: New file.
385 * edtest2.c: New file.
386 * Makefile.am (edtest_SOURCES, edtest_LDADD): Define.
387 (check_PROGRAMS): Add edtest.
388 (edtest2_build.c, gen_edtest2_build): New targets.
389 * Makefile.in: Rebuild.
391 2017-03-08 Sam Thursfield <sam.thursfield@codethink.co.uk>
393 * btest.c (test5): Replace #ifdef guard with 'unused' attribute
394 to fix compile warning when BACKTRACE_SUPPORTED isn't defined.
396 2017-01-01 Jakub Jelinek <jakub@redhat.com>
398 Update copyright years.
400 2016-11-15 Matthias Klose <doko@ubuntu.com>
402 * configure: Regenerate.
404 2016-09-11 Carlos Liam <carlos@aarzee.me>
406 * all: Remove meaningless trailing whitespace.
408 2016-05-18 Uros Bizjak <ubizjak@gmail.com>
411 * elf.c (phdr_callback) [__i386__]: Add
412 __attribute__((__force_align_arg_pointer__)).
414 2016-03-02 Maxim Ostapenko <m.ostapenko@partner.samsung.com>
416 * elf.c (backtrace_initialize): Properly initialize elf_fileline_fn to
417 avoid possible crash.
418 (elf_add): Don't set *fileline_fn to elf_nodebug value in case of
419 missing debug info anymore.
421 2016-02-06 John David Anglin <danglin@gcc.gnu.org>
423 * mmap.c (MAP_FAILED): Define if not defined.
425 2016-01-04 Jakub Jelinek <jakub@redhat.com>
427 Update copyright years.
429 2015-12-18 Andris Pavenis <andris.pavenis@iki.fi>
431 * configure.ac: Specify that DJGPP do not have mmap
432 even when sys/mman.h exists.
433 * configure: Regenerate
435 2015-12-09 John David Anglin <danglin@gcc.gnu.org>
438 * configure.ac: Set libbacktrace_cv_sys_sync to no on hppa*-*-hpux*.
439 * configure: Regenerate.
440 * elf.c (backtrace_initialize): Cast __sync_bool_compare_and_swap call
443 2015-09-17 Ian Lance Taylor <iant@google.com>
445 * posix.c (backtrace_open): Cast second argument of open() to int.
447 2015-09-11 Ian Lance Taylor <iant@google.com>
449 * Makefile.am (backtrace.lo): Depend on internal.h.
450 (sort.lo, stest.lo): Add explicit dependencies.
451 * Makefile.in: Rebuild.
453 2015-09-09 Hans-Peter Nilsson <hp@axis.com>
455 * backtrace.c: #include <sys/types.h>.
457 2015-09-08 Ian Lance Taylor <iant@google.com>
460 * backtrace.c: #include "internal.h".
461 (struct backtrace_data): Add can_alloc field.
462 (unwind): If can_alloc is false, don't try to get file/line
464 (backtrace_full): Set can_alloc field in bdata.
465 * alloc.c (backtrace_alloc): Don't call error_callback if it is
467 * mmap.c (backtrace_alloc): Likewise.
468 * internal.h: Update comments for backtrace_alloc and
471 2015-09-08 Ian Lance Taylor <iant@google.com>
474 * mmap.c (backtrace_alloc): Correct test for mmap failure.
476 2015-08-31 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
478 * configure.ac: For spu-*-* targets, set have_fcntl to no.
479 * configure: Regenerate.
481 2015-08-27 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
483 * configure.ac: Remove [disable-shared] argument to LT_INIT.
484 Remove setting PIC_FLAG when building as target library.
485 * configure: Regenerate.
487 2015-08-26 Hans-Peter Nilsson <hp@axis.com>
489 * configure.ac: Only compile with -fPIC if the target
491 * configure: Regenerate.
493 2015-08-24 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
495 * configure.ac: Set have_mmap to no on spu-*-* targets.
496 * configure: Regenerate.
498 2015-08-13 Ian Lance Taylor <iant@google.com>
500 * dwarf.c (read_function_entry): Add vec_inlined parameter.
503 2015-06-11 Martin Sebor <msebor@redhat.com>
506 * dwarf.c (struct line): Add new field idx.
507 (line_compare): Use it.
509 (read_line_info): Reset it.
511 2015-05-29 Tristan Gingold <gingold@adacore.com>
513 * pecoff.c: New file.
514 * Makefile.am (FORMAT_FILES): Add pecoff.c and dependencies.
515 * Makefile.in: Regenerate.
516 * filetype.awk: Detect pecoff.
517 * configure.ac: Define BACKTRACE_SUPPORTS_DATA on elf platforms.
519 * btest.c (test5): Test enabled only if BACKTRACE_SUPPORTS_DATA is
521 * backtrace-supported.h.in (BACKTRACE_SUPPORTS_DATA): Define.
522 * configure: Regenerate.
523 * pecoff.c: New file.
525 2015-05-13 Michael Haubenwallner <michael.haubenwallner@ssi-schaefer.com>
527 * Makefile.in: Regenerated with automake-1.11.6.
528 * aclocal.m4: Likewise.
529 * configure: Likewise.
531 2015-01-24 Matthias Klose <doko@ubuntu.com>
533 * configure.ac: Move AM_ENABLE_MULTILIB before AC_PROG_CC.
534 * configure: Regenerate.
536 2015-01-05 Jakub Jelinek <jakub@redhat.com>
538 Update copyright years.
540 2014-11-21 H.J. Lu <hongjiu.lu@intel.com>
543 * configure: Regenerated.
545 2014-11-11 David Malcolm <dmalcolm@redhat.com>
547 * ChangeLog.jit: New.
549 2014-11-11 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
552 * configure: Regenerate.
554 2014-10-23 Ian Lance Taylor <iant@google.com>
556 * internal.h (backtrace_atomic_load_pointer) [no atomic or sync]:
557 Fix to return void *.
559 2014-05-08 Ian Lance Taylor <iant@google.com>
561 * mmap.c (backtrace_free): If freeing a large aligned block of
562 memory, call munmap rather than holding onto it.
563 (backtrace_vector_grow): When growing a vector, double the number
564 of pages requested. When releasing the old version of a grown
565 vector, pass the correct size to backtrace_free.
567 2014-03-07 Ian Lance Taylor <iant@google.com>
569 * sort.c (backtrace_qsort): Use middle element as pivot.
571 2014-03-06 Ian Lance Taylor <iant@google.com>
575 * internal.h (backtrace_qsort): Declare.
576 * dwarf.c (read_abbrevs): Call backtrace_qsort instead of qsort.
577 (read_line_info, read_function_entry): Likewise.
578 (read_function_info, build_dwarf_data): Likewise.
579 * elf.c (elf_initialize_syminfo): Likewise.
580 * Makefile.am (libbacktrace_la_SOURCES): Add sort.c.
581 (stest_SOURCES, stest_LDADD): Define.
582 (check_PROGRAMS): Add stest.
584 2014-02-07 Misty De Meo <misty@brew.sh>
587 * configure.ac: Use AC_LINK_IFELSE in check for
589 * configure: Regenerate.
591 2014-01-02 Richard Sandiford <rdsandiford@googlemail.com>
593 Update copyright years
595 2013-12-06 Jakub Jelinek <jakub@redhat.com>
597 * elf.c (ET_DYN): Undefine and define again.
598 (elf_add): Add exe argument, if true and ehdr.e_type is ET_DYN,
599 return early -1 without closing the descriptor.
600 (struct phdr_data): Add exe_descriptor.
601 (phdr_callback): If pd->exe_descriptor is not -1, for very first
602 call if dlpi_name is NULL just call elf_add with the exe_descriptor,
603 otherwise backtrace_close the exe_descriptor if not -1. Adjust
605 (backtrace_initialize): Adjust call to elf_add. If it returns
606 -1, set pd.exe_descriptor to descriptor, otherwise set it to -1.
608 2013-12-05 Ian Lance Taylor <iant@google.com>
610 * alloc.c (backtrace_vector_finish): Add error_callback and data
611 parameters. Call backtrace_vector_release. Return address base.
612 * mmap.c (backtrace_vector_finish): Add error_callback and data
613 parameters. Return address base.
614 * dwarf.c (read_function_info): Get new address base from
615 backtrace_vector_finish.
616 * internal.h (backtrace_vector_finish): Update declaration.
618 2013-11-27 Ian Lance Taylor <iant@google.com>
620 * dwarf.c (find_address_ranges): New static function, broken out
621 of build_address_map.
622 (build_address_map): Call it.
623 * btest.c (check): Check for missing filename or function, rather
625 (f3): Check that enough frames were returned.
627 2013-11-19 Jakub Jelinek <jakub@redhat.com>
629 * backtrace.h (backtrace_syminfo_callback): Add symsize argument.
630 * elf.c (elf_syminfo): Pass 0 or sym->size to the callback as
632 * btest.c (struct symdata): Add size field.
633 (callback_three): Add symsize argument. Copy it to the data->size
635 (f23): Set symdata.size to 0.
636 (test5): Likewise. If sizeof (int) > 1, lookup address of
637 ((uintptr_t) &global) + 1. Verify symdata.val and symdata.size
640 * atomic.c: Include sys/types.h.
642 2013-11-18 Ian Lance Taylor <iant@google.com>
644 * configure.ac: Check for support of __atomic extensions.
645 * internal.h: Declare or #define atomic functions for use in
647 * atomic.c: New file.
648 * dwarf.c (dwarf_lookup_pc): Use atomic functions.
649 (dwarf_fileline, backtrace_dwarf_add): Likewise.
650 * elf.c (elf_add_syminfo_data, elf_syminfo): Likewise.
651 (backtrace_initialize): Likewise.
652 * fileline.c (fileline_initialize): Likewise.
653 * Makefile.am (libbacktrace_la_SOURCES): Add atomic.c.
654 * configure, config.h.in, Makefile.in: Rebuild.
656 2013-11-18 Jakub Jelinek <jakub@redhat.com>
658 * elf.c (SHN_UNDEF): Define.
659 (elf_initialize_syminfo): Add base_address argument. Ignore symbols
660 with st_shndx == SHN_UNDEF. Add base_address to address fields.
661 (elf_add): Adjust caller.
663 * elf.c (phdr_callback): Process info->dlpi_addr == 0 normally.
665 2013-11-16 Ian Lance Taylor <iant@google.com>
667 * backtrace.h (backtrace_create_state): Correct comment about
670 2013-11-15 Ian Lance Taylor <iant@google.com>
672 * backtrace.h (backtrace_syminfo): Update comment and parameter
673 name to take any address, not just a PC value.
674 * elf.c (STT_OBJECT): Define.
675 (elf_nosyms): Rename parameter pc to addr.
676 (elf_symbol_search): Rename local variable pc to addr.
677 (elf_initialize_syminfo): Add STT_OBJECT symbols to elf_symbols.
678 (elf_syminfo): Rename parameter pc to addr.
679 * btest.c (global): New global variable.
683 2013-10-17 Ian Lance Taylor <iant@google.com>
685 * elf.c (elf_add): Don't get the wrong offsets if a debug section
688 2013-10-15 David Malcolm <dmalcolm@redhat.com>
690 * configure.ac: Add --enable-host-shared, setting up
691 pre-existing PIC_FLAG variable within Makefile.am et al.
692 * configure: Regenerate.
694 2013-09-20 Alan Modra <amodra@gmail.com>
696 * configure: Regenerate.
698 2013-07-23 Alexander Monakov <amonakov@ispras.ru>
700 * elf.c (elf_syminfo): Loop over the elf_syminfo_data chain.
702 2013-07-23 Alexander Monakov <amonakov@ispras.ru>
704 * elf.c (backtrace_initialize): Pass elf_fileline_fn to
705 dl_iterate_phdr callbacks.
707 2013-03-25 Ian Lance Taylor <iant@google.com>
709 * alloc.c: #include <sys/types.h>.
712 2013-01-31 Ian Lance Taylor <iant@google.com>
714 * dwarf.c (read_function_info): Permit fvec parameter to be NULL.
715 (dwarf_lookup_pc): Don't use ddata->fvec if threaded.
717 2013-01-25 Jakub Jelinek <jakub@redhat.com>
720 * dwarf.c (read_line_header): Don't crash if DW_AT_comp_dir
721 attribute was not seen.
723 2013-01-16 Ian Lance Taylor <iant@google.com>
725 * dwarf.c (struct unit): Add filename and abs_filename fields.
726 (build_address_map): Set new fields when reading unit.
727 (dwarf_lookup_pc): If we don't find an entry in the line table,
728 just return the main file name.
730 2013-01-14 Richard Sandiford <rdsandiford@googlemail.com>
732 Update copyright years.
734 2013-01-01 Ian Lance Taylor <iant@google.com>
737 * Makefile.am (AM_CPPFLAGS): Remove -I ../gcc/include and -I
738 $(MULTIBUILDTOP)/../../gcc/include.
739 * Makefile.in: Rebuild.
741 2013-01-01 Ian Lance Taylor <iant@google.com>
744 * mmap.c (backtrace_alloc): Don't call sync functions if not
746 (backtrace_free): Likewise.
748 2012-12-12 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
750 * mmapio.c: Define MAP_FAILED if not defined.
752 2012-12-11 Jakub Jelinek <jakub@redhat.com>
755 * Makefile.am (AM_CFLAGS): Remove -frandom-seed=$@.
756 * configure.ac: If --with-target-subdir, add -frandom-seed=$@
757 to EXTRA_FLAGS unconditionally, otherwise check whether the compiler
759 * Makefile.in: Regenerated.
760 * configure: Regenerated.
762 2012-12-07 Jakub Jelinek <jakub@redhat.com>
765 * Makefile.am (AM_CFLAGS): Add -frandom-seed=$@.
766 * Makefile.in: Regenerated.
768 2012-11-20 Ian Lance Taylor <iant@google.com>
770 * dwarf.c (read_attribute): Always clear val.
772 2012-11-13 Ian Lance Taylor <iant@google.com>
775 * configure.ac: Only add -Werror if building a target library.
776 * configure: Rebuild.
778 2012-11-12 Ian Lance Taylor <iant@google.com>
779 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
780 Gerald Pfeifer <gerald@pfeifer.com>
782 * configure.ac: Check for getexecname.
783 * fileline.c: #include <errno.h>. Define getexecname if not
785 (fileline_initialize): Try to find the executable in a few
787 * print.c (error_callback): Only print the filename if it came
788 from the backtrace state.
789 * configure, config.h.in: Rebuild.
791 2012-10-29 Ian Lance Taylor <iant@google.com>
793 * mmap.c (backtrace_vector_release): Correct last patch: add
796 2012-10-29 Ian Lance Taylor <iant@google.com>
798 * mmap.c (backtrace_vector_release): Make sure freed block is
799 aligned on 8-byte boundary.
801 2012-10-26 Ian Lance Taylor <iant@google.com>
804 * posix.c (backtrace_open): Add does_not_exist parameter.
805 * elf.c (phdr_callback): Do not warn if shared library could not
807 * fileline.c (fileline_initialize): Update calls to
809 * internal.h (backtrace_open): Update declaration.
811 2012-10-26 Jack Howarth <howarth@bromo.med.uc.edu>
814 * configure.ac: Check for _Unwind_GetIPInfo function declaration.
815 * configure: Regenerate.
817 2012-10-24 Ian Lance Taylor <iant@google.com>
820 * configure.ac: Check whether -funwind-tables option works.
821 * configure: Rebuild.
823 2012-10-11 Ian Lance Taylor <iant@google.com>
825 * configure.ac: Do not use dl_iterate_phdr on Solaris 10.
826 * configure: Rebuild.
828 2012-10-10 Ian Lance Taylor <iant@google.com>
830 * elf.c: Rename all Elf typedefs to start with b_elf, and be all
833 2012-10-10 Hans-Peter Nilsson <hp@bitrange.com>
835 * elf.c (elf_add_syminfo_data): Add casts to avoid warning.
837 2012-10-09 Ian Lance Taylor <iant@google.com>
839 * dwarf.c (dwarf_fileline): Add cast to avoid warning.
840 (backtrace_dwarf_add): Likewise.
842 2012-10-09 Ian Lance Taylor <iant@google.com>
844 Add support for tracing through shared libraries.
845 * configure.ac: Check for link.h and dl_iterate_phdr.
846 * elf.c: #include <link.h> if system has dl_iterate_phdr. #undef
847 ELF macros before #defining them.
848 (dl_phdr_info, dl_iterate_phdr): Define if system does not have
850 (struct elf_syminfo_data): Add next field.
851 (elf_initialize_syminfo): Initialize next field.
852 (elf_add_syminfo_data): New static function.
853 (elf_add): New static function, broken out of
854 backtrace_initialize. Call backtrace_dwarf_add instead of
855 backtrace_dwarf_initialize.
856 (struct phdr_data): Define.
857 (phdr_callback): New static function.
858 (backtrace_initialize): Call elf_add.
859 * dwarf.c (struct dwarf_data): Add next and base_address fields.
860 (add_unit_addr): Add base_address parameter. Change all callers.
861 (add_unit_ranges, build_address_map): Likewise.
862 (add_line): Add ddata parameter. Change all callers.
863 (read_line_program, add_function_range): Likewise.
864 (dwarf_lookup_pc): New static function, broken out of
866 (dwarf_fileline): Call dwarf_lookup_pc.
867 (build_dwarf_data): New static function.
868 (backtrace_dwarf_add): New function.
869 (backtrace_dwarf_initialize): Remove.
870 * internal.h (backtrace_dwarf_initialize): Don't declare.
871 (backtrace_dwarf_add): Declare.
872 * configure, config.h.in: Rebuild.
874 2012-10-04 Gerald Pfeifer <gerald@pfeifer.com>
876 * btest.c (f23): Avoid uninitialized variable warning.
878 2012-10-04 Ian Lance Taylor <iant@google.com>
880 * dwarf.c: If the system header files do not declare strnlen,
881 provide our own version.
883 2012-10-03 Ian Lance Taylor <iant@google.com>
885 * dwarf.c (read_uleb128): Fix overflow test.
886 (read_sleb128): Likewise.
887 (build_address_map): Don't change unit_buf.start.
889 2012-10-02 Uros Bizjak <ubizjak@gmail.com>
892 * configure.ac (EXTRA_FLAGS): New.
893 * Makefile.am (AM_FLAGS): Add $(EXTRA_FLAGS).
894 * configure, Makefile.in: Regenerate.
896 2012-09-29 Ian Lance Taylor <iant@google.com>
899 * fileline.c (fileline_initialize): Pass errnum as -1 when
900 reporting that we could not read executable information after a
903 2012-09-27 Ian Lance Taylor <iant@google.com>
906 * configure.ac: Add no-dependencies to AM_INIT_AUTOMAKE.
907 * Makefile.am: Add dependencies for all objects.
908 * configure, aclocal.m4, Makefile.in: Rebuild.
910 2012-09-27 Ian Lance Taylor <iant@google.com>
913 * elf.c (backtrace_initialize): Set *fileln_fn, not
916 2012-09-19 Ian Lance Taylor <iant@google.com>
918 * configure.ac: Only use GCC_CHECK_UNWIND_GETIPINFO when compiled
920 * configure: Rebuild.
922 2012-09-19 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
923 Ian Lance Taylor <iant@google.com>
925 * configure.ac (GCC_HEADER_STDINT): Invoke.
926 * backtrace.h: If we can't find <stdint.h>, use "gstdint.h".
927 * btest.c: Don't include <stdint.h>.
929 * configure, aclocal.m4, Makefile.in, config.h.in: Rebuild.
931 2012-09-18 Ian Lance Taylor <iant@google.com>
934 * Makefile.am (AM_CPPFLAGS): Define.
935 (AM_CFLAGS): Remove -I options.
936 * Makefile.in: Rebuild.
938 2012-09-18 Ian Lance Taylor <iant@google.com>
940 * posix.c (O_BINARY): Define if not defined.
941 (backtrace_open): Pass O_BINARY to open. Only call fcntl if
942 HAVE_FCNTL is defined.
943 * configure.ac: Test for the fcntl function.
944 * configure, config.h.in: Rebuild.
946 2012-09-18 Ian Lance Taylor <iant@google.com>
948 * btest.c (test1, test2, test3, test4): Add the unused attribute.
950 2012-09-18 Ian Lance Taylor <iant@google.com>
952 * dwarf.c: Correct test of HAVE_DECL_STRNLEN.
954 2012-09-18 Ian Lance Taylor <iant@google.com>
956 * configure.ac: Add AC_USE_SYSTEM_EXTENSIONS.
957 * mmapio.c: Don't define _GNU_SOURCE.
958 * configure, config.h.in: Rebuild.
960 2012-09-18 Ian Lance Taylor <iant@google.com>
962 * configure.ac: Check whether strnlen is declared.
963 * dwarf.c: Declare strnlen if not declared.
964 * configure, config.h.in: Rebuild.
966 2012-09-18 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
968 * fileline.c: Include <stdlib.h>.
971 2012-09-17 Ian Lance Taylor <iant@google.com>
974 * nounwind.c (backtrace_full): Rename from backtrace. Add state
977 2012-09-17 Gerald Pfeifer <gerald@pfeifer.com>
980 * nounwind.c (backtrace_simple): Add state parameter.
982 2012-09-17 Ian Lance Taylor <iant@google.com>
985 * unknown.c (unknown_fileline): Add state parameter, remove
986 fileline_data parameter, name error_callback parameter.
987 (backtrace_initialize): Add state parameter.
989 2012-09-17 Ian Lance Taylor <iant@google.com>
991 * Initial implementation.
993 Copyright (C) 2012-2018 Free Software Foundation, Inc.
995 Copying and distribution of this file, with or without modification,
996 are permitted in any medium without royalty provided the copyright
997 notice and this notice are preserved.