To get the fault you can change in samples/sample_ppc.c line #define PPC_CODE "\x7F\x46\x1A\x14" to #define PPC_CODE "\x7c\x76\x02\xa6". This code (mfspr r3, 0x16) leads to SegFault.
Tested on master, dev branches. Builded with cmake .. -DUNICORN_ARCH=ppc.
To get the fault you can change in
samples/sample_ppc.c
line#define PPC_CODE "\x7F\x46\x1A\x14"
to#define PPC_CODE "\x7c\x76\x02\xa6"
. This code (mfspr r3, 0x16
) leads to SegFault.Tested on master, dev branches. Builded with
cmake .. -DUNICORN_ARCH=ppc
.The problem is in
cpu_ppc_load_decr
function inqemu/hw/ppc/ppc.c
. It calles_cpu_ppc_load_decr(env, env->tb_env->decr_next)
, buttb_env
is NULL.This function can be fixed either by returning just some value or by calling
cpu_ppc_tb_init (CPUPPCState *env, uint32_t freq)
.