1 2018-12-29 Gerald Pfeifer <gerald@pfeifer.com>
3 * Makefile.am (xcoff_%.c): Use an actual newline instead of \n
5 * Makefile.in: Regenerate.
7 2018-12-28 Tom de Vries <tdevries@suse.de>
9 * dwarf.c (build_address_map): Reuse unused units.
11 2018-12-28 Tom de Vries <tdevries@suse.de>
13 * dwarf.c (build_address_map): Simplify by removing local variable
16 2018-12-28 Ian Lance Taylor <iant@golang.org>
17 Tom de Vries <tdevries@suse.de>
20 * dwarf.c (free_unit_addrs_vector): Remove.
21 (build_address_map): Keep track of allocated units in vector. Free
22 allocated units and corresponding abbrevs upon failure. Remove now
23 redundant call to free_unit_addrs_vector. Free addrs vector upon
24 failure. Free allocated unit vector.
26 2018-12-28 Tom de Vries <tdevries@suse.de>
28 * dwarf.c (build_address_map): Free addrs vector upon failure.
30 2018-12-14 Tom de Vries <tdevries@suse.de>
33 * allocfail.sh: Remove "set -o pipefail".
35 2018-12-12 Tom de Vries <tdevries@suse.de>
37 * Makefile.am (TESTS): Add allocfail.sh.
38 (check_PROGRAMS): Add allocfail.
39 * Makefile.in: Regenerate.
40 * instrumented_alloc.c: New file. Redefine malloc and realloc.
42 * allocfail.c: New file.
43 * allocfail.sh: New file.
45 2018-11-30 Tom de Vries <tdevries@suse.de>
47 * Makefile.am (check_PROGRAMS): Add test_elf, test_xcoff_32,
48 test_xcoff_64, test_pecoff and test_unknown.
49 * Makefile.in: Regenerate.
50 * test_format.c: New file.
52 2018-11-30 Tom de Vries <tdevries@suse.de>
54 * Makefile.am : Add _with_alloc version for each test in
56 * Makefile.in: Regenerate.
58 2018-11-30 Tom de Vries <tdevries@suse.de>
60 * internal.h (backtrace_vector_free): New static inline fuction,
62 * dwarf.c (read_line_info): ... here.
64 2018-11-28 Tom de Vries <tdevries@suse.de>
66 * dwarf.c (read_abbrevs): Fix handling of abbrevs->abbrevs allocation
69 2018-11-27 Tom de Vries <tdevries@suse.de>
71 * mmap.c (backtrace_vector_release): Same.
72 * unittest.c (test1): Add check.
74 2018-11-27 Tom de Vries <tdevries@suse.de>
76 * alloc.c (backtrace_vector_release): Handle vec->size == 0 using free
78 * Makefile.am (check_PROGRAMS): Add unittest.
79 * Makefile.in: Regenerate.
80 * unittest.c: New file.
82 2018-11-22 Tom de Vries <tdevries@suse.de>
84 * dwarf.c (read_initial_length): Factor out of ...
85 (build_address_map, read_line_info): ... here.
87 2018-11-21 Tom de Vries <tdevries@suse.de>
89 * dwarf.c (read_string): Factor out of ...
90 (read_attribute, read_line_header, read_line_program): ... here.
92 2018-10-31 Joseph Myers <joseph@codesourcery.com>
95 * Makefile.am: Include multilib.am.
96 * configure.ac: Remove AC_PREREQ. Use AC_LANG_SOURCE.
97 * Makefile.in, aclocal.m4, config.h.in, configure: Regenerate.
99 2018-10-05 Ian Lance Taylor <iant@golang.org>
101 PR libbacktrace/87529
102 * backtrace.h: Document that backtrace_create_state should be
105 2018-08-05 Iain Buclaw <ibuclaw@gdcproject.org>
107 * configure.ac: Move define of HAVE_ZLIB into check for -lz.
108 * Makefile.in: Regenerate.
109 * config.h.in: Likewise.
110 * configure: Likewise.
112 2018-08-01 Tony Reix <tony.reix@atos.net>
114 * xcoff.c (struct xcoff_line, struct xcoff_line_vector): Remove.
115 (struct xcoff_func, struct xcoff_func_vector): New structs.
116 (xcoff_syminfo): Drop leading dot from symbol name.
117 (xcoff_line_compare, xcoff_line_search): Remove.
118 (xcoff_func_compare, xcoff_func_search): New static functions.
119 (xcoff_lookup_pc): Search function table.
120 (xcoff_add_line, xcoff_process_linenos): Remove.
121 (xcoff_initialize_fileline): Build function table.
123 2018-06-21 Denis Khalikov <d.khalikov@partner.samsung.com>
126 * elf.c (elf_add): Increase ".note.gnu.build-id" section size
127 checking up to 36 bytes.
129 2018-04-24 H.J. Lu <hongjiu.lu@intel.com>
131 * configure: Regenerated.
133 2018-04-19 Jakub Jelinek <jakub@redhat.com>
135 * configure: Regenerated.
137 2018-04-17 Ian Lance Taylor <iant@golang.org>
139 * backtrace.c: Revert last two changes. Don't call mmap
142 2018-04-17 Ian Lance Taylor <iant@golang.org>
144 * backtrace.c: Include backtrace-supported.h before checking
145 BACKTRACE_USES_MALLOC.
147 2018-04-17 Ian Lance Taylor <iant@golang.org>
149 * backtrace.c (backtrace_full): When testing whether we can
150 allocate memory, call mmap directly, and munmap the memory.
152 2018-04-04 Jakub Jelinek <jakub@redhat.com>
155 * elf.c (elf_zlib_fetch): Fix up predefined macro names in test for
156 big endian, only use 32-bit loads if endianity macros are predefined
157 and indicate big or little endian.
159 2018-02-14 Igor Tsimbalist <igor.v.tsimbalist@intel.com>
162 * configure: Regenerate.
164 2018-02-15 Jakub Jelinek <jakub@redhat.com>
167 * elf.c (SHT_PROGBITS): Undefine and define.
169 2018-02-14 Jakub Jelinek <jakub@redhat.com>
172 * elf.c (EM_PPC64, EF_PPC64_ABI): Undefine and define.
173 (struct elf_ppc64_opd_data): New type.
174 (elf_initialize_syminfo): Add opd argument, handle symbols
175 pointing into the PowerPC64 ELFv1 .opd section.
176 (elf_add): Read .opd section on PowerPC64 ELFv1, pass pointer
177 to structure with .opd data to elf_initialize_syminfo.
179 2018-01-31 Ian Lance Taylor <iant@golang.org>
181 * elf.c (elf_add): Close descriptor if we use a debugfile.
182 * btest.c (check_open_files): New static function.
183 (main): Call check_open_files.
185 2018-01-25 Ian Lance Taylor <iant@golang.org>
187 * elf.c (elf_open_debugfile_by_debuglink): Don't check CRC if the
189 (elf_add): Don't clear *found_sym and *found_dwarf if debuginfo.
191 2018-01-25 Ian Lance Taylor <iant@golang.org>
193 * pecoff.c (coff_add): Only release syms_view if it is valid.
195 2018-01-25 Ian Lance Taylor <iant@golang.org>
197 * pecoff.c (coff_add): Another memcpy -> coff_read4 fix.
199 2018-01-24 Ian Lance Taylor <iant@golang.org>
201 * pecoff.c (coff_add): Use coff_read4, not memcpy.
203 2018-01-24 Ian Lance Taylor <iant@golang.org>
206 * mmap.c (backtrace_free_locked): Don't put more than 16 entries
209 2018-01-19 Tony Reix <tony.reix@atos.net>
211 * xcoff.c (xcoff_incl_compare): New function.
212 (xcoff_incl_search): New function.
213 (xcoff_process_linenos): Use bsearch to find include file.
214 (xcoff_initialize_fileline): Sort include file information.
216 2018-01-16 Ian Lance Taylor <iant@golang.org>
218 * elf.c (codes) [GENERATE_FIXED_HUFFMAN_TABLE]: Fix size to be
220 (main) [GENERATE_FIXED_HUFFMAN_TABLE]: Pass 288 to
221 elf_zlib_inflate_table. Generate elf_zlib_default_dist_table.
222 (elf_zlib_default_table): Update.
223 (elf_zlib_default_dist_table): New static array.
224 (elf_zlib_inflate): Use elf_zlib_default_dist_table for dist table
226 * ztest.c (struct zlib_test): Add uncompressed_len.
227 (tests): Initialize uncompressed_len field. Add new test case.
228 (test_samples): Use uncompressed_len field.
230 2018-01-03 Jakub Jelinek <jakub@redhat.com>
232 Update copyright years.
234 2017-11-17 Igor Tsimbalist <igor.v.tsimbalist@intel.com>
236 * configure.ac: Add CET_FLAGS to EXTRA_FLAGS.
237 * aclocal.m4: Regenerate.
238 * Makefile.in: Likewise.
239 * configure: Likewise.
241 2017-10-06 Ian Lance Taylor <iant@golang.org>
243 * ztest.c (test_large): Pass unsigned long *, not size_t *, to
244 zlib uncompress function.
246 2017-10-05 Ian Lance Taylor <iant@golang.org>
248 * elf.c (elf_zlib_fetch): Change pval argument to uint64_t *.
249 Read a four byte integer.
250 (elf_zlib_inflate): Change val to uint64_t. Align pin to a 32-bit
251 boundary before ever calling elf_zlib_fetch.
252 * ztest.c (test_large): Simplify print statements a bit.
254 2017-10-02 Ian Lance Taylor <iant@golang.org>
256 * ztest.c: #include <errno.h>.
257 (TEST_TIMING): Don't define, don't test.
258 (xclock_gettime, xclockid_t): Define if !HAVE_CLOCK_GETTIME.
259 (clockid_t, clock_gettime, CLOCK_REALTIME): Likewise.
260 (ZLIB_CLOCK_GETTIME_ARG): Define.
261 * configure.ac: Change clock_gettime_link to CLOCK_GETTIME_LINK.
262 * Makefile.am: Likewise.
263 * configure, Makefile.in: Rebuild.
265 2017-10-02 Thomas Schwinge <thomas@codesourcery.com>
268 * Makefile.am: Append the content of clock_gettime_link to
270 * configure.ac: Test for the case that clock_gettime is in librt.
271 * Makefile.in: Regenerate.
272 * configure: Likewise.
275 * configure.ac: Check for clock_gettime.
276 * config.h.in: Regenerate.
277 * configure: Likewise.
278 * ztest.c (average_time, test_large): Conditionalize test timing
279 on clock_gettime availability.
281 2017-09-29 Tony Reix <tony.reix@atos.net>
283 * xcoff.c: Initial support for DWARF debug sections in XCOFF.
284 (STYP_DWARF, SSUBTYP_DW*): Define.
285 (enum dwarf_section): Define.
286 (struct dwsect_info): Define.
287 (xcoff_add): Look for DWARF sections, pass them to
290 2017-09-28 Ian Lance Taylor <iant@golang.org>
293 * elf.c (__builtin_prefetch): Define if not __GNUC__.
295 (SHF_UNCOMPRESSED, ELFCOMPRESS_ZLIB): Define.
296 (b_elf_chdr): Define type.
297 (enum debug_section): Add ZDEBUG_xxx values.
298 (debug_section_names): Add names for new sections.
299 (struct debug_section_info): Add compressed field.
300 (elf_zlib_failed, elf_zlib_fetch): New static functions.
301 (HUFFMAN_TABLE_SIZE, HUFFMAN_VALUE_MASK): Define.
302 (HUFFMAN_BITS_SHIFT, HUFFMAN_BITS_MASK): Define.
303 (HUFFMAN_SECONDARY_SHIFT): Define.
304 (ZDEBUG_TABLE_SIZE): Define.
305 (ZDEBUG_TABLE_CODELEN_OFFSET, ZDEBUG_TABLE_WORK_OFFSET): Define.
306 (final_next_secondary): New static variable if
307 BACKTRACE_GENERATE_FIXED_HUFFMAN_TABLE.
308 (elf_zlib_inflate_table): New static function.
309 (BACKTRACE_GENERATE_FIXED_HUFFMAN_TABLE): If define, define main
310 function to produce fixed Huffman table.
311 (elf_zlib_default_table): New static variable.
312 (elf_zlib_inflate): New static function.
313 (elf_zlib_verify_checksum): Likewise.
314 (elf_zlib_inflate_and_verify): Likewise.
315 (elf_uncompress_zdebug): Likewise.
316 (elf_uncompress_chdr): Likewise.
317 (backtrace_uncompress_zdebug): New extern function.
318 (elf_add): Look for .zdebug sections and SHF_COMPRESSED debug
319 sections, and uncompress them.
320 * internal.h (backtrace_compress_zdebug): Declare.
322 * configure.ac: Check for -lz and check whether the linker
323 supports --compress-debug-sections.
324 * Makefile.am (ztest_SOURCES): New variable.
325 (ztest_CFLAGS, ztest_LDADD): New variables.
326 (check_PROGRAMS): Add ztest.
327 (ctestg_SOURCES): New variable.
328 (ctestg_CFLAGS, ctestg_LDFLAGS, ctestg_LDADD): New variables.
329 (ctesta_SOURCES): New variable.
330 (ctesta_CFLAGS, ctesta_LDFLAGS, ctesta_LDADD): New variables.
331 (check_PROGRAMS): Add ctestg and ctesta.
332 * configure, config.h.in, Makefile.in: Rebuild.
334 2017-09-22 Ian Lance Taylor <iant@golang.org>
337 * configure.ac: Check for lstat and readlink.
338 * elf.c (lstat, readlink): Provide dummy versions if real versions
340 * configure, config.h.in: Rebuild.
342 2017-09-21 Ian Lance Taylor <iant@google.com>
345 * elf.c (backtrace_initialize): Set pd.exe_filename.
347 2017-09-20 Ian Lance Taylor <iant@golang.org>
348 Denis Khalikov <d.khalikov@partner.samsung.com>
351 Support for external debug info.
352 * elf.c: Include <errno.h>, <sys/stat.h>, <unistd.h>.
353 (S_ISLNK): Define if not defined.
354 (xstrnlen): Define if strnlen is not available.
355 (b_elf_note): Define type.
356 (NT_GNU_BUILD_ID): Define macro.
357 (elf_crc32, elf_crc32_file): New static functions.
358 (elf_is_symlink, elf_readlink): New static functions.
359 (elf_open_debugfile_by_buildid): New static function.
360 (elf_try_debugfile): New static function.
361 (elf_find_debugfile_by_debuglink): New static function.
362 (elf_open_debugfile_by_debuglink): New static function.
363 (elf_add): Add filename and debuginfo parameters. Adjust all
364 callers. Look for external debug info notes, and try to fetch
365 debug info from external file.
366 (struct phdr_data): Add exe_filename field.
367 (phdr_callback): Pass filename to elf_add.
368 (backtrace_initialize): Add filename parameter.
369 * internal.h (backtrace_initialize): Add filename parameter.
370 * fileline.c (fileline_initialize): Pass filename to
371 backtrace_initialize.
372 * pecoff.c (fileline_initialize): Add unused filename parameter.
373 * unknown.c (fileline_initialize): Likewise.
374 * xcoff.c (fileline_initialize): Likewise.
375 * configure.ac: Check for objcopy --add-gnu-debuglink.
376 * Makefile.am (dtest): New test target.
377 * configure, Makefile.in: Rebuild.
379 2017-09-12 Steve Ellcey <sellcey@cavium.com>
382 * Makefile.am (ttest_CFLAGS): Add $(AM_CFLAGS)
383 * Makefile.in: Regenerate.
385 2017-09-12 Steve Ellcey <sellcey@cavium.com>
388 * libbacktrace/Makefile.in
389 (HAVE_PTHREAD_TRUE@@NATIVE_TRUE@ttest_CFLAGS): Add $(AM_CFLAGS)
391 2017-08-02 David Edelsohn <dje.gcc@gmail.com>
394 * xcoff.c (xcoff_process_linenos): Initialize incl to NULL.
396 2017-07-28 Tony Reix <tony.reix@atos.net>
398 * xcoff.c: Don't leak a file descriptor if an archive is malformed.
400 2017-07-28 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
402 * fileline.c (fileline_initialize): Print pid_t as long.
404 2017-07-26 Tony Reix <tony.reix@atos.net>
406 * configure.ac: Check for XCOFF32/XCOFF64. Check for loadquery.
407 * filetype.awk: Separate AIX XCOFF32 and XCOFF64.
408 * xcoff.c: Add support for AIX XCOFF32 and XCOFF64 formats.
409 * configure, config.h.in: Regenerate.
411 2017-07-21 Tony Reix <tony.reix@atos.net>
413 * filetype.awk: Add AIX XCOFF type detection.
414 * configure.ac: Recognize xcoff format.
415 * Makefile.am (FORMAT_FILES): Add xcoff.c.
416 * fileline.c: Include <unistd.h>.
417 (fileline_initialize): Add case for AIX procfs.
419 * configure, Makefile.in: Rebuild.
421 2017-06-21 Richard Biener <rguenther@suse.de>
423 * configure.ac: Add AC_SYS_LARGEFILE.
424 * config.h.in: Regenerate.
425 * configure: Likewise.
427 2017-06-11 Ian Lance Taylor <iant@golang.org>
429 * elf.c (backtrace_initialize): Always set *fileline_fn.
431 * btest.c: Move support functions into testlib.c. Change calls to
432 check to pass file name.
433 * testlib.c: New file, copied from (part of) btest.c.
434 * testlib.h: New file, declarations for testlib.c.
435 * edtest.c: Use testlib.h and testlib.c.
436 * configure.ac: Test for -pthread, set HAVE_PTHREAD conditional.
437 * Makefile.am (btest_SOURCES): Add testlib.c.
438 (edtest_SOURCES): Likewise.
439 (CHECK_PROGRAMS): Add ttest if HAVE_PTHREAD.
440 (ttest_SOURCES, ttest_CFLAGS, ttest_LDADD): Define.
441 * configure, Makefile.in: Rebuild.
443 2017-05-19 Than McIntosh <thanm@google.com>
445 * dwarf.c (free_line_header): Don't free dirs if dirs_count == 0.
446 (read_line_header): Don't allocate dirs if dirs_count == 0.
447 * edtest.c: New file.
448 * edtest2.c: New file.
449 * Makefile.am (edtest_SOURCES, edtest_LDADD): Define.
450 (check_PROGRAMS): Add edtest.
451 (edtest2_build.c, gen_edtest2_build): New targets.
452 * Makefile.in: Rebuild.
454 2017-03-08 Sam Thursfield <sam.thursfield@codethink.co.uk>
456 * btest.c (test5): Replace #ifdef guard with 'unused' attribute
457 to fix compile warning when BACKTRACE_SUPPORTED isn't defined.
459 2017-01-01 Jakub Jelinek <jakub@redhat.com>
461 Update copyright years.
463 2016-11-15 Matthias Klose <doko@ubuntu.com>
465 * configure: Regenerate.
467 2016-09-11 Carlos Liam <carlos@aarzee.me>
469 * all: Remove meaningless trailing whitespace.
471 2016-05-18 Uros Bizjak <ubizjak@gmail.com>
474 * elf.c (phdr_callback) [__i386__]: Add
475 __attribute__((__force_align_arg_pointer__)).
477 2016-03-02 Maxim Ostapenko <m.ostapenko@partner.samsung.com>
479 * elf.c (backtrace_initialize): Properly initialize elf_fileline_fn to
480 avoid possible crash.
481 (elf_add): Don't set *fileline_fn to elf_nodebug value in case of
482 missing debug info anymore.
484 2016-02-06 John David Anglin <danglin@gcc.gnu.org>
486 * mmap.c (MAP_FAILED): Define if not defined.
488 2016-01-04 Jakub Jelinek <jakub@redhat.com>
490 Update copyright years.
492 2015-12-18 Andris Pavenis <andris.pavenis@iki.fi>
494 * configure.ac: Specify that DJGPP do not have mmap
495 even when sys/mman.h exists.
496 * configure: Regenerate
498 2015-12-09 John David Anglin <danglin@gcc.gnu.org>
501 * configure.ac: Set libbacktrace_cv_sys_sync to no on hppa*-*-hpux*.
502 * configure: Regenerate.
503 * elf.c (backtrace_initialize): Cast __sync_bool_compare_and_swap call
506 2015-09-17 Ian Lance Taylor <iant@google.com>
508 * posix.c (backtrace_open): Cast second argument of open() to int.
510 2015-09-11 Ian Lance Taylor <iant@google.com>
512 * Makefile.am (backtrace.lo): Depend on internal.h.
513 (sort.lo, stest.lo): Add explicit dependencies.
514 * Makefile.in: Rebuild.
516 2015-09-09 Hans-Peter Nilsson <hp@axis.com>
518 * backtrace.c: #include <sys/types.h>.
520 2015-09-08 Ian Lance Taylor <iant@google.com>
523 * backtrace.c: #include "internal.h".
524 (struct backtrace_data): Add can_alloc field.
525 (unwind): If can_alloc is false, don't try to get file/line
527 (backtrace_full): Set can_alloc field in bdata.
528 * alloc.c (backtrace_alloc): Don't call error_callback if it is
530 * mmap.c (backtrace_alloc): Likewise.
531 * internal.h: Update comments for backtrace_alloc and
534 2015-09-08 Ian Lance Taylor <iant@google.com>
537 * mmap.c (backtrace_alloc): Correct test for mmap failure.
539 2015-08-31 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
541 * configure.ac: For spu-*-* targets, set have_fcntl to no.
542 * configure: Regenerate.
544 2015-08-27 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
546 * configure.ac: Remove [disable-shared] argument to LT_INIT.
547 Remove setting PIC_FLAG when building as target library.
548 * configure: Regenerate.
550 2015-08-26 Hans-Peter Nilsson <hp@axis.com>
552 * configure.ac: Only compile with -fPIC if the target
554 * configure: Regenerate.
556 2015-08-24 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
558 * configure.ac: Set have_mmap to no on spu-*-* targets.
559 * configure: Regenerate.
561 2015-08-13 Ian Lance Taylor <iant@google.com>
563 * dwarf.c (read_function_entry): Add vec_inlined parameter.
566 2015-06-11 Martin Sebor <msebor@redhat.com>
569 * dwarf.c (struct line): Add new field idx.
570 (line_compare): Use it.
572 (read_line_info): Reset it.
574 2015-05-29 Tristan Gingold <gingold@adacore.com>
576 * pecoff.c: New file.
577 * Makefile.am (FORMAT_FILES): Add pecoff.c and dependencies.
578 * Makefile.in: Regenerate.
579 * filetype.awk: Detect pecoff.
580 * configure.ac: Define BACKTRACE_SUPPORTS_DATA on elf platforms.
582 * btest.c (test5): Test enabled only if BACKTRACE_SUPPORTS_DATA is
584 * backtrace-supported.h.in (BACKTRACE_SUPPORTS_DATA): Define.
585 * configure: Regenerate.
586 * pecoff.c: New file.
588 2015-05-13 Michael Haubenwallner <michael.haubenwallner@ssi-schaefer.com>
590 * Makefile.in: Regenerated with automake-1.11.6.
591 * aclocal.m4: Likewise.
592 * configure: Likewise.
594 2015-01-24 Matthias Klose <doko@ubuntu.com>
596 * configure.ac: Move AM_ENABLE_MULTILIB before AC_PROG_CC.
597 * configure: Regenerate.
599 2015-01-05 Jakub Jelinek <jakub@redhat.com>
601 Update copyright years.
603 2014-11-21 H.J. Lu <hongjiu.lu@intel.com>
606 * configure: Regenerated.
608 2014-11-11 David Malcolm <dmalcolm@redhat.com>
610 * ChangeLog.jit: New.
612 2014-11-11 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
615 * configure: Regenerate.
617 2014-10-23 Ian Lance Taylor <iant@google.com>
619 * internal.h (backtrace_atomic_load_pointer) [no atomic or sync]:
620 Fix to return void *.
622 2014-05-08 Ian Lance Taylor <iant@google.com>
624 * mmap.c (backtrace_free): If freeing a large aligned block of
625 memory, call munmap rather than holding onto it.
626 (backtrace_vector_grow): When growing a vector, double the number
627 of pages requested. When releasing the old version of a grown
628 vector, pass the correct size to backtrace_free.
630 2014-03-07 Ian Lance Taylor <iant@google.com>
632 * sort.c (backtrace_qsort): Use middle element as pivot.
634 2014-03-06 Ian Lance Taylor <iant@google.com>
638 * internal.h (backtrace_qsort): Declare.
639 * dwarf.c (read_abbrevs): Call backtrace_qsort instead of qsort.
640 (read_line_info, read_function_entry): Likewise.
641 (read_function_info, build_dwarf_data): Likewise.
642 * elf.c (elf_initialize_syminfo): Likewise.
643 * Makefile.am (libbacktrace_la_SOURCES): Add sort.c.
644 (stest_SOURCES, stest_LDADD): Define.
645 (check_PROGRAMS): Add stest.
647 2014-02-07 Misty De Meo <misty@brew.sh>
650 * configure.ac: Use AC_LINK_IFELSE in check for
652 * configure: Regenerate.
654 2014-01-02 Richard Sandiford <rdsandiford@googlemail.com>
656 Update copyright years
658 2013-12-06 Jakub Jelinek <jakub@redhat.com>
660 * elf.c (ET_DYN): Undefine and define again.
661 (elf_add): Add exe argument, if true and ehdr.e_type is ET_DYN,
662 return early -1 without closing the descriptor.
663 (struct phdr_data): Add exe_descriptor.
664 (phdr_callback): If pd->exe_descriptor is not -1, for very first
665 call if dlpi_name is NULL just call elf_add with the exe_descriptor,
666 otherwise backtrace_close the exe_descriptor if not -1. Adjust
668 (backtrace_initialize): Adjust call to elf_add. If it returns
669 -1, set pd.exe_descriptor to descriptor, otherwise set it to -1.
671 2013-12-05 Ian Lance Taylor <iant@google.com>
673 * alloc.c (backtrace_vector_finish): Add error_callback and data
674 parameters. Call backtrace_vector_release. Return address base.
675 * mmap.c (backtrace_vector_finish): Add error_callback and data
676 parameters. Return address base.
677 * dwarf.c (read_function_info): Get new address base from
678 backtrace_vector_finish.
679 * internal.h (backtrace_vector_finish): Update declaration.
681 2013-11-27 Ian Lance Taylor <iant@google.com>
683 * dwarf.c (find_address_ranges): New static function, broken out
684 of build_address_map.
685 (build_address_map): Call it.
686 * btest.c (check): Check for missing filename or function, rather
688 (f3): Check that enough frames were returned.
690 2013-11-19 Jakub Jelinek <jakub@redhat.com>
692 * backtrace.h (backtrace_syminfo_callback): Add symsize argument.
693 * elf.c (elf_syminfo): Pass 0 or sym->size to the callback as
695 * btest.c (struct symdata): Add size field.
696 (callback_three): Add symsize argument. Copy it to the data->size
698 (f23): Set symdata.size to 0.
699 (test5): Likewise. If sizeof (int) > 1, lookup address of
700 ((uintptr_t) &global) + 1. Verify symdata.val and symdata.size
703 * atomic.c: Include sys/types.h.
705 2013-11-18 Ian Lance Taylor <iant@google.com>
707 * configure.ac: Check for support of __atomic extensions.
708 * internal.h: Declare or #define atomic functions for use in
710 * atomic.c: New file.
711 * dwarf.c (dwarf_lookup_pc): Use atomic functions.
712 (dwarf_fileline, backtrace_dwarf_add): Likewise.
713 * elf.c (elf_add_syminfo_data, elf_syminfo): Likewise.
714 (backtrace_initialize): Likewise.
715 * fileline.c (fileline_initialize): Likewise.
716 * Makefile.am (libbacktrace_la_SOURCES): Add atomic.c.
717 * configure, config.h.in, Makefile.in: Rebuild.
719 2013-11-18 Jakub Jelinek <jakub@redhat.com>
721 * elf.c (SHN_UNDEF): Define.
722 (elf_initialize_syminfo): Add base_address argument. Ignore symbols
723 with st_shndx == SHN_UNDEF. Add base_address to address fields.
724 (elf_add): Adjust caller.
726 * elf.c (phdr_callback): Process info->dlpi_addr == 0 normally.
728 2013-11-16 Ian Lance Taylor <iant@google.com>
730 * backtrace.h (backtrace_create_state): Correct comment about
733 2013-11-15 Ian Lance Taylor <iant@google.com>
735 * backtrace.h (backtrace_syminfo): Update comment and parameter
736 name to take any address, not just a PC value.
737 * elf.c (STT_OBJECT): Define.
738 (elf_nosyms): Rename parameter pc to addr.
739 (elf_symbol_search): Rename local variable pc to addr.
740 (elf_initialize_syminfo): Add STT_OBJECT symbols to elf_symbols.
741 (elf_syminfo): Rename parameter pc to addr.
742 * btest.c (global): New global variable.
746 2013-10-17 Ian Lance Taylor <iant@google.com>
748 * elf.c (elf_add): Don't get the wrong offsets if a debug section
751 2013-10-15 David Malcolm <dmalcolm@redhat.com>
753 * configure.ac: Add --enable-host-shared, setting up
754 pre-existing PIC_FLAG variable within Makefile.am et al.
755 * configure: Regenerate.
757 2013-09-20 Alan Modra <amodra@gmail.com>
759 * configure: Regenerate.
761 2013-07-23 Alexander Monakov <amonakov@ispras.ru>
763 * elf.c (elf_syminfo): Loop over the elf_syminfo_data chain.
765 2013-07-23 Alexander Monakov <amonakov@ispras.ru>
767 * elf.c (backtrace_initialize): Pass elf_fileline_fn to
768 dl_iterate_phdr callbacks.
770 2013-03-25 Ian Lance Taylor <iant@google.com>
772 * alloc.c: #include <sys/types.h>.
775 2013-01-31 Ian Lance Taylor <iant@google.com>
777 * dwarf.c (read_function_info): Permit fvec parameter to be NULL.
778 (dwarf_lookup_pc): Don't use ddata->fvec if threaded.
780 2013-01-25 Jakub Jelinek <jakub@redhat.com>
783 * dwarf.c (read_line_header): Don't crash if DW_AT_comp_dir
784 attribute was not seen.
786 2013-01-16 Ian Lance Taylor <iant@google.com>
788 * dwarf.c (struct unit): Add filename and abs_filename fields.
789 (build_address_map): Set new fields when reading unit.
790 (dwarf_lookup_pc): If we don't find an entry in the line table,
791 just return the main file name.
793 2013-01-14 Richard Sandiford <rdsandiford@googlemail.com>
795 Update copyright years.
797 2013-01-01 Ian Lance Taylor <iant@google.com>
800 * Makefile.am (AM_CPPFLAGS): Remove -I ../gcc/include and -I
801 $(MULTIBUILDTOP)/../../gcc/include.
802 * Makefile.in: Rebuild.
804 2013-01-01 Ian Lance Taylor <iant@google.com>
807 * mmap.c (backtrace_alloc): Don't call sync functions if not
809 (backtrace_free): Likewise.
811 2012-12-12 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
813 * mmapio.c: Define MAP_FAILED if not defined.
815 2012-12-11 Jakub Jelinek <jakub@redhat.com>
818 * Makefile.am (AM_CFLAGS): Remove -frandom-seed=$@.
819 * configure.ac: If --with-target-subdir, add -frandom-seed=$@
820 to EXTRA_FLAGS unconditionally, otherwise check whether the compiler
822 * Makefile.in: Regenerated.
823 * configure: Regenerated.
825 2012-12-07 Jakub Jelinek <jakub@redhat.com>
828 * Makefile.am (AM_CFLAGS): Add -frandom-seed=$@.
829 * Makefile.in: Regenerated.
831 2012-11-20 Ian Lance Taylor <iant@google.com>
833 * dwarf.c (read_attribute): Always clear val.
835 2012-11-13 Ian Lance Taylor <iant@google.com>
838 * configure.ac: Only add -Werror if building a target library.
839 * configure: Rebuild.
841 2012-11-12 Ian Lance Taylor <iant@google.com>
842 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
843 Gerald Pfeifer <gerald@pfeifer.com>
845 * configure.ac: Check for getexecname.
846 * fileline.c: #include <errno.h>. Define getexecname if not
848 (fileline_initialize): Try to find the executable in a few
850 * print.c (error_callback): Only print the filename if it came
851 from the backtrace state.
852 * configure, config.h.in: Rebuild.
854 2012-10-29 Ian Lance Taylor <iant@google.com>
856 * mmap.c (backtrace_vector_release): Correct last patch: add
859 2012-10-29 Ian Lance Taylor <iant@google.com>
861 * mmap.c (backtrace_vector_release): Make sure freed block is
862 aligned on 8-byte boundary.
864 2012-10-26 Ian Lance Taylor <iant@google.com>
867 * posix.c (backtrace_open): Add does_not_exist parameter.
868 * elf.c (phdr_callback): Do not warn if shared library could not
870 * fileline.c (fileline_initialize): Update calls to
872 * internal.h (backtrace_open): Update declaration.
874 2012-10-26 Jack Howarth <howarth@bromo.med.uc.edu>
877 * configure.ac: Check for _Unwind_GetIPInfo function declaration.
878 * configure: Regenerate.
880 2012-10-24 Ian Lance Taylor <iant@google.com>
883 * configure.ac: Check whether -funwind-tables option works.
884 * configure: Rebuild.
886 2012-10-11 Ian Lance Taylor <iant@google.com>
888 * configure.ac: Do not use dl_iterate_phdr on Solaris 10.
889 * configure: Rebuild.
891 2012-10-10 Ian Lance Taylor <iant@google.com>
893 * elf.c: Rename all Elf typedefs to start with b_elf, and be all
896 2012-10-10 Hans-Peter Nilsson <hp@bitrange.com>
898 * elf.c (elf_add_syminfo_data): Add casts to avoid warning.
900 2012-10-09 Ian Lance Taylor <iant@google.com>
902 * dwarf.c (dwarf_fileline): Add cast to avoid warning.
903 (backtrace_dwarf_add): Likewise.
905 2012-10-09 Ian Lance Taylor <iant@google.com>
907 Add support for tracing through shared libraries.
908 * configure.ac: Check for link.h and dl_iterate_phdr.
909 * elf.c: #include <link.h> if system has dl_iterate_phdr. #undef
910 ELF macros before #defining them.
911 (dl_phdr_info, dl_iterate_phdr): Define if system does not have
913 (struct elf_syminfo_data): Add next field.
914 (elf_initialize_syminfo): Initialize next field.
915 (elf_add_syminfo_data): New static function.
916 (elf_add): New static function, broken out of
917 backtrace_initialize. Call backtrace_dwarf_add instead of
918 backtrace_dwarf_initialize.
919 (struct phdr_data): Define.
920 (phdr_callback): New static function.
921 (backtrace_initialize): Call elf_add.
922 * dwarf.c (struct dwarf_data): Add next and base_address fields.
923 (add_unit_addr): Add base_address parameter. Change all callers.
924 (add_unit_ranges, build_address_map): Likewise.
925 (add_line): Add ddata parameter. Change all callers.
926 (read_line_program, add_function_range): Likewise.
927 (dwarf_lookup_pc): New static function, broken out of
929 (dwarf_fileline): Call dwarf_lookup_pc.
930 (build_dwarf_data): New static function.
931 (backtrace_dwarf_add): New function.
932 (backtrace_dwarf_initialize): Remove.
933 * internal.h (backtrace_dwarf_initialize): Don't declare.
934 (backtrace_dwarf_add): Declare.
935 * configure, config.h.in: Rebuild.
937 2012-10-04 Gerald Pfeifer <gerald@pfeifer.com>
939 * btest.c (f23): Avoid uninitialized variable warning.
941 2012-10-04 Ian Lance Taylor <iant@google.com>
943 * dwarf.c: If the system header files do not declare strnlen,
944 provide our own version.
946 2012-10-03 Ian Lance Taylor <iant@google.com>
948 * dwarf.c (read_uleb128): Fix overflow test.
949 (read_sleb128): Likewise.
950 (build_address_map): Don't change unit_buf.start.
952 2012-10-02 Uros Bizjak <ubizjak@gmail.com>
955 * configure.ac (EXTRA_FLAGS): New.
956 * Makefile.am (AM_FLAGS): Add $(EXTRA_FLAGS).
957 * configure, Makefile.in: Regenerate.
959 2012-09-29 Ian Lance Taylor <iant@google.com>
962 * fileline.c (fileline_initialize): Pass errnum as -1 when
963 reporting that we could not read executable information after a
966 2012-09-27 Ian Lance Taylor <iant@google.com>
969 * configure.ac: Add no-dependencies to AM_INIT_AUTOMAKE.
970 * Makefile.am: Add dependencies for all objects.
971 * configure, aclocal.m4, Makefile.in: Rebuild.
973 2012-09-27 Ian Lance Taylor <iant@google.com>
976 * elf.c (backtrace_initialize): Set *fileln_fn, not
979 2012-09-19 Ian Lance Taylor <iant@google.com>
981 * configure.ac: Only use GCC_CHECK_UNWIND_GETIPINFO when compiled
983 * configure: Rebuild.
985 2012-09-19 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
986 Ian Lance Taylor <iant@google.com>
988 * configure.ac (GCC_HEADER_STDINT): Invoke.
989 * backtrace.h: If we can't find <stdint.h>, use "gstdint.h".
990 * btest.c: Don't include <stdint.h>.
992 * configure, aclocal.m4, Makefile.in, config.h.in: Rebuild.
994 2012-09-18 Ian Lance Taylor <iant@google.com>
997 * Makefile.am (AM_CPPFLAGS): Define.
998 (AM_CFLAGS): Remove -I options.
999 * Makefile.in: Rebuild.
1001 2012-09-18 Ian Lance Taylor <iant@google.com>
1003 * posix.c (O_BINARY): Define if not defined.
1004 (backtrace_open): Pass O_BINARY to open. Only call fcntl if
1005 HAVE_FCNTL is defined.
1006 * configure.ac: Test for the fcntl function.
1007 * configure, config.h.in: Rebuild.
1009 2012-09-18 Ian Lance Taylor <iant@google.com>
1011 * btest.c (test1, test2, test3, test4): Add the unused attribute.
1013 2012-09-18 Ian Lance Taylor <iant@google.com>
1015 * dwarf.c: Correct test of HAVE_DECL_STRNLEN.
1017 2012-09-18 Ian Lance Taylor <iant@google.com>
1019 * configure.ac: Add AC_USE_SYSTEM_EXTENSIONS.
1020 * mmapio.c: Don't define _GNU_SOURCE.
1021 * configure, config.h.in: Rebuild.
1023 2012-09-18 Ian Lance Taylor <iant@google.com>
1025 * configure.ac: Check whether strnlen is declared.
1026 * dwarf.c: Declare strnlen if not declared.
1027 * configure, config.h.in: Rebuild.
1029 2012-09-18 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
1031 * fileline.c: Include <stdlib.h>.
1034 2012-09-17 Ian Lance Taylor <iant@google.com>
1037 * nounwind.c (backtrace_full): Rename from backtrace. Add state
1040 2012-09-17 Gerald Pfeifer <gerald@pfeifer.com>
1043 * nounwind.c (backtrace_simple): Add state parameter.
1045 2012-09-17 Ian Lance Taylor <iant@google.com>
1048 * unknown.c (unknown_fileline): Add state parameter, remove
1049 fileline_data parameter, name error_callback parameter.
1050 (backtrace_initialize): Add state parameter.
1052 2012-09-17 Ian Lance Taylor <iant@google.com>
1054 * Initial implementation.
1056 Copyright (C) 2012-2018 Free Software Foundation, Inc.
1058 Copying and distribution of this file, with or without modification,
1059 are permitted in any medium without royalty provided the copyright
1060 notice and this notice are preserved.