From patchwork Thu Jun 11 11:33:28 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Frysinger X-Patchwork-Id: 7112 X-Patchwork-Delegate: vapier@gentoo.org Received: (qmail 62111 invoked by alias); 11 Jun 2015 11:33:35 -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 62102 invoked by uid 89); 11 Jun 2015 11:33:34 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL, BAYES_00, SPF_PASS, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: smtp.gentoo.org Received: from smtp.gentoo.org (HELO smtp.gentoo.org) (140.211.166.183) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Thu, 11 Jun 2015 11:33:33 +0000 Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with ESMTP id 785B0340BB0 for ; Thu, 11 Jun 2015 11:33:31 +0000 (UTC) From: Mike Frysinger To: gdb-patches@sourceware.org Subject: [PATCH] sim: mn10300: delete unused exception/exited/debug state Date: Thu, 11 Jun 2015 07:33:28 -0400 Message-Id: <1434022408-5502-1-git-send-email-vapier@gentoo.org> X-IsSubscribed: yes The syscall path was the only code checking the custom exception state after recent cleanups. Once we change that to the common engine halt function, we can delete that state entirely. This also helps highlight some other dead code that we can cull. Committed. --- sim/mn10300/ChangeLog | 9 +++++++++ sim/mn10300/interp.c | 1 - sim/mn10300/mn10300_sim.h | 12 ------------ sim/mn10300/op_utils.c | 11 ++--------- 4 files changed, 11 insertions(+), 22 deletions(-) diff --git a/sim/mn10300/ChangeLog b/sim/mn10300/ChangeLog index 1facba7..c32c69e 100644 --- a/sim/mn10300/ChangeLog +++ b/sim/mn10300/ChangeLog @@ -1,5 +1,14 @@ 2015-06-11 Mike Frysinger + * interp.c (mn10300_debug): Delete. + * mn10300_sim.h (DEBUG_TRACE, DEBUG_VALUES, mn10300_debug): Delete. + (struct _state): Delete exception and exited members. + [_WIN32] (SIGTRAP, SIGQUIT): Delete. + * op_utils.c (do_syscall): Call sim_engine_halt instead of setting + State.exception. + +2015-06-11 Mike Frysinger + * mn10300_sim.h (uint8, int8, uint16, int16, uint32, int32): Typedef in terms of unsigned8, signed8, unsigned16, signed16, unsigned32, and signed32 respectively. diff --git a/sim/mn10300/interp.c b/sim/mn10300/interp.c index e5a90b5..f6f093d 100644 --- a/sim/mn10300/interp.c +++ b/sim/mn10300/interp.c @@ -25,7 +25,6 @@ host_callback *mn10300_callback; -int mn10300_debug; struct _state State; diff --git a/sim/mn10300/mn10300_sim.h b/sim/mn10300/mn10300_sim.h index 5f5d5d1..23b8cc2 100644 --- a/sim/mn10300/mn10300_sim.h +++ b/sim/mn10300/mn10300_sim.h @@ -11,11 +11,6 @@ extern host_callback *mn10300_callback; extern SIM_DESC simulator; -#define DEBUG_TRACE 0x00000001 -#define DEBUG_VALUES 0x00000002 - -extern int mn10300_debug; - typedef unsigned8 uint8; typedef signed8 int8; typedef unsigned16 uint16; @@ -53,8 +48,6 @@ struct _state dword fd[16]; /* FD0,2,...,30 */ } fpregs; uint8 *mem; /* main memory */ - int exception; - int exited; /* All internal state modified by signal_exception() that may need to be rolled back for passing moment-of-exception image back to gdb. */ @@ -148,11 +141,6 @@ extern struct simops Simops[]; #define FPU2FS(F,FS) sim_fpu_to32 (&(FS), &(F)) #define FPU2FD(F,FD) sim_fpu_to232 (&((FD).high), &((FD).low), &(F)) -#ifdef _WIN32 -#define SIGTRAP 5 -#define SIGQUIT 3 -#endif - #define FETCH32(a,b,c,d) \ ((a)+((b)<<8)+((c)<<16)+((d)<<24)) diff --git a/sim/mn10300/op_utils.c b/sim/mn10300/op_utils.c index 36f387c..518df9b 100644 --- a/sim/mn10300/op_utils.c +++ b/sim/mn10300/op_utils.c @@ -194,15 +194,8 @@ do_syscall (void) if ( FUNC == TARGET_SYS_exit ) { /* EXIT - caller can look in PARM1 to work out the reason */ - if (PARM1 == 0xdead) - State.exception = SIGABRT; - else - { - sim_engine_halt (simulator, STATE_CPU (simulator, 0), NULL, PC, - sim_exited, PARM1); - State.exception = SIGQUIT; - } - State.exited = 1; + sim_engine_halt (simulator, STATE_CPU (simulator, 0), NULL, PC, + (PARM1 == 0xdead ? SIM_SIGABRT : sim_exited), PARM1); } else {