This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Define an error function in the PPC simulator.


Previously this used the error function from GDB directly instead of
the error method in the host callbacks structure.  This was exposed via
a link error when GDB was converted to C++.  The error function invokes
the error callback similar to sim_io_error.

sim/ppc/ChangeLog:

	* sim_calls.c (error): New function.
---
 sim/ppc/ChangeLog   |  4 ++++
 sim/ppc/sim_calls.c | 10 ++++++++++
 2 files changed, 14 insertions(+)

diff --git a/sim/ppc/ChangeLog b/sim/ppc/ChangeLog
index 7ed024e..f7d8ffb 100644
--- a/sim/ppc/ChangeLog
+++ b/sim/ppc/ChangeLog
@@ -1,3 +1,7 @@
+2016-11-24  John Baldwin  <jhb@FreeBSD.org>
+
+	* sim_calls.c (error): New function.
+
 2016-01-10  Mike Frysinger  <vapier@gentoo.org>
 
 	* configure.ac (sim-assert): Call AC_MSG_CHECKING,
diff --git a/sim/ppc/sim_calls.c b/sim/ppc/sim_calls.c
index 470c958..eb5d1a7 100644
--- a/sim/ppc/sim_calls.c
+++ b/sim/ppc/sim_calls.c
@@ -386,6 +386,16 @@ sim_io_error (SIM_DESC sd, const char *fmt, ...)
 
 /****/
 
+void NORETURN
+error (const char *msg, ...)
+{
+  va_list ap;
+  va_start(ap, msg);
+  callbacks->evprintf_filtered (callbacks, msg, ap);
+  va_end(ap);
+  callbacks->error (callbacks, "");
+}
+
 void *
 zalloc(long size)
 {
-- 
2.9.2


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]