From patchwork Fri Jun 22 04:51:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rashmica Gupta X-Patchwork-Id: 933101 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41BmPY4Vfxz9s47 for ; Fri, 22 Jun 2018 14:51:45 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="O+XnoGU8"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 41BmPY2w93zF0wy for ; Fri, 22 Jun 2018 14:51:45 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="O+XnoGU8"; dkim-atps=neutral X-Original-To: pdbg@lists.ozlabs.org Delivered-To: pdbg@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:400e:c00::22c; helo=mail-pf0-x22c.google.com; envelope-from=rashmica.g@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="O+XnoGU8"; dkim-atps=neutral Received: from mail-pf0-x22c.google.com (mail-pf0-x22c.google.com [IPv6:2607:f8b0:400e:c00::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 41BmPW07WGzF0Vt for ; Fri, 22 Jun 2018 14:51:42 +1000 (AEST) Received: by mail-pf0-x22c.google.com with SMTP id a12-v6so2603789pfi.3 for ; Thu, 21 Jun 2018 21:51:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=b6qzQUrmh/2FizEQ9kncMqLoMDLMz70G70UDOTmmn2Y=; b=O+XnoGU8HbbTmn6mvtPwrkJZsscL18+/zBFIpGA2JOAGTFFRuXc6k1QiGAWkyn9gv5 Fq9PSf+WpKMhLDRUEsnxY9YV138PKffRslAqRY63c/VCWNpA96BIXImUraYQ7VXptZoC UVjJyMDO8FFM1oxnHnewEXN947iJ/T9qIx2bjJnzzjDOmtjj7yQ9wVCjB8++3JVepMX6 TTtUlzh/y/ucdqCQnEIfxasILYfZ3ap2bbuwYSTlj12Jk12dxIB4YwpLxgIGWcQFsLDq 1UVZVQsfUgHhOyR00UU8iAgslrxaQ+hSeAienN8JcIV4cI2Z6xz1jpvdNHpkReoQpmeo x0qA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=b6qzQUrmh/2FizEQ9kncMqLoMDLMz70G70UDOTmmn2Y=; b=h+7l94l4UqAVGh/eBM/c7chZ4CCYJiU3M8F/XZnkI+XufuD8VJfuEm3HWfkMtugjXl DKfiLoTPABWj7YPtiR+8u18vemm1LkOaBTmWxiiZpvu7CjSRxuWS6UDt5Ece6qFaYdpw 58aLhx6Ol7L4+Hm0Zv/EjcHgPhYiJzC5r1h0hk/7dzw1rqzWGH9yJzGhU7rKYC3waVuA vhVUPZBi+pDNDwnwJY8T7cIck8JdHpBE6gv8yTMyg5Clit+o2ErpoyNSckVi2FCyzQNn kct76FPMXchLd5QluVdG1Q2wl0sPCl3rHI4H8PKxL8EoZf39LfjO2pMMPnDRGZ7CsHqW YwHg== X-Gm-Message-State: APt69E0IxBb6RFAzQvlobjOX/rtbrcZt0wA8337+TyIOQhARrSZGLEeM l4/QHhqUzF2sheFzIT4UlbFwcA== X-Google-Smtp-Source: ADUXVKKXddytiU7c46GKXZ0VDX9TiEVDM+tmUdnl2RFIiSzLPPKwlEJvBWztNng1sxU5U46nAcgISQ== X-Received: by 2002:a65:4081:: with SMTP id t1-v6mr60960pgp.32.1529643100710; Thu, 21 Jun 2018 21:51:40 -0700 (PDT) Received: from rashmica.ozlabs.ibm.com ([122.99.82.10]) by smtp.gmail.com with ESMTPSA id v27-v6sm11874992pfi.23.2018.06.21.21.51.39 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 Jun 2018 21:51:40 -0700 (PDT) From: Rashmica Gupta To: pdbg@lists.ozlabs.org Date: Fri, 22 Jun 2018 14:51:09 +1000 Message-Id: <20180622045116.12059-2-rashmica.g@gmail.com> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20180622045116.12059-1-rashmica.g@gmail.com> References: <20180622045116.12059-1-rashmica.g@gmail.com> Subject: [Pdbg] [PATCH 1/8] libpdbg: Print the name of the instruction when erroring X-BeenThere: pdbg@lists.ozlabs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "mailing list for https://github.com/open-power/pdbg development" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: pdbg-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Pdbg" Signed-off-by: Rashmica Gupta --- libpdbg/chip.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/libpdbg/chip.c b/libpdbg/chip.c index f04bb15..4226cbf 100644 --- a/libpdbg/chip.c +++ b/libpdbg/chip.c @@ -29,7 +29,7 @@ static uint64_t mfspr(uint64_t reg, uint64_t spr) { if (reg > 31) - PR_ERROR("Invalid register specified\n"); + PR_ERROR("Invalid register specified for mfspr\n"); return MFSPR_OPCODE | (reg << 21) | ((spr & 0x1f) << 16) | ((spr & 0x3e0) << 6); } @@ -37,7 +37,7 @@ static uint64_t mfspr(uint64_t reg, uint64_t spr) static uint64_t mtspr(uint64_t spr, uint64_t reg) { if (reg > 31) - PR_ERROR("Invalid register specified\n"); + PR_ERROR("Invalid register specified for mtspr\n"); return MTSPR_OPCODE | (reg << 21) | ((spr & 0x1f) << 16) | ((spr & 0x3e0) << 6); } @@ -45,9 +45,9 @@ static uint64_t mtspr(uint64_t spr, uint64_t reg) static uint64_t mfocrf(uint64_t reg, uint64_t cr) { if (reg > 31) - PR_ERROR("Invalid register specified\n"); + PR_ERROR("Invalid register specified for mfocrf\n"); if (cr > 7) - PR_ERROR("Invalid register specified\n"); + PR_ERROR("Invalid CR field specified\n"); return MFOCRF_OPCODE | (reg << 21) | (1U << (12 + cr)); } @@ -55,7 +55,7 @@ static uint64_t mfocrf(uint64_t reg, uint64_t cr) static uint64_t mfnia(uint64_t reg) { if (reg > 31) - PR_ERROR("Invalid register specified\n"); + PR_ERROR("Invalid register specified for mfnia\n"); return MFNIA_OPCODE | (reg << 21); } @@ -63,7 +63,7 @@ static uint64_t mfnia(uint64_t reg) static uint64_t mtnia(uint64_t reg) { if (reg > 31) - PR_ERROR("Invalid register specified\n"); + PR_ERROR("Invalid register specified for mtnia\n"); return MTNIA_OPCODE | (reg << 21); } @@ -71,7 +71,7 @@ static uint64_t mtnia(uint64_t reg) static uint64_t mfmsr(uint64_t reg) { if (reg > 31) - PR_ERROR("Invalid register specified\n"); + PR_ERROR("Invalid register specified for mfmsr\n"); return MFMSR_OPCODE | (reg << 21); } @@ -79,7 +79,7 @@ static uint64_t mfmsr(uint64_t reg) static uint64_t mtmsr(uint64_t reg) { if (reg > 31) - PR_ERROR("Invalid register specified\n"); + PR_ERROR("Invalid register specified for mtmsr\n"); return MTMSR_OPCODE | (reg << 21); }