From 247ac9ee6e1ecea67d29a5712e77e8c64834b06e Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Mon, 30 Mar 2015 00:13:38 -0400 Subject: sim: cr16: convert to nrun A lot of cpu state is stored in global variables, as is memory handling. The sim_size support needs unwinding at some point. But at least this is an improvement on the status quo. --- sim/cr16/simops.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'sim/cr16/simops.c') diff --git a/sim/cr16/simops.c b/sim/cr16/simops.c index 3773bf7..a923192 100644 --- a/sim/cr16/simops.c +++ b/sim/cr16/simops.c @@ -37,7 +37,7 @@ #include #endif -#include "cr16_sim.h" +#include "sim-main.h" #include "simops.h" #include "targ-vals.h" @@ -264,14 +264,21 @@ trace_input_func (const char *name, enum op_types in1, enum op_types in2, enum o else { + extern SIM_DESC trace_sd; + buf[0] = '\0'; - byte_pc = decode_pc (); - if (text && byte_pc >= text_start && byte_pc < text_end) + byte_pc = PC; + if (STATE_TEXT_SECTION (trace_sd) + && byte_pc >= STATE_TEXT_START (trace_sd) + && byte_pc < STATE_TEXT_END (trace_sd)) { filename = (const char *)0; functionname = (const char *)0; linenumber = 0; - if (bfd_find_nearest_line (prog_bfd, text, (struct bfd_symbol **)0, byte_pc - text_start, + if (bfd_find_nearest_line (STATE_PROG_BFD (trace_sd), + STATE_TEXT_SECTION (trace_sd), + (struct bfd_symbol **)0, + byte_pc - STATE_TEXT_START (trace_sd), &filename, &functionname, &linenumber)) { p = buf; -- cgit v1.1