From d4e3adda1225d29b99f7bc81cc711806ecaacb70 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Mon, 23 Mar 2015 00:30:52 -0400 Subject: sim: watchpoints: change sizeof_pc to sizeof(sim_cia) Existing ports already have sizeof_pc set to the same size as sim_cia, so simply make that part of the core code. We already assume this in places by way of sim_pc_{get,set}, and this is how it's documented in the sim-base.h API. There is code to allow sims to pick different register word sizes from address sizes, but most ports use the defaults for both (32-bits), and the few that support multiple register sizes never change the address size (so address defaults to register). I can't think of any machine where the register hardware size would be larger than the address word size either. We have ABIs that behave that way (e.g. x32), but the hardware is still equivalent register sized. --- sim/README-HACKING | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'sim/README-HACKING') diff --git a/sim/README-HACKING b/sim/README-HACKING index 583a559..9953f99 100644 --- a/sim/README-HACKING +++ b/sim/README-HACKING @@ -267,10 +267,8 @@ And in your insn fetcher: PROFILE_COUNT_CORE (cpu, target_addr, size_in_bytes, map_exec); To use the PC profiling code, you simply have to tell the system where to find -your simulator's PC and its size. So in your sim_open() function: +your simulator's PC. So in your sim_open() function: STATE_WATCHPOINTS (sd)->pc = address_of_cpu0_pc; - STATE_WATCHPOINTS (sd)->sizeof_pc = number_of_bytes_for_pc_storage; -In a typical 32bit system, the sizeof_pc will be 4 bytes. To profile branches, in every location where a branch insn is executed, call one of the related helpers: -- cgit v1.1