Manage objfiles with shared_ptr
[deliverable/binutils-gdb.git] / sim / common / sim-events.c
index d7ca0df5d4b1acc5afbc10d90836ae2561a5c2bc..6420747fa7052eb5549c4be3e437d1e0ad34481c 100644 (file)
@@ -1,6 +1,6 @@
 /* The common simulator framework for GDB, the GNU Debugger.
 
-   Copyright 2002-2015 Free Software Foundation, Inc.
+   Copyright 2002-2019 Free Software Foundation, Inc.
 
    Contributed by Andrew Cagney and Red Hat.
 
@@ -25,6 +25,7 @@
 
 #include "sim-main.h"
 #include "sim-assert.h"
+#include "libiberty.h"
 
 #ifdef HAVE_STRING_H
 #include <string.h>
@@ -140,21 +141,14 @@ struct _sim_event {
 
 #define _ETRACE sd, NULL
 
-#undef ETRACE_P
-#define ETRACE_P (WITH_TRACE && STATE_EVENTS (sd)->trace)
-
 #undef ETRACE
 #define ETRACE(ARGS) \
 do \
   { \
-    if (ETRACE_P) \
+    if (STRACE_EVENTS_P (sd)) \
       { \
         if (STRACE_DEBUG_P (sd)) \
-         { \
-           const char *file; \
-           SIM_FILTER_PATH (file, __FILE__); \
-           trace_printf (sd, NULL, "%s:%d: ", file, __LINE__); \
-         } \
+         trace_printf (sd, NULL, "%s:%d: ", lbasename (__FILE__), __LINE__); \
         trace_printf  ARGS; \
       } \
   } \
@@ -409,7 +403,7 @@ update_time_from_event (SIM_DESC sd)
       events->time_of_event = current_time - 1;
       events->time_from_event = -1;
     }
-  if (ETRACE_P)
+  if (STRACE_EVENTS_P (sd))
     {
       sim_event *event;
       int i;
@@ -521,7 +515,7 @@ sim_events_schedule_vtracef (SIM_DESC sd,
   new_event->data = data;
   new_event->handler = handler;
   new_event->watching = watch_timer;
-  if (fmt == NULL || !ETRACE_P || vasprintf (&new_event->trace, fmt, ap) < 0)
+  if (fmt == NULL || !STRACE_EVENTS_P (sd) || vasprintf (&new_event->trace, fmt, ap) < 0)
     new_event->trace = NULL;
   insert_sim_event (sd, new_event, delta_time);
   ETRACE ((_ETRACE,
@@ -641,7 +635,7 @@ sim_events_watch_sim (SIM_DESC sd,
   /* type */
   switch (byte_order)
     {
-    case 0:
+    case BFD_ENDIAN_UNKNOWN:
       switch (nr_bytes)
        {
        case 1: new_event->watching = watch_sim_host_1; break;
@@ -651,7 +645,7 @@ sim_events_watch_sim (SIM_DESC sd,
        default: sim_io_error (sd, "sim_events_watch_sim - invalid nr bytes");
        }
       break;
-    case BIG_ENDIAN:
+    case BFD_ENDIAN_BIG:
       switch (nr_bytes)
        {
        case 1: new_event->watching = watch_sim_be_1; break;
@@ -661,7 +655,7 @@ sim_events_watch_sim (SIM_DESC sd,
        default: sim_io_error (sd, "sim_events_watch_sim - invalid nr bytes");
        }
       break;
-    case LITTLE_ENDIAN:
+    case BFD_ENDIAN_LITTLE:
       switch (nr_bytes)
        {
        case 1: new_event->watching = watch_sim_le_1; break;
@@ -720,7 +714,7 @@ sim_events_watch_core (SIM_DESC sd,
   /* type */
   switch (byte_order)
     {
-    case 0:
+    case BFD_ENDIAN_UNKNOWN:
       switch (nr_bytes)
        {
        case 1: new_event->watching = watch_core_targ_1; break;
@@ -730,7 +724,7 @@ sim_events_watch_core (SIM_DESC sd,
        default: sim_io_error (sd, "sim_events_watch_core - invalid nr bytes");
        }
       break;
-    case BIG_ENDIAN:
+    case BFD_ENDIAN_BIG:
       switch (nr_bytes)
        {
        case 1: new_event->watching = watch_core_be_1; break;
@@ -740,7 +734,7 @@ sim_events_watch_core (SIM_DESC sd,
        default: sim_io_error (sd, "sim_events_watch_core - invalid nr bytes");
        }
       break;
-    case LITTLE_ENDIAN:
+    case BFD_ENDIAN_LITTLE:
       switch (nr_bytes)
        {
        case 1: new_event->watching = watch_core_le_1; break;
This page took 0.026659 seconds and 4 git commands to generate.