aboutsummaryrefslogtreecommitdiff
path: root/sim/ppc
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2017-09-04 19:53:50 -0700
committerJohn Baldwin <jhb@FreeBSD.org>2017-09-04 19:56:00 -0700
commit625ce09c1cfb557725310f602ee66ac1475d780e (patch)
tree319e01cb74c28fae3fcf1b9fb40a5b85cc6a02c5 /sim/ppc
parentEnable support for x86 debug registers on NetBSD. (diff)
downloadbinutils-gdb-625ce09c1cfb557725310f602ee66ac1475d780e.tar.gz
binutils-gdb-625ce09c1cfb557725310f602ee66ac1475d780e.tar.bz2
binutils-gdb-625ce09c1cfb557725310f602ee66ac1475d780e.zip
Define an error function in the PPC simulator library.
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. Note that there are also error functions in sim/ppc/main.c and sim/ppc/misc.c. The ppc libsim.a expects each consumer to provide several symbols used by the library including "error". sim-calls.c provides these symbols when the library is linked into gdb. The dgen, igen, tmp-filter, tmp-ld-decode, tmp-ld-cache, and tmp-ld-insn programs use the functions from misc.c. psim uses the functions from main.c. sim/ppc/ChangeLog: PR sim/20863 * sim_calls.c (error): New function.
Diffstat (limited to 'sim/ppc')
-rw-r--r--sim/ppc/ChangeLog5
-rw-r--r--sim/ppc/sim_calls.c10
2 files changed, 15 insertions, 0 deletions
diff --git a/sim/ppc/ChangeLog b/sim/ppc/ChangeLog
index c0bb1f5b8b4..9573e7ba048 100644
--- a/sim/ppc/ChangeLog
+++ b/sim/ppc/ChangeLog
@@ -1,3 +1,8 @@
+2017-09-05 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 470c95862a1..eb5d1a792b2 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)
{