Summary: | Regression - "Core file format not supported" | ||
---|---|---|---|
Product: | gdb | Reporter: | Finn Thain <fthain> |
Component: | corefiles | Assignee: | Not yet assigned to anyone <unassigned> |
Status: | NEW --- | ||
Severity: | normal | CC: | tromey |
Priority: | P2 | ||
Version: | HEAD | ||
Target Milestone: | --- | ||
Host: | m68k-linux-gnu | Target: | m68k-linux-gnu |
Build: | m68k-linux-gnu | Last reconfirmed: | 2023-03-25 00:00:00 |
Attachments: | Sample core dump |
Description
Finn Thain
2023-03-25 02:31:17 UTC
This is probably a regression due to this patch: commit 3eba3a011a89c75c10bd1860eee4589e65697165 Author: Tom Tromey <tromey@adacore.com> Date: Mon Sep 14 08:30:10 2020 -0600 Various m68k fixes for gdb When I debug gdb I see it decides this core file is GDB_OSABI_SVR4, not GDB_OSABI_LINUX. This happens because m68k_osabi_sniffer takes this branch: if (elfosabi == ELFOSABI_NONE) return GDB_OSABI_SVR4; From elf/common.h: #define ELFOSABI_NONE 0 /* UNIX System V ABI */ #define ELFOSABI_HPUX 1 /* HP-UX operating system */ #define ELFOSABI_NETBSD 2 /* NetBSD */ #define ELFOSABI_GNU 3 /* GNU */ #define ELFOSABI_LINUX 3 /* Alias for ELFOSABI_GNU */ So I guess one question is why this core file isn't marked as ELFOSABI_LINUX. I think using "--target=m68k-linux-gnu" sets gdb_osabi=GDB_OSABI_LINUX (in configure.tgt) and so that explains why this worked before the osabi sniffer was added. I wonder if the m68k sniffer could use generic_elf_osabi_sniff_abi_tag_sections to detect that this is a Linux core file. I do see: prentzel. objdump -x /tmp/core.0 |grep linux 1 .note.linuxcore.siginfo/1845559296 00000080 00000000 00000000 00000388 2**2 2 .note.linuxcore.siginfo 00000080 00000000 00000000 00000388 2**2 4 .note.linuxcore.file/1845559296 00000192 00000000 00000000 000004b8 2**2 5 .note.linuxcore.file 00000192 00000000 00000000 000004b8 2**2 > generic_elf_osabi_sniff_abi_tag_sections
Nope, that didn't work, that function looks for specific notes.
Still, for BSD it does:
if (strcmp (name, ".note.netbsdcore.procinfo") == 0)
i.e., just checking the section name. So maybe this could be
done for the above as well. I just wonder if it's really ok.
Here is a workaround for this issue. (gdb) set osabi GNU/Linux (gdb) core core.0 [New LWP 366] Core was generated by `/bin/sh /etc/init.d/mountkernfs.sh reload'. Program terminated with signal SIGABRT, Aborted. #0 0xc00a7034 in ?? () (gdb) |