From patchwork Thu Dec 21 19:36:38 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 852098 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3z2hmm1HRgz9s84 for ; Fri, 22 Dec 2017 06:39:51 +1100 (AEDT) Received: from localhost ([::1]:37807 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eS6h3-00089O-UA for incoming@patchwork.ozlabs.org; Thu, 21 Dec 2017 14:39:49 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60782) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eS6eB-0006Ab-4J for qemu-devel@nongnu.org; Thu, 21 Dec 2017 14:36:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eS6e7-0005bz-5R for qemu-devel@nongnu.org; Thu, 21 Dec 2017 14:36:51 -0500 Received: from mout.kundenserver.de ([212.227.126.131]:57399) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eS6e6-0005al-Pp for qemu-devel@nongnu.org; Thu, 21 Dec 2017 14:36:47 -0500 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue006 [212.227.15.167]) with ESMTPSA (Nemesis) id 0Mfwoa-1eeHqT1E8q-00NCJb; Thu, 21 Dec 2017 20:36:45 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Thu, 21 Dec 2017 20:36:38 +0100 Message-Id: <20171221193640.27418-4-laurent@vivier.eu> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20171221193640.27418-1-laurent@vivier.eu> References: <20171221193640.27418-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K0:hx4zbjipZsc3pH59GeSJboC0kJPkKLd8eH4uDnQeBW3Eb3df0ER h9fZjnT5HCvkO+hDrlmqJuwSZMb6+zI7KbWv8UGGlJrBZbS5/ZGmDm2XzHCetEf3Bt/v0bu RUzAVh+N+7jJy7gJADx59vr3Er2/Rij10ZXRepVAh6f/9F1WYNAQu8i8jsD0eX22jzd4wni 6dHhD309tx+IHESUZP3UA== X-UI-Out-Filterresults: notjunk:1; V01:K0:4sVQZATrt+M=:nz3BTgDWo1oDU5cGwLsFjN 0uNve27thNie/c45xDw+Xvila8zcGa0IRls4p8cZSOxUgaDeKpkbaBZhl3iI0pR4SfxWVCy3u AwWRAdwBK6hqr5bK33i8nk5eFDxZycnZtr69Zpmx9SrlVFclb+YBC7gyheHWtOPDGB7KP70Nb 3CP1/KLaH/HyDmRQH6PP8L7NrEnyzpFYq7CPyI038hyH/18HTa7GC0neTJaxBAliB6NQGN1fz aBgiKpMk6KY4Al6es7y0m1mJysj/MOxX6sKOQXXmvQ7JO3O1FYzHRg3xWJ6ZDrFet+ZU3eQQT SnBBV4Ez74iQk0xkwExxZmi21n8ub4wo0RpkYog6OUAanU94CHP+8rDr+zyrpJxl+i2PBhJdJ aNKCFRA3dZjCPH+M5bdvunr8Q4Yn8lWVNJBcmiEA6ZEzK94eIsHw22pDLyszrEfmNjJ88oiJ/ AmtdOuhOmVBiXuzCJ2uZczuKpTDtMEp6CzKW2xSZm8QjFKb3FOZUxTZMRmauKikq2hcAfVL8Q KqoeEb1Xae+MXEof5Mk+YHsVhbKDRsMkczv9z1/V6j1ALkV2ELQDzVcEskSIqz2kYwZofeg8A XX0V6KWxix8Ft+V48+NvADYrdGmaW8G4280woA7kFkvJY9YCve/Xzc0dVIVRRdn8aqL6wFRtP FoOhJdqOxeE37jqRVJnTkIxsc8suy0zGmL3z/8vaTfJg9h9hlArpFuaWN5NIOvL8r5QIzOpcR 48KTBgMAEYD47L4pF90bW0/ePOBTENEz/d2TusVwGz+QUGuKj89MyqM+VfrE8klk7ufgG7kH5 Hz3Mtm/ X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 212.227.126.131 Subject: [Qemu-devel] [PULL 3/5] target/m68k: add monitor.c X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" This allows to use registers content in the monitor. Example: BEFORE: (qemu) print $d0 unknown register AFTER: (qemu) print $d0 0 (qemu) print $sr 0x2000 (qemu) x/10i $pc 0x40010a2a: movew %sr,%d0 0x40010a2c: oril #1792,%d0 0x40010a32: movew %d0,%sr 0x40010a34: movel %a0@,%d0 0x40010a36: btst #3,%d0 0x40010a3a: beqs 0x40010a26 0x40010a3c: movew %sr,%d0 0x40010a3e: andil #63743,%d0 0x40010a44: movew %d0,%sr 0x40010a46: rts Signed-off-by: Laurent Vivier Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Thomas Huth Message-Id: <20171221083057.17942-1-laurent@vivier.eu> --- target/m68k/Makefile.objs | 1 + target/m68k/monitor.c | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 target/m68k/monitor.c diff --git a/target/m68k/Makefile.objs b/target/m68k/Makefile.objs index 39141ab93d..d143f20270 100644 --- a/target/m68k/Makefile.objs +++ b/target/m68k/Makefile.objs @@ -1,3 +1,4 @@ obj-y += m68k-semi.o obj-y += translate.o op_helper.o helper.o cpu.o fpu_helper.o obj-y += gdbstub.o +obj-$(CONFIG_SOFTMMU) += monitor.o diff --git a/target/m68k/monitor.c b/target/m68k/monitor.c new file mode 100644 index 0000000000..5605323a81 --- /dev/null +++ b/target/m68k/monitor.c @@ -0,0 +1,39 @@ +/* + * QEMU monitor for m68k + * + * This work is licensed under the terms of the GNU GPL, version 2 or + * later. See the COPYING file in the top-level directory. + */ + +#include "qemu/osdep.h" +#include "cpu.h" +#include "monitor/hmp-target.h" + +static const MonitorDef monitor_defs[] = { + { "d0", offsetof(CPUM68KState, dregs[0]) }, + { "d1", offsetof(CPUM68KState, dregs[1]) }, + { "d2", offsetof(CPUM68KState, dregs[2]) }, + { "d3", offsetof(CPUM68KState, dregs[3]) }, + { "d4", offsetof(CPUM68KState, dregs[4]) }, + { "d5", offsetof(CPUM68KState, dregs[5]) }, + { "d6", offsetof(CPUM68KState, dregs[6]) }, + { "d7", offsetof(CPUM68KState, dregs[7]) }, + { "a0", offsetof(CPUM68KState, aregs[0]) }, + { "a1", offsetof(CPUM68KState, aregs[1]) }, + { "a2", offsetof(CPUM68KState, aregs[2]) }, + { "a3", offsetof(CPUM68KState, aregs[3]) }, + { "a4", offsetof(CPUM68KState, aregs[4]) }, + { "a5", offsetof(CPUM68KState, aregs[5]) }, + { "a6", offsetof(CPUM68KState, aregs[6]) }, + { "a7", offsetof(CPUM68KState, aregs[7]) }, + { "pc", offsetof(CPUM68KState, pc) }, + { "sr", offsetof(CPUM68KState, sr) }, + { "ssp", offsetof(CPUM68KState, sp[0]) }, + { "usp", offsetof(CPUM68KState, sp[1]) }, + { NULL }, +}; + +const MonitorDef *target_monitor_defs(void) +{ + return monitor_defs; +}