demand_copy_C_string NUL check
[binutils-gdb.git] / sim / README-HACKING
index 0c67648e930e741f3fc6d570b1b248936600f88b..0b72d96f5c2fe57b0e00d97f1a77ae2569619fed 100644 (file)
@@ -38,8 +38,8 @@ The configure.ac of a simulator using the common framework should look like:
 
 --- snip ---
 dnl Process this file with autoconf to produce a configure script.
-sinclude(../common/aclocal.m4)
 AC_INIT(Makefile.in)
+AC_CONFIG_MACRO_DIRS([../common ../.. ../../config])
 
 SIM_AC_COMMON
 
@@ -85,8 +85,6 @@ SIM_EXTRA_CFLAGS =
 SIM_EXTRA_LIBS =
 # List of extra program dependencies.
 SIM_EXTRA_LIBDEPS =
-# List of main object files for `run'.
-SIM_RUN_OBJS = run.o
 # Dependency of `all' to build any extra files.
 SIM_EXTRA_ALL =
 # Dependency of `install' to install any extra files.
@@ -193,10 +191,10 @@ convenience):
        $  cd /tmp/$$/build
        $  /tmp/$$/devo/configure --target=d10v-elf
 
-In the sim/common directory rebuild the headers:
+In the sim/ directory rebuild the headers:
 
-       $  cd sim/common
-       $  make headers
+       $  cd sim/
+       $  make nltvals
 
 To add a new target:
 
@@ -269,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:
-  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.
+your simulator's PC.  So in your model initialization function:
+  CPU_PC_FETCH (cpu) = function_that_fetches_the_pc;
 
 To profile branches, in every location where a branch insn is executed, call
 one of the related helpers: