[PATCH] Handle loading improper core files gracefully in the mips backend.

Luis Machado lgustavo@codesourcery.com
Mon Jan 11 15:47:00 GMT 2016


On 01/09/2016 01:02 AM, Maciej W. Rozycki wrote:
> On Fri, 8 Jan 2016, Luis Machado wrote:
>
>> Maciej, do you have more input on additional incompatibilities that we need
>> to check for?
>
>   Why do we get this far in the first place where e_machine != EM_MIPS?  I
> think rather than adding additional checks here (unless they're needed for
> a valid MIPS ELF binary; but that would be a separate problem to fix) we
> should reject such a core file outright.

I thought about that, but no targets other than v850 use e_machine 
information during arch initialization, which is strange. It seems we 
just don't enforce compatibility, at least when loading core files.

Does the attached patch match what you have in mind? I also adjusted the 
testcase to expect core file rejection and also got rid of duplicated 
test strings.

Now a mips-targeted GDB says the following when trying to load a x86 
core file:

gdb.arch/i386-biarch-core.core": no core file handler recognizes format
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Handle-loading-improper-core-files-gracefully-in-the.patch
Type: text/x-patch
Size: 2699 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20160111/79647bcc/attachment.bin>


More information about the Gdb-patches mailing list