This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH v2] Define an error function in the PPC simulator library.
- From: John Baldwin <jhb at FreeBSD dot org>
- To: gdb-patches at sourceware dot org
- Date: Wed, 5 Apr 2017 09:33:32 -0700
- Subject: [PATCH v2] Define an error function in the PPC simulator library.
- Authentication-results: sourceware.org; auth=none
Previously this used the error function from GDB directly when linked
against GDB 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:
PR sim/20863
* sim_calls.c (error): New function.
---
sim/ppc/ChangeLog | 5 +++++
sim/ppc/sim_calls.c | 10 ++++++++++
2 files changed, 15 insertions(+)
diff --git a/sim/ppc/ChangeLog b/sim/ppc/ChangeLog
index c0bb1f5b8b..8ad90077c0 100644
--- a/sim/ppc/ChangeLog
+++ b/sim/ppc/ChangeLog
@@ -1,3 +1,8 @@
+2017-04-04 John Baldwin <jhb@FreeBSD.org>
+
+ PR sim/20863
+ * sim_calls.c (error): New function.
+
2017-02-13 Mike Frysinger <vapier@gentoo.org>
* cpu.h: Include libiberty.h.
diff --git a/sim/ppc/sim_calls.c b/sim/ppc/sim_calls.c
index 470c95862a..eb5d1a792b 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.11.0