From patchwork Mon Sep 4 14:16:51 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anthony Green X-Patchwork-Id: 22601 Received: (qmail 62522 invoked by alias); 4 Sep 2017 14:17:00 -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 62498 invoked by uid 89); 4 Sep 2017 14:16:59 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.1 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.2 spammy= X-HELO: mail-lf0-f52.google.com Received: from mail-lf0-f52.google.com (HELO mail-lf0-f52.google.com) (209.85.215.52) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 04 Sep 2017 14:16:54 +0000 Received: by mail-lf0-f52.google.com with SMTP id m199so2319687lfe.3 for ; Mon, 04 Sep 2017 07:16:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=wtRkCmGt886magzwnmXTwtp0Gm8ZeKkmyRrtwkREuCk=; b=AB/5urtngaivD4al0dfmF8p161AuesK4m72EOyoZ5UUGze1sjXekMomVOGJ9q4e0IT w+jFSbmONG1Ve6pYmSIIon+OM5Q6ek2ExjNf1BF5yJHohLwAzue3IVip1ytJJF/K4DaZ Zhkzm7g7Jr20OYADeOIbCK82kON61Bluz3tTQwUpA3Re3Aty6fvrlX8bkIiCNqmcbbtk qucsIri74Gap1vkM1QBMFNvj6vgAUXwfEmQKEgWnikFFzDZtOdaFS12iP7gQsfHaHLF0 FdlkHkUCtYGDBcvJwooOeHkCQ+r34fCLq1a6Qf9vumSIEEMX7Hial8/vjEoGOiWczDeG Y6KQ== X-Gm-Message-State: AHPjjUjl2K6DjERi2wpDkEC8ByS672sXfvFwuRBTtqw2gssUGg2rwKjD 6DB6nkuvkbvb2BfIwO4fBdfrWsQxTw0JWhw= X-Google-Smtp-Source: ADKCNb7DyXHcRF8bkIsEGE8WvKNunlvFqEbq7Q5P50hi+XudNzJ6SPX5jYiYyp2RJuUtyUAM7lYLArmADXYUqbQ9FLk= X-Received: by 10.46.92.3 with SMTP id q3mr268073ljb.41.1504534612103; Mon, 04 Sep 2017 07:16:52 -0700 (PDT) MIME-Version: 1.0 Received: by 10.25.242.6 with HTTP; Mon, 4 Sep 2017 07:16:51 -0700 (PDT) From: Anthony Green Date: Mon, 4 Sep 2017 10:16:51 -0400 Message-ID: Subject: [PATCH, committed] moxie sim: fix stepping To: gdb-patches@sourceware.org X-IsSubscribed: yes I'm checking in the attached patch which fixes stepping within the moxie simulator. I'm not sure when this regression was introduced, but the simulator aborts in sim_events_preprocess() without this change. AG 2017-09-03 Anthony Green * interp.c (sim_engine_run): Always pass scpu into sim_engine_halt. Process events within inner loop. diff --git a/sim/moxie/interp.c b/sim/moxie/interp.c index c9605d4c47..217aef36f7 100644 --- a/sim/moxie/interp.c +++ b/sim/moxie/interp.c @@ -343,7 +343,7 @@ sim_engine_run (SIM_DESC sd, default: { MOXIE_TRACE_INSN ("SIGILL3"); - sim_engine_halt (sd, NULL, NULL, pc, sim_stopped, SIM_SIGILL); + sim_engine_halt (sd, scpu, NULL, pc, sim_stopped, SIM_SIGILL); break; } } @@ -394,7 +394,7 @@ sim_engine_run (SIM_DESC sd, break; default: MOXIE_TRACE_INSN ("SIGILL2"); - sim_engine_halt (sd, NULL, NULL, pc, sim_stopped, SIM_SIGILL); + sim_engine_halt (sd, scpu, NULL, pc, sim_stopped, SIM_SIGILL); break; } } @@ -408,7 +408,7 @@ sim_engine_run (SIM_DESC sd, case 0x00: /* bad */ opc = opcode; MOXIE_TRACE_INSN ("SIGILL0"); - sim_engine_halt (sd, NULL, NULL, pc, sim_stopped, SIM_SIGILL); + sim_engine_halt (sd, scpu, NULL, pc, sim_stopped, SIM_SIGILL); break; case 0x01: /* ldi.l (immediate) */ { @@ -666,7 +666,7 @@ sim_engine_run (SIM_DESC sd, { opc = opcode; MOXIE_TRACE_INSN ("SIGILL0"); - sim_engine_halt (sd, NULL, NULL, pc, sim_stopped, SIM_SIGILL); + sim_engine_halt (sd, scpu, NULL, pc, sim_stopped, SIM_SIGILL); break; } case 0x19: /* jsr */ @@ -933,7 +933,7 @@ sim_engine_run (SIM_DESC sd, { case 0x1: /* SYS_exit */ { - sim_engine_halt (sd, NULL, NULL, pc, sim_exited, + sim_engine_halt (sd, scpu, NULL, pc, sim_exited, cpu.asregs.regs[2]); break; } @@ -1046,7 +1046,7 @@ sim_engine_run (SIM_DESC sd, break; case 0x35: /* brk */ MOXIE_TRACE_INSN ("brk"); - sim_engine_halt (sd, NULL, NULL, pc, sim_stopped, SIM_SIGTRAP); + sim_engine_halt (sd, scpu, NULL, pc, sim_stopped, SIM_SIGTRAP); pc -= 2; /* Adjust pc */ break; case 0x36: /* ldo.b */ @@ -1100,7 +1100,7 @@ sim_engine_run (SIM_DESC sd, default: opc = opcode; MOXIE_TRACE_INSN ("SIGILL1"); - sim_engine_halt (sd, NULL, NULL, pc, sim_stopped, SIM_SIGILL); + sim_engine_halt (sd, scpu, NULL, pc, sim_stopped, SIM_SIGILL); break; } } @@ -1108,6 +1108,10 @@ sim_engine_run (SIM_DESC sd, cpu.asregs.insts++; pc += 2; cpu.asregs.regs[PC_REGNO] = pc; + + if (sim_events_tick (sd)) + sim_events_process (sd); + } while (1); }