From patchwork Thu May 31 05:29:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rashmica Gupta X-Patchwork-Id: 923187 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40xGHW1mF9z9s08 for ; Thu, 31 May 2018 15:29:43 +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="f/R3CE8p"; 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 40xGHW081vzDrbW for ; Thu, 31 May 2018 15:29:42 +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="f/R3CE8p"; 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::234; helo=mail-pf0-x234.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="f/R3CE8p"; dkim-atps=neutral Received: from mail-pf0-x234.google.com (mail-pf0-x234.google.com [IPv6:2607:f8b0:400e:c00::234]) (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 40xGHL74ptzDr30 for ; Thu, 31 May 2018 15:29:34 +1000 (AEST) Received: by mail-pf0-x234.google.com with SMTP id v63-v6so10178032pfk.8 for ; Wed, 30 May 2018 22:29:34 -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; bh=Kkiq5Kqa91wUShcZQu9H2zFZiEX3a3EoQCU3l315oSY=; b=f/R3CE8pSlpFm23gO2/47g8RwNNELtFbs1u6BwwJ6G/wsIhl/CXCSE3hsiZ8MMJo6z 9pnvPI0RT08zF8Y5x/t+F5BjODHAp6BQsL4UrS7WeDjnXOb1EF815MysGUgXy7vFg1Nl ZIvx9ED89WVo9+0za+GfB014c9eqNrgpZJANFoiAr/AzJ3NrSZegqn7HzLnNq/+En/FH O3fWRJuuCLEC4PHwtz9wTC+7PvXdS62QOz42X8jcx/aQFgP6Pq5YVj/ayKq3U2ZyeQjM bdbZk5CeNCyvQTp09mWAANz5ILwWqJqYX1dH1wR+Ciy0JHvDErf56lbiKhxQOSTNupyL tV6g== 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; bh=Kkiq5Kqa91wUShcZQu9H2zFZiEX3a3EoQCU3l315oSY=; b=Q6LXOv9FipQj11u4OZdzcsR44xC8SeZu+jD9V4J2GEK/tsSzgCramsGcK2R3wHT4sH IYM4IHO4ExIxBXVEQD+SCXEGExDuqu7kQ1zvp+cGRKGlh6Kq6d86v8gbjh0oPFPR7ZLs f24EfbqgSCi6map03tcJPA56pgAZIsUJcXGoo9toW+GhqjFiFy9Doj9rHAyKX3F7hSPp 8aG5i8G2ke5m8pu3e9QLFuJ9MwLgwTA/KJOuLCx2WKJsNKY/XDrSTMoQ0+4vqAXvXVxi jwqdaJQIszc5IKpyppVWsHcjy+bLgOoXKxZfo2M7HgzY8ogJEgX/aQJyW1y2TnMKtTs8 bNLw== X-Gm-Message-State: ALKqPwfiCc+HwdxeiePO3ZxhGMiwND/PU7QkIwXO21JE3ni2bgIByJhj DxtS0/I4SC36rcnL2L6kRNBMsw== X-Google-Smtp-Source: ADUXVKIm2jEA8zW0NzFMEuggqod1XYO9TeuVQfx+/PKfSvAEzDIND5PMUKxCJuKiRsGnmvq2RzHSww== X-Received: by 2002:a65:45c2:: with SMTP id m2-v6mr4336200pgr.189.1527744572246; Wed, 30 May 2018 22:29:32 -0700 (PDT) Received: from rashmica.ozlabs.ibm.com ([122.99.82.10]) by smtp.gmail.com with ESMTPSA id h10-v6sm4500515pgc.28.2018.05.30.22.29.30 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 30 May 2018 22:29:31 -0700 (PDT) From: Rashmica Gupta To: pdbg@lists.ozlabs.org Date: Thu, 31 May 2018 15:29:06 +1000 Message-Id: <20180531052915.31171-1-rashmica.g@gmail.com> X-Mailer: git-send-email 2.14.3 Subject: [Pdbg] [PATCH 01/10] 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 912de0a..50d8984 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); }