Commit Graph

11 Commits

Author SHA1 Message Date
Ian Lance Taylor
8c05bcb94f libbacktrace: update copyright years 2024-07-11 18:14:01 -07:00
Ian Lance Taylor
3fda5a8759 libbacktrace: correctly gather Mach-O symbol table
For PR libbacktrace/97082.
	* macho.c (MACH_O_N_EXT): Don't define.
	(MACH_O_N_UNDF): Define.
	(macho_defined_symbol): Don't discard N_EXT symbols.  Do
	discard N_UNDF symbols.
2024-07-11 17:57:40 -07:00
Ian Lance Taylor
e3e64ddd18 libbacktrace: suggest how to fix missing debug info
* elf.c (elf_nodebug): Suggest -g.
	* macho.c (macho_nodebug): Suggest -g and dsymutil.
	* pecoff.c (coff_nodebug): Suggest -g.

Fixes #122
2024-07-11 15:42:10 -07:00
Ian Lance Taylor
f69acdfbd6 libbacktrace: remove trailing whitespace
* dwarf.c: Remove trailing whitespace.
	* macho.c: Likewise.

Fixes #124
2024-07-11 15:30:09 -07:00
Ian Lance Taylor
7409767403 libbacktrace: don't exit Mach-O dyld library loop on one failure
* macho.c (backtrace_initialize) [HAVE_MACH_O_DYLD_H]: Don't exit
	loop if we can't find debug info for one shared library.

For #85
2022-07-07 16:55:51 -07:00
Jakub Jelinek
5496ee0a1a Update copyright years. 2021-01-18 14:56:19 -08:00
Iain Sandoe
753968c2e8 libbacktrace, Mach-O : Support PowerPC archs.
This adds the PPC architecture variants for Mach-O libbacktrace.

With this (as for X86 and Arm) when dsymutil is run on the binary
we get a basic usable backtrace.

Testsuite results on powerpc-apple-darwin9 are the same as for X86:
 * btest fails (TBC why)
 * dwarf5 tests fail because dsymutil does not handle that so far.

libbacktrace/ChangeLog:

	* macho.c (MACH_O_CPU_TYPE_PPC): New.
	(MACH_O_CPU_TYPE_PPC64): New.
	Add compile-tests for powerpc to the Mach-O variants.

Close #55
2020-09-27 17:29:21 -07:00
Ian Lance Taylor
030bd0a709 libbacktrace: correct memory lengths in Mach-O dsym support
* macho.c (macho_add_dsym): Make space for '/' in dsym.  Use
	correct length when freeing diralc.

Close #40
2020-09-27 17:16:15 -07:00
Ian Lance Taylor
b3b57f9ee0 libbacktrace: correctly swap Mach-O 32-bit file offset
libbacktrace/ChangeLog:
	PR libbacktrace/96973
	* macho.c (macho_add_fat): Correctly swap 32-bit file offset.
2020-09-27 17:15:03 -07:00
Ian Lance Taylor
89b2b5066b libbacktrace: add Mach-O 64-bit FAT support
libbacktrace/:
	* macho.c (MACH_O_MH_MAGIC_FAT_64): Define.
	(MACH_O_MH_CIGAM_FAT_64): Define.
	(struct macho_fat_arch_64): Define.
	(macho_add_fat): Add and use is_64 parameter.
	(macho_add): Recognize 64-bit fat files.
2020-09-27 17:13:21 -07:00
Ian Lance Taylor
4e548e735f libbacktrace: add preliminary Mach-O support 2020-02-18 18:57:14 -08:00