Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: John Baldwin <jhb@FreeBSD.org>
To: gdb-patches@sourceware.org
Subject: [PATCH v2] Define an error function in the PPC simulator library.
Date: Wed, 05 Apr 2017 16:34:00 -0000	[thread overview]
Message-ID: <20170405163332.82109-1-jhb@FreeBSD.org> (raw)

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


             reply	other threads:[~2017-04-05 16:34 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-05 16:34 John Baldwin [this message]
2017-04-13 13:25 ` Luis Machado
2017-04-14 18:02   ` John Baldwin
2017-05-05 19:51     ` John Baldwin
2017-05-19 16:28       ` [PING] " John Baldwin
2017-06-06 17:49         ` John Baldwin
2017-06-23  6:39           ` Sebastian Huber
2017-09-04 14:19     ` Pedro Alves
2017-09-05  3:00       ` John Baldwin
2017-09-05  9:14         ` Pedro Alves
2017-09-05 11:46           ` John Baldwin
2017-09-05 19:38             ` Joel Brobecker

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=20170405163332.82109-1-jhb@FreeBSD.org \
    --to=jhb@freebsd.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