From patchwork Wed Apr 5 16:33:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Baldwin X-Patchwork-Id: 19870 Received: (qmail 19196 invoked by alias); 5 Apr 2017 16:34:20 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 19187 invoked by uid 89); 5 Apr 2017 16:34:19 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-23.8 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_HELO_PASS, SPF_SOFTFAIL autolearn=ham version=3.3.2 spammy=sim, 3866, **** X-HELO: mail.baldwin.cx Received: from bigwig.baldwin.cx (HELO mail.baldwin.cx) (96.47.65.170) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 05 Apr 2017 16:34:12 +0000 Received: from ralph.baldwin.cx.com (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by mail.baldwin.cx (Postfix) with ESMTPSA id 2D58E10A888 for ; Wed, 5 Apr 2017 12:34:12 -0400 (EDT) From: John Baldwin To: gdb-patches@sourceware.org Subject: [PATCH v2] Define an error function in the PPC simulator library. Date: Wed, 5 Apr 2017 09:33:32 -0700 Message-Id: <20170405163332.82109-1-jhb@FreeBSD.org> X-IsSubscribed: yes 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 + + PR sim/20863 + * sim_calls.c (error): New function. + 2017-02-13 Mike Frysinger * 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) {