From: Doug Evans Date: Thu, 13 Nov 1997 21:18:14 +0000 (+0000) Subject: * sim-base.h (sim_state_base): Move `magic' to end of struct. X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=9e8a900adf4d6e4845dc763407af7a142bed9424;p=deliverable%2Fbinutils-gdb.git * sim-base.h (sim_state_base): Move `magic' to end of struct. * sim-base.h (sim_state_base): Add member trace_data. (STATE_TRACE_DATA): New macro. * sim-trace.h (TRACE_DEBUG_IDX,TRACE_debug): New macros. ({WITH_,}TRACE_DEBUG_P): New macros. (STATE_TRACE_FLAGS,STRACE_P,STRACE_DEBUG_P): New macros. (_sim_cpu): Delete forward reference. (debug_printf): Update. * sim-trace.c (OPTION_TRACE_DEBUG): Define. (trace_options): Add --trace-debug. (set_trace_options): Handle it. (trace_option_handler): Likewise. (trace_install): Init state trace_data struct. (trace_uninstall): Close state trace file. * sim-events.c (ETRACE): Only print source file and number if --trace-debug. * sim-n-core.h (sim_core_trace_M): Likewise. * sim-core.c (sim_core_signal): Add missing "\n" in message. --- diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog index 53f5e8998a..87877de2db 100644 --- a/sim/common/ChangeLog +++ b/sim/common/ChangeLog @@ -1,3 +1,26 @@ +Thu Nov 13 11:49:41 1997 Doug Evans + + * sim-base.h (sim_state_base): Move `magic' to end of struct. + + * sim-base.h (sim_state_base): Add member trace_data. + (STATE_TRACE_DATA): New macro. + * sim-trace.h (TRACE_DEBUG_IDX,TRACE_debug): New macros. + ({WITH_,}TRACE_DEBUG_P): New macros. + (STATE_TRACE_FLAGS,STRACE_P,STRACE_DEBUG_P): New macros. + (_sim_cpu): Delete forward reference. + (debug_printf): Update. + * sim-trace.c (OPTION_TRACE_DEBUG): Define. + (trace_options): Add --trace-debug. + (set_trace_options): Handle it. + (trace_option_handler): Likewise. + (trace_install): Init state trace_data struct. + (trace_uninstall): Close state trace file. + * sim-events.c (ETRACE): Only print source file and line number if + --trace-debug. + * sim-n-core.h (sim_core_trace_M): Likewise. + + * sim-core.c (sim_core_signal): Add missing "\n" in message. + 1997-11-13 Felix Lee * sim-n-core.h (sim_core_read_unaligned_N): illegal empty diff --git a/sim/common/sim-n-core.h b/sim/common/sim-n-core.h index 58a7b87484..b355e3bb40 100644 --- a/sim/common/sim-n-core.h +++ b/sim/common/sim-n-core.h @@ -62,10 +62,13 @@ sim_core_trace_M (sim_cpu *cpu, { char *transfer = (type == read_transfer ? "read" : "write"); char *direction = (type == read_transfer ? "->" : "<-"); + + if (TRACE_DEBUG_P (cpu)) + trace_printf (CPU_STATE (cpu), cpu, "sim-n-core.h:%d: ", line_nr); + #if (M == 16) trace_printf (CPU_STATE (cpu), cpu, - "sim-n-core.h:%d: %s-%d %s:0x%08lx %s 0x%08lx%08lx%08lx%08lx\n", - line_nr, + "%s-%d %s:0x%08lx %s 0x%08lx%08lx%08lx%08lx\n", transfer, nr_bytes, sim_core_map_to_str (map), (unsigned long) addr, @@ -77,8 +80,7 @@ sim_core_trace_M (sim_cpu *cpu, #endif #if (M == 8) trace_printf (CPU_STATE (cpu), cpu, - "sim-n-core.h:%d: %s-%d %s:0x%08lx %s 0x%08lx%08lx\n", - line_nr, + "%s-%d %s:0x%08lx %s 0x%08lx%08lx\n", transfer, nr_bytes, sim_core_map_to_str (map), (unsigned long) addr, @@ -88,8 +90,7 @@ sim_core_trace_M (sim_cpu *cpu, #endif #if (M == 4) trace_printf (CPU_STATE (cpu), cpu, - "sim-n-core.h:%d: %s-%d %s:0x%08lx %s 0x%08lx\n", - line_nr, + "%s-%d %s:0x%08lx %s 0x%08lx\n", transfer, nr_bytes, sim_core_map_to_str (map), @@ -99,8 +100,7 @@ sim_core_trace_M (sim_cpu *cpu, #endif #if (M == 2) trace_printf (CPU_STATE (cpu), cpu, - "sim-n-core.h:%d: %s-%d %s:0x%08lx %s 0x%04lx\n", - line_nr, + "%s-%d %s:0x%08lx %s 0x%04lx\n", transfer, nr_bytes, sim_core_map_to_str (map), @@ -110,8 +110,7 @@ sim_core_trace_M (sim_cpu *cpu, #endif #if (M == 1) trace_printf (CPU_STATE (cpu), cpu, - "sim-n-core.h:%d: %s-%d %s:0x%08lx %s 0x%02lx\n", - line_nr, + "%s-%d %s:0x%08lx %s 0x%02lx\n", transfer, nr_bytes, sim_core_map_to_str (map),