From patchwork Sun Sep 16 19:46:27 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Frysinger X-Patchwork-Id: 184146 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 049E52C0084 for ; Mon, 17 Sep 2012 05:46:34 +1000 (EST) Received: from localhost ([::1]:59825 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TDKnY-0003Ym-2S for incoming@patchwork.ozlabs.org; Sun, 16 Sep 2012 15:46:32 -0400 Received: from eggs.gnu.org ([208.118.235.92]:35444) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TDKnP-0003Yf-Ku for qemu-devel@nongnu.org; Sun, 16 Sep 2012 15:46:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TDKnO-0005ue-Ny for qemu-devel@nongnu.org; Sun, 16 Sep 2012 15:46:23 -0400 Received: from smtp.gentoo.org ([140.211.166.183]:44700) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TDKnO-0005uZ-I1 for qemu-devel@nongnu.org; Sun, 16 Sep 2012 15:46:22 -0400 Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with ESMTP id 4DB8F33C2E1 for ; Sun, 16 Sep 2012 19:46:21 +0000 (UTC) From: Mike Frysinger To: qemu-devel@nongnu.org Date: Sun, 16 Sep 2012 15:46:27 -0400 Message-Id: <1347824787-1160-1-git-send-email-vapier@gentoo.org> X-Mailer: git-send-email 1.7.9.7 In-Reply-To: <50558042.6030008@web.de> References: <50558042.6030008@web.de> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 140.211.166.183 Subject: [Qemu-devel] [PATCH] include address in invalid memory region accesses X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org The current code to display invalid memory accesses isn't terribly useful as it doesn't tell you what address is actually being accessed. Include it in the error message. Signed-off-by: Mike Frysinger --- memory.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/memory.c b/memory.c index d528d1f..0ea0320 100644 --- a/memory.c +++ b/memory.c @@ -998,7 +998,9 @@ static uint64_t invalid_read(void *opaque, target_phys_addr_t addr, MemoryRegion *mr = opaque; if (!mr->warning_printed) { - fprintf(stderr, "Invalid read from memory region %s\n", mr->name); + fprintf(stderr, + "Invalid read from memory region %s at %#" TARGET_PRIxPHYS "\n", + mr->name, addr); mr->warning_printed = true; } return -1U; @@ -1010,7 +1012,9 @@ static void invalid_write(void *opaque, target_phys_addr_t addr, uint64_t data, MemoryRegion *mr = opaque; if (!mr->warning_printed) { - fprintf(stderr, "Invalid write to memory region %s\n", mr->name); + fprintf(stderr, + "Invalid write to memory region %s at %#" TARGET_PRIxPHYS "\n", + mr->name, addr); mr->warning_printed = true; } }