mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
Fix C level backtrace info on macOS clang 16
macOS clang 16 generates DWARF5, which have Mach-O section names that are limited to 16 characters, which causes sections with long names to be truncated and not match above. See: https://wiki.dwarfstd.org/Best_Practices.md#Mach-2d-O
This commit is contained in:
parent
3354324c6e
commit
0af2eafc59
Notes:
git
2024-11-27 17:12:52 +00:00
1 changed files with 11 additions and 1 deletions
12
addr2line.c
12
addr2line.c
|
@ -2426,7 +2426,17 @@ found_mach_header:
|
||||||
for (int j=0; j < DWARF_SECTION_COUNT; j++) {
|
for (int j=0; j < DWARF_SECTION_COUNT; j++) {
|
||||||
struct dwarf_section *s = obj_dwarf_section_at(obj, j);
|
struct dwarf_section *s = obj_dwarf_section_at(obj, j);
|
||||||
|
|
||||||
if (strcmp(sect->sectname, debug_section_names[j]) != 0)
|
if (strcmp(sect->sectname, debug_section_names[j]) != 0
|
||||||
|
#ifdef __APPLE__
|
||||||
|
/* macOS clang 16 generates DWARF5, which have Mach-O
|
||||||
|
* section names that are limited to 16 characters,
|
||||||
|
* which causes sections with long names to be truncated
|
||||||
|
* and not match above.
|
||||||
|
* See: https://wiki.dwarfstd.org/Best_Practices.md#Mach-2d-O
|
||||||
|
*/
|
||||||
|
&& strncmp(sect->sectname, debug_section_names[j], 16) != 0
|
||||||
|
#endif
|
||||||
|
)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
s->ptr = file + sect->offset;
|
s->ptr = file + sect->offset;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue