From patchwork Thu Dec 21 08:30:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 851823 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 3z2Q5Z6nQjz9sR8 for ; Thu, 21 Dec 2017 19:38:25 +1100 (AEDT) Received: from localhost ([::1]:39304 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRwMw-0001Pu-Co for incoming@patchwork.ozlabs.org; Thu, 21 Dec 2017 03:38:22 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60313) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRwFz-0004TU-PB for qemu-devel@nongnu.org; Thu, 21 Dec 2017 03:31:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eRwFv-0003KQ-Ko for qemu-devel@nongnu.org; Thu, 21 Dec 2017 03:31:11 -0500 Received: from mout.kundenserver.de ([212.227.126.187]:58075) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eRwFv-0003Jk-B2 for qemu-devel@nongnu.org; Thu, 21 Dec 2017 03:31:07 -0500 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue002 [212.227.15.167]) with ESMTPSA (Nemesis) id 0LibhV-1ezuYt3Btd-00cujL; Thu, 21 Dec 2017 09:31:03 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Thu, 21 Dec 2017 09:30:57 +0100 Message-Id: <20171221083057.17942-1-laurent@vivier.eu> X-Mailer: git-send-email 2.14.3 MIME-Version: 1.0 X-Provags-ID: V03:K0:v2tJ+zJj/p+xM0+4aS8P9e2L9afW/33AaTHMMvlkV3I6x0l6a46 VmyayGdtyjtr9AEFKBml0yN4XpDHhEkb/xuVpTzGh+kY6rV/h2loQPsjkHm8Ln/OumUVozE QIJtvj+G+1idetpiQjTjgWxdmF1oRpCDj5hJhAoEjOT6tpDKlJB6EivZFQBJoga3CguO+Nj m5nUtdAFiCWX7a0ILwIoA== X-UI-Out-Filterresults: notjunk:1; V01:K0:/s/AreNhfLE=:IGXxbv5PdcMBPlr/kjoXXu s08CXGQ6aweJOOa9uJrpGUEID9B+tKVFi7+jO80IUrqAH+NH9YJHmW1Kh2IpS31E38FPCCHQo P60n0vbiDjmN9iQMxvW2LvOq15HLZY4LKHjRAslPy6plVFA7gq5OtmGbRQdHireWnVA+GoX18 BckyDm735FzKycFoc8sv6ki3ny0TOzewbmN6g352lUGXcks2ZBcOEJmxdpRdKawVLSLlKPF2E pIF87jMUldxDdvkYb6Btd/V69TdtOYznLBdb/4SVgWfrSCekDBhwrwZsyfv2zYt8+rpdwwEw6 MriEREH29b8vlYW+Cl3irXv7JHgGWUvrKla2ichsm/r+Cms5trNVEGceK3CT9BkTrymPU9n7G msXNhlNrRF2beMHFF1KHHmYKOubrJv+nkyB4lY7iY9T2y+izpzxusf7O3UyMUg6a5+WdDIK9G fAYSSgbQ6PBYHvEvrtrcOWWWsoPWB4NGeLTcpe0xJnf4celgjFxZqdU8bV6MM8+8g2WQRz39Y Smxxyhq4phJZBga1C6L7GU5MttxHoIozjT2VEqYGePod6dL4oKWvyYs4qKhOGAW4arPwWZXcN VHhFrnIzcQtj6Z9VYKUOtQjUbvZpHdyMsolE1i1GvrdfQPpNMWUzg6RDEiiEW67uBt+djmUGy cKm3xQGzzUURH3M5XR5NJGqeYWZ5fL4QazLNm3RFrSaeCDWDgpCwYL7cwOWO0G0mDNsDf3a9R +RN7ktxiPpAd1sVFvba+cg9LM23XiaDAdUOrboVJJeTz33l4SDpScaLihOQ= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 212.227.126.187 Subject: [Qemu-devel] [PATCH v2] 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: Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?b?w6k=?= , 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 --- v2: change license to GPL 2 and later add static 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; +}