Commit Graph
13 Commits
Author SHA1 Message Date
Ian Lance Taylor 3bd5a08e4f libbacktrace: use BACKTRACE_MOREDATA_VERSION rather than 3
Patch from Andi Kleen.

	* pecoff.c (coff_syminfo): Use BACKTRACE_MOREDATA_VERSION.
	* xcoff.c (xcoff_syminfo): Likewise.
	(xcoff_lookup_pc): Likewise.
	(xcoff_fileline): Likewise.
	* unknown.c (unknown_fileline): Likewise.
2026-09-01 15:11:24 -07:00
Ian Lance Taylor 6f8310e238 libbacktrace: support returning discriminator field
Based on patch from Andi Kleen.

	* backtrace.h (backtrace_create_state): Rewrite comment to change
	threaded parameter to flags.
	(backtrace_full_callback, backtrace_syminfo_callback): Document
	behavior change if moredata flag is set.
	(struct backtrace_moredata): Define.
	* backtrace-supported.h.in (BACKTRACE_SUPPORTS_MOREDATA): Define.
	* internal.h (struct backtrace_state): Add moredata field.
	(BACKTRACE_MOREDATA_VERSION): Define.
	* state.c (backtrace_create_state): Change threaded parameter to
	flags.  Set state moredata field based on flags.
	* dwarf.c (struct line): Add disc field.
	(struct function): Add caller_disc field.
	(call_callback): New static function.
	(add_line): Add disc parameter.  Change all callers.  Store disc
	in new line value.
	(read_line_program): Track discriminator value.
	(read_line_info): Initialize disc field in final line entry.
	(read_function_entry): Handle DW_AT_GNU_discriminator.
	(report_inlined_functions): Add disc parameter. Change all
	callers. Call call_callback rather than calling callback
	directly.
	(dwarf_lookup_pc): Handle inlined discriminators. Call
	call_callback rather than calling callback directly.
	(dwarf_fileline): Call call_callback rather than calling callback
	directly.
	* elf.c (elf_syminfo): Pass moredata if requested.
	* macho.c (macho_syminfo): Likewise.
	* pecoff.c (coff_syminfo): Likewise.
	* xcoff.c (xcoff_syminfo): Likewise.
	(xcoff_lookup_pc): Likewise.
	* backtrace.c: #include <string.h>.
	(unwind): Pass moredata if requested.
	* unknown.c: #include <string.h>.
	(unknown_fileline): Pass moredata if requested.
	* fileline.c (backtrace_syminfo_to_full_callback): Add comment
	about moredata.
	* mdtest.c: New test file.
	* Makefile.am (mdtest_SOURCES): Define.
	(mdtest_CFLAGS, mdtest_LDFLAGS, mdtest_LDADD): Define.
	(BUILDTESTS): Add mdtest.
	* Makefile.in: Regenerate.
2026-07-06 12:42:21 -07:00
Jakub Jelinek 42962d2cfb Update copyright years. 2026-05-03 18:21:13 -07:00
Jakub Jelinek bdd324c192 Update copyright years. 2026-05-03 18:20:27 -07:00
Ian Lance Taylor 86885d1404 libbacktrace: update xcoff.c for base_address changes
* xcoff.c (struct xcoff_fileline_data): Change base_address field
	to struct libbacktrace_base_address.
	(xcoff_initialize_syminfo): Change base_address to struct
	libbacktrace_base_address.  Use libbacktrace_add_base.
	(xcoff_initialize_fileline): Likewise.
	(xcoff_lookup_pc): Use libbacktrace_add_base.
	(xcoff_add): Change base_address to struct
	libbacktrace_base_address.
	(xcoff_armem_add, xcoff_add_shared_libs): Likewise.
	(backtrace_initialize): Likewise.
	* Makefile.am (xcoff.lo): Remove unused target.
	(xcoff_32.lo, xcoff_64.lo): New targets.
	* Makefile.in: Regenerate.
2024-08-05 16:54:56 -07:00
Ian Lance Taylor 6ce91a2ef7 libbacktrace: avoid -Wpointer-arith errors
Based on patch from Kirill Müller.

	* configure.ac (ACX_PROG_CC_WARNING_OPTS): Add -Wpointer-arith.
	* pecoff.c (coff_add): Cast void pointers.
	* xcoff.c (xcoff_add): Likewise.
	* configure: Regenerate.
2024-08-05 16:49:57 -07:00
Ian Lance Taylor 1023a09511 libbacktrace: improve XCOFF support
libbacktrace/ChangeLog:
2021-06-28  Clément Chigot  <clement.chigot@atos.net>

	* xcoff.c (SSUBTYP_DWRNGES): New define.
	(xcoff_add): Use correct XCOFF DWARF section subtype
	for DEBUG_RANGES. Remove lineoff workaround.
	Adjust base_address.
	(xcoff_initialize_syminfo): Adapt to new base_address.
	(xcoff_lookup_pc): Likewise.
	(xcoff_initialize_fileline): Likewise.
2024-07-11 18:44:19 -07:00
Ian Lance Taylor 8c05bcb94f libbacktrace: update copyright years 2024-07-11 18:14:01 -07:00
Jakub Jelinek 5496ee0a1a Update copyright years. 2021-01-18 14:56:19 -08:00
Ian Lance Taylor bd02146d90 Update copyright years. 2020-02-18 18:46:13 -08:00
Ian Lance Taylor 559ab7cab4 libbacktrace: update to current version from GCC trunk
This adds DWARF 5 support as well as an enhanced testsuite.

Patch assembled by Than McIntosh.
2019-12-23 18:55:51 -08:00
Ian Lance Taylor 012b950b37 Copy changes from GCC:
2018-04-17  Ian Lance Taylor  <iant@golang.org>

	* backtrace.c (backtrace_full): When testing whether we can
	allocate memory, call mmap directly, and munmap the memory.

2018-04-04  Jakub Jelinek  <jakub@redhat.com>

	PR other/85161
	* elf.c (elf_zlib_fetch): Fix up predefined macro names in test for
	big endian, only use 32-bit loads if endianity macros are predefined
	and indicate big or little endian.

2018-02-15  Jakub Jelinek  <jakub@redhat.com>

	PR other/82368
	* elf.c (SHT_PROGBITS): Undefine and define.

2018-02-14  Jakub Jelinek  <jakub@redhat.com>

	PR other/82368
	* elf.c (EM_PPC64, EF_PPC64_ABI): Undefine and define.
	(struct elf_ppc64_opd_data): New type.
	(elf_initialize_syminfo): Add opd argument, handle symbols
	pointing into the PowerPC64 ELFv1 .opd section.
	(elf_add): Read .opd section on PowerPC64 ELFv1, pass pointer
	to structure with .opd data to elf_initialize_syminfo.

2018-01-19  Tony Reix  <tony.reix@atos.net>

	* xcoff.c (xcoff_incl_compare): New function.
	(xcoff_incl_search): New function.
	(xcoff_process_linenos): Use bsearch to find include file.
	(xcoff_initialize_fileline): Sort include file information.

Fixes #13
2018-04-17 07:04:02 -07:00
Than McIntosh 17f687d2b9 Update from gcc trunk version of libbacktrace at svn rev 256427. (#8)
Includes (among other things) support for compressed debug sections,
a variety of bugfixes, and expanded test coverage.
2018-01-12 10:26:02 -08:00