Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Mike Frysinger <vapier@gentoo.org>
To: gdb-patches@sourceware.org
Subject: [PATCH/committed 2/8] sim: ppc: replace filter_filename with lbasename
Date: Mon,  1 Jan 2024 18:22:13 -0500	[thread overview]
Message-ID: <20240101232219.3003-2-vapier@gentoo.org> (raw)
In-Reply-To: <20240101232219.3003-1-vapier@gentoo.org>

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.
---
 sim/ppc/Makefile.in | 11 ++---------
 sim/ppc/debug.h     | 12 ++++++------
 2 files changed, 8 insertions(+), 15 deletions(-)

diff --git a/sim/ppc/Makefile.in b/sim/ppc/Makefile.in
index f7c37cc68f79..b8e7fbfd45f1 100644
--- a/sim/ppc/Makefile.in
+++ b/sim/ppc/Makefile.in
@@ -198,8 +198,7 @@ CPU_H = \
 	cpu.c
 
 DEBUG_H = \
-	debug.h \
-	$(FILTER_FILENAME_H)
+	debug.h
 
 DEVICE_H = \
 	device.h
@@ -240,9 +239,6 @@ EMUL_UNIX_H = \
 EVENTS_H = \
 	events.h
 
-FILTER_FILENAME_H = \
-	filter_filename.h
-
 FILTER_H = \
 	filter.h
 
@@ -304,8 +300,7 @@ LF_H = \
 
 MISC_H = \
 	misc.h \
-	$(CONFIG_H) \
-	$(FILTER_FILENAME_H)
+	$(CONFIG_H)
 
 MON_H = \
 	mon.h \
@@ -466,7 +461,6 @@ COMMON_OBJS = $(COMMON_OBJS_NAMES:%=../common/%)
 #       first
 LIB_OBJ = \
 	debug.o \
-	filter_filename.o \
 	bits.o \
 	sim-endian.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)
 
 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)
 
diff --git a/sim/ppc/debug.h b/sim/ppc/debug.h
index 28e42c7bb753..e221ce553d36 100644
--- a/sim/ppc/debug.h
+++ b/sim/ppc/debug.h
@@ -21,7 +21,7 @@
 #ifndef _DEBUG_H_
 #define _DEBUG_H_
 
-#include "filter_filename.h"
+#include "libiberty.h"
 
 typedef enum {
   trace_invalid,
@@ -87,7 +87,7 @@ extern int ppc_trace[nr_trace_options];
 do { \
   if (WITH_TRACE) { \
     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; \
     } \
   } \
@@ -113,7 +113,7 @@ do { \
 	|| ppc_trace[trace_##OBJECT##_device] \
 	|| trace_device) { \
       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 ? ":" : "");			\
       sim_io_printf_filtered ARGS; \
@@ -131,7 +131,7 @@ do { \
 	|| ppc_trace[trace_##OBJECT##_device] \
 	|| trace_device) { \
       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 ? ":" : "");			\
       sim_io_printf_filtered ARGS; \
@@ -144,7 +144,7 @@ do { \
 do { \
   if (WITH_TRACE) { \
     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; \
     } \
   } \
@@ -156,7 +156,7 @@ do { \
   if (WITH_ASSERT) { \
     if (!(EXPRESSION)) { \
       error("%s:%d: assertion failed - %s\n", \
-	    filter_filename(__FILE__), __LINE__, #EXPRESSION); \
+	    lbasename(__FILE__), __LINE__, #EXPRESSION); \
     } \
   } \
 } while (0)
-- 
2.43.0


  reply	other threads:[~2024-01-01 23:23 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-01 23:22 [PATCH/committed 1/8] sim: ppc: hoist igen compilation into top-level Mike Frysinger
2024-01-01 23:22 ` Mike Frysinger [this message]
2024-01-09 14:34   ` [PATCH/committed 2/8] sim: ppc: replace filter_filename with lbasename Tom Tromey
2024-01-09 17:41     ` Mike Frysinger
2024-01-01 23:22 ` [PATCH/committed 3/8] sim: ppc: unify igen filter_filename implementations Mike Frysinger
2024-01-01 23:22 ` [PATCH/committed 4/8] sim: igen: minor constify logic Mike Frysinger
2024-01-01 23:22 ` [PATCH/committed 5/8] sim: ppc: rename igen max_insn_bit_size Mike Frysinger
2024-01-01 23:22 ` [PATCH/committed 6/8] sim: igen: extend error to take arguments Mike Frysinger
2024-01-01 23:22 ` [PATCH/committed 7/8] sim: ppc: rework igen error to match common Mike Frysinger
2024-01-01 23:22 ` [PATCH/committed 8/8] sim: ppc: merge misc igen APIs Mike Frysinger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240101232219.3003-2-vapier@gentoo.org \
    --to=vapier@gentoo.org \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox