qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] Inserting Memory Watch points


From: Taimoor Mirza
Subject: [Qemu-devel] Inserting Memory Watch points
Date: Mon, 19 Apr 2010 12:11:46 +0600

Hi all,

I've developed an application for ARM intergrator and it is running find under QEMU. I am trying to redirect my serial data to my custom emulated device. For that I've inserted memory watch point at Pl011 UART  controllers Data Register so that whenever some access is made to this register my registered function gets invoked which will redirect request to my custom emulated device.

I've few questions:
  1. cpu_watchpoint_insert needs a CPU_State parameter. From where can I get this CPU state.
  2. I tried putting code in vl.c and called my custom_init function from main before main_loop(). Below is source code of my custom_init function:

static void custom_init()
{
    CPUState *env;
    int err = 0;

    for (env = first_cpu; env != NULL; env = env->next_cpu) {
    err = cpu_watchpoint_insert(env,369098752,8,BP_MEM_WRITE,NULL);
    if (err)
           printf("\n Got an error while inserting watchpoint");
    }
    qemu_add_vm_change_state_handler(myfunc,NULL);

}

This function gets called and does not return error, but when I run my application it gives me following error of segmentation fault:

VNC server running on `127.0.0.1:5900'

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1208740160 (LWP 1912)]
gdb_set_stop_cpu (env=0x9ef36a0) at /usr/QEMU_Learning/QEMU_Src/qemu-0.12.3/gdbstub.c:2114
2114        gdbserver_state->c_cpu = env;
(gdb) p env
$1 = (struct CPUARMState *) 0x9ef36a0
(gdb) p gdbserver_state->c_cpu
Cannot access memory at address 0x0

Can anybody tell me whats wrong with this?

Thanks,
Taimoor


Hotmail: Trusted email with Microsoft’s powerful SPAM protection. Sign up now.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]