This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[CRIS] Reading core file selects "wrong" mach


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]