Function used by GDB to access target sim memory

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Function used by GDB to access target sim memory

William Tambe
What function does GDB use to access the simulator memory when "target
sim" is in use ?

For instance, to implement the access to the simulator registers, one must use:
CPU_REG_FETCH()
CPU_REG_STORE()

Are there similar functions for accessing the simulator memory ?
Reply | Threaded
Open this post in threaded view
|

Re: Function used by GDB to access target sim memory

William Tambe
To expand on my previous email, I am looking to implement an address
translation layer between GDB and the simulator memory.

Is there a way to set a function that gets called when a request to
access the simulator memory occur ?

On Sun, Aug 18, 2019 at 12:55 PM William Tambe <[hidden email]> wrote:
>
> What function does GDB use to access the simulator memory when "target
> sim" is in use ?
>
> For instance, to implement the access to the simulator registers, one must use:
> CPU_REG_FETCH()
> CPU_REG_STORE()
>
> Are there similar functions for accessing the simulator memory ?
Reply | Threaded
Open this post in threaded view
|

Re: Function used by GDB to access target sim memory

Pedro Alves-7
In reply to this post by William Tambe
On 8/18/19 6:55 PM, William Tambe wrote:
> What function does GDB use to access the simulator memory when "target
> sim" is in use ?

The interface between gdb and the sim is all in gdb/remote-sim.c.
Sounds like you're looking for gdbsim_xfer_memory.

>
> For instance, to implement the access to the simulator registers, one must use:
> CPU_REG_FETCH()
> CPU_REG_STORE()
>
> Are there similar functions for accessing the simulator memory ?
>

Thanks,
Pedro Alves