[RFC] Setting the architecture from a core file
Mark Kettenis
kettenis@chello.nl
Fri Oct 24 15:28:00 GMT 2003
My pending changes for core file support based on register sets
require[1] that we will be able to detect the OS/ABI variant from the
core file. Currently we fail to do this for most, if not all, NetBSD
ELF targets. It's possible to detect a NetBSD ELF core file by
looking whether certian NetBSD-specific notes are present. I can do
all the work from gdb/osabi.c:generic_elf_osabi_sniff_tag_sections,
but there is also the possibility to add a pseudosection in
bfd/elf.c:elfcore_grok_netbsd_procinfo(). I'm leaning towards the
latter since it avoids duplicating code and it fits better in the way
how things are done in general in BFD and GDB. But perhaps people
have a different opinion?
Mark
[1] We might relax this a bit if necessary, i.e. we could fall back on
the architecture of the selected executable.
Index: ChangeLog
from Mark Kettenis <kettenis@gnu.org>
* elf.c (elfcore_grok_netbsd_procinfo): Make a pseudosection out
of the note.
Index: elf.c
===================================================================
RCS file: /cvs/src/src/bfd/elf.c,v
retrieving revision 1.203
diff -u -p -r1.203 elf.c
--- elf.c 20 Oct 2003 14:38:39 -0000 1.203
+++ elf.c 24 Oct 2003 15:27:50 -0000
@@ -6833,7 +6833,8 @@ elfcore_grok_netbsd_procinfo (bfd *abfd,
elf_tdata (abfd)->core_command
= _bfd_elfcore_strndup (abfd, note->descdata + 0x7c, 31);
- return TRUE;
+ return elfcore_make_note_pseudosection (abfd, ".note.netbsdcore.procinfo",
+ note);
}
static bfd_boolean
More information about the Binutils
mailing list