[Crash-utility] [PATCH 01/16] Add MIPS64 framework code support

HAGIO KAZUHITO(萩尾 一仁) k-hagio-ab at nec.com
Fri Mar 12 04:21:55 UTC 2021


-----Original Message-----
> >> --- a/diskdump.c
> >> +++ b/diskdump.c
> >> @@ -594,6 +594,9 @@ restart:
> >>   	else if (STRNEQ(header->utsname.machine, "mips") &&
> >>   	    machine_type_mismatch(file, "MIPS", NULL, 0))
> >>   		goto err;
> >> +	else if (STRNEQ(header->utsname.machine, "mips64") &&
> >> +	    machine_type_mismatch(file, "MIPS", NULL, 0))
> >> +		goto err;
> > Why do you make MACHINE_TYPE the same as the MIPS one?
> > With this, doesn't a MIPS64 crash match a MIPS vmcore?
> The value of the machine type e_machine in mips32 or mips64 is MIPS, which
> corresponds to EM_MIPS.
> The definition in gdb-7.6/include/elf/common.h:110 is as follows:
>      #define EM_MIPS        8        /* MIPS R3000 */
> But there is no related definition of EM_MIPS64 or other mips64, so both
> mips32 and mips64 should use EM_MIPS, and the corresponding e_machine is
> MIPS.
> 
> If the MACHINE_TYPE of mips64 is defined as MIPS64, as follows:
>      define MACHINE_TYPE     "MIPS64"
> 
> The following error will appear when running crash:
>      WARNING: machine type mismatch:
>                crash utility: MIPS64
>                vmcore: MIPS

Then, is there any problem with this?
  machine_type_mismatch(file, "MIPS64", NULL, 0))

This can prevent a mips64 crash from trying to open a mips32 vmcore
and the reverse.

Thanks,
Kazu

> 
> # readelf -h vmcore
> ...
>    Type:                              CORE (Core file)
>    Machine:                           MIPS R3000
> ...
> 
> Therefore, the MACHINE_TYPE of mips32 and mips64 both define MIPS.
> 
> Thanks,
> Youling
> >





More information about the Crash-utility mailing list