This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[CRIS] Reading core file selects "wrong" mach
- From: Orjan Friberg <orjan dot friberg at axis dot com>
- To: gdb-patches at sources dot redhat dot com, Hans-Peter Nilsson <hans-peter dot nilsson at axis dot com>
- Date: Wed, 01 Dec 2004 14:59:55 +0100
- Subject: [CRIS] Reading core file selects "wrong" mach
- Organization: Axis Communications
When reading a CRISv32 Linux core file, the "wrong" mach is selected, causing
cris_elf_grok_prstatus to not find the general-purpose registers (because unlike
other ports it actually checks bfd_get_mach (abfd)).
The reason seems to be the call to bfd_default_set_arch_mach (abfd, ebd->arch,
0) in elf_core_file_p in elfcore.h which will select the default mach for that
arch. Directly after this we start reading the core file which results in a
call to cris_elf_grok_prstatus (which fails because the default mach doesn't
match the current mach).
Is there an implicit assumption that the mach is not to be trusted when reading
a core file?
(For reference: e_flags, checked in set_mach_from_flags, is hardcoded to 0 in
the Linux kernel, but setting it correctly (to EF_CRIS_VARIANT_V32 in this case)
wouldn't change a thing because of the above.)
--
Orjan Friberg
Axis Communications