Posix core files sometime don't contain enough information to correctly
detect the OS. If that is the case we should use the OS from the target
instead as it will contain usable information in more cases and if the
target and the core contain different OS-es then we are already in a
pretty bad state so moving from an unknown OS to a known (but possibly
incorrect) OS will do no harm.
We already had similar code in place for MIPS. This change tries to make
it more generic by using ArchSpec::MergeFrom and extends it to all
architectures but some MIPS specific issue prevent us from getting rid
of special casing MIPS.
Hi Nitesh,
I tried to remove this MIPS specific code as it shouldn't be necessary if I add the above MergeFrom for all architecture but if I do it fails LinuxCore
TestCase.test_mips_n32.
The issue is that in that case the tripe we get from the core file is "mipsel--" ("mipsel--linux" after the merge) and the one we get from the binary is "mips64el--linux". Is it normal to have a seemingly 32bit core file with a 64bit binary on mips? If not then can I ask you to help me figure out which one is incorrect?
If it is then I don't see any better short term solution then leaving this condition here but it feels like a quite big hack what might backfire when somebody tries to use a core file with a completely incompatible binary.
Thanks,
Tamas