|
From: zgx1119 <zg...@gm...> - 2022-04-06 08:48:50
|
Below is my add code for my platform:
static Bool VG_(parse_cpuinfo)(void) {
..............
const char *search_Taroko_str = "cpu model\t\t: Taroko";
.................
else if (VG_(strstr)(file_buf, search_MIPS_str) != NULL ||
VG_(strstr)(file_buf, search_Taroko_str) != NULL)
vai.hwcaps = VEX_PRID_COMP_MIPS;
.......
}
Then run: [# valgrind --run-libc-freeres=no
--suppressions=/lib/valgrind/default.supp ./a
.out
machine_get_hwcaps============================machine_get_hwcaps============================1
machine_get_hwcaps============================3
==4512== Memcheck, a memory error detector
==4512== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==4512== Using Valgrind-3.15.0 and LibVEX; rerun with -h for copyright info
==4512== Command: ./a.out
==4512==
vex mips->IR: unhandled instruction bytes: 0x0 0x40 0x63 0x40
==4512== valgrind: Unrecognised instruction at address 0x4897284.
==4512== at 0x4897284: ??? (in /usr/lib/libuClibc-1.0.31.so)
==4512== by 0x487C704: ??? (in /usr/lib/libuClibc-1.0.31.so)
==4512== Your program just tried to execute an instruction that Valgrind
==4512== did not recognise. There are two possible reasons for this.
==4512== 1. Your program has a bug and erroneously jumped to a non-code
==4512== location. If you are running Memcheck and you just saw a
==4512== warning about a bad jump, it's probably your program's fault.
==4512== 2. The instruction is legitimate but Valgrind doesn't handle it,
==4512== i.e. it's Valgrind's fault. If you think this is the case or
==4512== you are not sure, please let us know and we'll try to fix it.
==4512== Either way, Valgrind will now raise a SIGILL signal which will
==4512== probably kill your program.
==4512==
==4512== Process terminating with default action of signal 4 (SIGILL)
==4512== Illegal opcode at address 0x4897284
==4512== at 0x4897284: ??? (in /usr/lib/libuClibc-1.0.31.so)
==4512== by 0x487C704: ??? (in /usr/lib/libuClibc-1.0.31.so)
==4512==
==4512== HEAP SUMMARY:
==4512== in use at exit: 0 bytes in 0 blocks
==4512== total heap usage: 0 allocs, 0 frees, 0 bytes allocated
==4512==
==4512== All heap blocks were freed -- no leaks are possible
==4512==
==4512== For lists of detected and suppressed errors, rerun with: -s
==4512== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
Illegal instruction
Below is our platform cpu info:
# cat /proc/cpuinfo
system type : Realtek RTS39XX
machine : RTS3916 EVB
processor : 0
cpu model : Taroko V0.2 FPU V0.1
BogoMIPS : 798.72
wait instruction : yes
microsecond timers : yes
tlb_entries : 64
extra interrupt vector : no
hardware watchpoint : no
isa : mips1
ASEs implemented : mips16
shadow register sets : 1
kscratch registers : 0
package : 0
core : 0
VCED exceptions : not available
VCEI exceptions : not available
|