sim: ppc: replace filter_filename with lbasename

The lbasename function from libiberty provides the same API as this
custom function.  The common/ code already made the switch, so make
the same change to the ppc code to avoid target duplication.
This commit is contained in:
Mike Frysinger
2024-01-01 16:32:48 -05:00
parent 5817b1f52f
commit a243f0a5a1
2 changed files with 8 additions and 15 deletions

View File

@@ -198,8 +198,7 @@ CPU_H = \
cpu.c cpu.c
DEBUG_H = \ DEBUG_H = \
debug.h \ debug.h
$(FILTER_FILENAME_H)
DEVICE_H = \ DEVICE_H = \
device.h device.h
@@ -240,9 +239,6 @@ EMUL_UNIX_H = \
EVENTS_H = \ EVENTS_H = \
events.h events.h
FILTER_FILENAME_H = \
filter_filename.h
FILTER_H = \ FILTER_H = \
filter.h filter.h
@@ -304,8 +300,7 @@ LF_H = \
MISC_H = \ MISC_H = \
misc.h \ misc.h \
$(CONFIG_H) \ $(CONFIG_H)
$(FILTER_FILENAME_H)
MON_H = \ MON_H = \
mon.h \ mon.h \
@@ -466,7 +461,6 @@ COMMON_OBJS = $(COMMON_OBJS_NAMES:%=../common/%)
# first # first
LIB_OBJ = \ LIB_OBJ = \
debug.o \ debug.o \
filter_filename.o \
bits.o \ bits.o \
sim-endian.o \ sim-endian.o \
os_emul.o \ os_emul.o \
@@ -519,7 +513,6 @@ psim.o: psim.c $(CPU_H) $(IDECODE_H) $(OPTIONS_H) $(TREE_H) $(BFD_H)
bits.o: bits.c $(BASICS_H) bits.o: bits.c $(BASICS_H)
debug.o: debug.c $(CONFIG_H) $(BASICS_H) debug.o: debug.c $(CONFIG_H) $(BASICS_H)
filter_filename.o: filter_filename.c $(CONFIG_H) $(FILTER_FILENAME_H)
sim-endian.o: sim-endian.c $(CONFIG_H) $(BASICS_H) $(SIM_ENDIAN_N_H) sim-endian.o: sim-endian.c $(CONFIG_H) $(BASICS_H) $(SIM_ENDIAN_N_H)

View File

@@ -21,7 +21,7 @@
#ifndef _DEBUG_H_ #ifndef _DEBUG_H_
#define _DEBUG_H_ #define _DEBUG_H_
#include "filter_filename.h" #include "libiberty.h"
typedef enum { typedef enum {
trace_invalid, trace_invalid,
@@ -87,7 +87,7 @@ extern int ppc_trace[nr_trace_options];
do { \ do { \
if (WITH_TRACE) { \ if (WITH_TRACE) { \
if (ppc_trace[OBJECT]) { \ if (ppc_trace[OBJECT]) { \
sim_io_printf_filtered("%s:%d: ", filter_filename(__FILE__), __LINE__); \ sim_io_printf_filtered("%s:%d: ", lbasename(__FILE__), __LINE__); \
sim_io_printf_filtered ARGS; \ sim_io_printf_filtered ARGS; \
} \ } \
} \ } \
@@ -113,7 +113,7 @@ do { \
|| ppc_trace[trace_##OBJECT##_device] \ || ppc_trace[trace_##OBJECT##_device] \
|| trace_device) { \ || trace_device) { \
sim_io_printf_filtered("%s:%d:%s:%s%s ", \ sim_io_printf_filtered("%s:%d:%s:%s%s ", \
filter_filename(__FILE__), __LINE__, #OBJECT, \ lbasename(__FILE__), __LINE__, #OBJECT, \
trace_device ? device_path(me) : "", \ trace_device ? device_path(me) : "", \
trace_device ? ":" : ""); \ trace_device ? ":" : ""); \
sim_io_printf_filtered ARGS; \ sim_io_printf_filtered ARGS; \
@@ -131,7 +131,7 @@ do { \
|| ppc_trace[trace_##OBJECT##_device] \ || ppc_trace[trace_##OBJECT##_device] \
|| trace_device) { \ || trace_device) { \
sim_io_printf_filtered("%s:%d:%s:%s%s ", \ sim_io_printf_filtered("%s:%d:%s:%s%s ", \
filter_filename(__FILE__), __LINE__, #OBJECT, \ lbasename(__FILE__), __LINE__, #OBJECT, \
trace_device ? device_path(_me) : "", \ trace_device ? device_path(_me) : "", \
trace_device ? ":" : ""); \ trace_device ? ":" : ""); \
sim_io_printf_filtered ARGS; \ sim_io_printf_filtered ARGS; \
@@ -144,7 +144,7 @@ do { \
do { \ do { \
if (WITH_TRACE) { \ if (WITH_TRACE) { \
if (ppc_trace[trace_##OBJECT##_package]) { \ if (ppc_trace[trace_##OBJECT##_package]) { \
sim_io_printf_filtered("%s:%d:%s: ", filter_filename(__FILE__), __LINE__, #OBJECT); \ sim_io_printf_filtered("%s:%d:%s: ", lbasename(__FILE__), __LINE__, #OBJECT); \
sim_io_printf_filtered ARGS; \ sim_io_printf_filtered ARGS; \
} \ } \
} \ } \
@@ -156,7 +156,7 @@ do { \
if (WITH_ASSERT) { \ if (WITH_ASSERT) { \
if (!(EXPRESSION)) { \ if (!(EXPRESSION)) { \
error("%s:%d: assertion failed - %s\n", \ error("%s:%d: assertion failed - %s\n", \
filter_filename(__FILE__), __LINE__, #EXPRESSION); \ lbasename(__FILE__), __LINE__, #EXPRESSION); \
} \ } \
} \ } \
} while (0) } while (0)