From patchwork Wed Dec 20 20:35:28 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 10126551 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id F0F2C6019C for ; Wed, 20 Dec 2017 20:36:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E3DD729225 for ; Wed, 20 Dec 2017 20:36:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D847E29237; Wed, 20 Dec 2017 20:36:21 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 42A4229225 for ; Wed, 20 Dec 2017 20:36:20 +0000 (UTC) Received: from localhost ([::1]:40222 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRl6C-0007qi-5D for patchwork-qemu-devel@patchwork.kernel.org; Wed, 20 Dec 2017 15:36:20 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50143) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRl5W-0007Tl-MT for qemu-devel@nongnu.org; Wed, 20 Dec 2017 15:35:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eRl5S-0000Zt-Mh for qemu-devel@nongnu.org; Wed, 20 Dec 2017 15:35:38 -0500 Received: from mout.kundenserver.de ([217.72.192.74]:58306) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eRl5S-0000Yo-5e for qemu-devel@nongnu.org; Wed, 20 Dec 2017 15:35:34 -0500 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue102 [212.227.15.183]) with ESMTPSA (Nemesis) id 0LcgwZ-1essqL11uR-00k5sS; Wed, 20 Dec 2017 21:35:30 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Wed, 20 Dec 2017 21:35:28 +0100 Message-Id: <20171220203528.21334-1-laurent@vivier.eu> X-Mailer: git-send-email 2.14.3 X-Provags-ID: V03:K0:dU2z0Si2t1VPtJdu1TLAX1ELvdLVszTOtSRWpCBkGcYEmiUYO6J 6BMMDRNEYFXMtgEgi4aMahsU0OHOnACBMlNTxokZggzixv/KnFg4Yfjbi25b6mD1lw4LhXI 6I0X/H2odWvoRvNMmySdnik+yKyFU5AgoZx/VIXVXl485helnRAtl6bRj7aaeSWsWDieowp ksmr/I8nJ/b97UQ2MMOzA== X-UI-Out-Filterresults: notjunk:1; V01:K0:4rV9o/fFi58=:0gLHbWyKnP1Ow6L8pSYmeD Ze8MRqa/4ijDKO5KK5tMBB1vdcBveCUyzFMjSwZCzzcDkXA9rjs6+Xt+CYxDI9y9z0Y/UWIYu EalXVnKp0V8rpVJXIWhhbVcN50Hy/cRY7WlrIQ/718wMScbB//JuKjtaf/2I/939m5zPjcdqA Pf16BqkAM6jTGA1aohcVVhd3TEINbrxG6lGzoWPWKcz+lzerRSJJ7qLKuGIJihtCoqtk/azTi nHYe4DfJCgm3vrRnas3Xv5C5qg74lscxRpc2FF7RBnmZuUn2TUqNbK5Dflw5b7SWynl6PYp7H SMLnm38Ww8ZNvMV27Fn+XK84a1e6DOxdgG/PovY2s5M8CB3YrzjM3SwRy/lQF5CzlMkSz7UPW EzwvBHC8G59QYfyC3U2Sd7CH1RGv7GhL/2XNQwQ4Vk4EIupYzQBKg2Rzz4qTrNoDcNH5kFP08 KvQAj7J/cx8sTKqFkxTc8wzEZYhwyA4qWi6lPTD47pS/Cbo49xbdMSIfdqBbhoePfgjMhcsUv joQnewAFmk943qrshaxnUOtmc/81CkJn1OBynBD2WcCrk9nM6PYF3XK4YAYa1EI3HJKn2BiaL E8UYjhA+RfEZpT6Ergi99tFqi/mu58RM45FtyJNkwRPg4y4K0fLfZVt7b3mw7uWuYyPHQhsA/ r/OQLNFNM4shva/tp/dzzJ0qsC7zL5PjotshtcXRaEeStHItSWsot4uqMjAuljHATavwPJMv4 3DqXCoJMGKocTGoxyfawp9tHCz4FF5rfhFexCA== X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 217.72.192.74 Subject: [Qemu-devel] [PATCH] 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=20Mathieu-Daud=C3=A9?= , Laurent Vivier Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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 --- target/m68k/Makefile.objs | 1 + target/m68k/monitor.c | 55 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 56 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..03d037ccab --- /dev/null +++ b/target/m68k/monitor.c @@ -0,0 +1,55 @@ +/* + * QEMU monitor + * + * Copyright (c) 2003-2004 Fabrice Bellard + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +#include "qemu/osdep.h" +#include "cpu.h" +#include "monitor/hmp-target.h" + +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; +}