From patchwork Wed Jun 6 07:14:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rashmica Gupta X-Patchwork-Id: 925758 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 4110LF4tfxzB3h4 for ; Wed, 6 Jun 2018 17:15:01 +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="t+N8dunF"; 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 4110LF2sbjzF2ZP for ; Wed, 6 Jun 2018 17:15:01 +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="t+N8dunF"; 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:c05::22a; helo=mail-pg0-x22a.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="t+N8dunF"; dkim-atps=neutral Received: from mail-pg0-x22a.google.com (mail-pg0-x22a.google.com [IPv6:2607:f8b0:400e:c05::22a]) (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 4110L93fynzF1xV for ; Wed, 6 Jun 2018 17:14:57 +1000 (AEST) Received: by mail-pg0-x22a.google.com with SMTP id z1-v6so2509757pgv.12 for ; Wed, 06 Jun 2018 00:14:56 -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=3pa40Z5z1r4aaOA+3vUtNpgRaYPIeGzlx0sjTBZOcqE=; b=t+N8dunF8jc31+nj6SQMutdg8BCLeVLTRJOqyiH9/sYWaKvqwWyLfcnymps5wNT9xe 0GAEsv6eud5VG3Ju2yNDKuj3TNvZi7ifmol62dpW7a/wB6ocMSd0wnb4tkubWeS/7wgh 7c1oZbSkHlUyjuJm6z0pmcpIr3zXDl8F0JJgdFecMLTt2ZKEk7EVCiZ952pk2yQw/Gqs 28FtSwCPtDsBOreFspvqa/X61B7jwFItZ8jwP85SUAjXhhsw2pAHbAc1wJsMnqyhKH6F vCNHyb/VfltLohqmBX5DsZdp+2KOWCcHjuw6OcI6r1/dRhyAQIOD1mNaGRHHb8XyOxTW Z/lQ== 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=3pa40Z5z1r4aaOA+3vUtNpgRaYPIeGzlx0sjTBZOcqE=; b=jHZWbzl84QoRQ8leC/QEbDSCAmmpsoudAhAmOcBAs1oZCZooOqUB8bcEnQ40oq/7sA tUHd7E4mTVHlQAtaWeeNZbN8nqFL0alM5Pl/bZ8/OL/1TUJ64CqUEQXB/dPXlzA3ZZrc hh1NqjEmvYYD1GCmw8m7hVmZ77kWhcsBF1UD2zSsD/jm0CeZDX3w1h9sMGrzq7cbTxGV UkUxYq1qaHXjGP49ShF4k19wdnYmTWK5HgEEEyg46PIeBMJR/ngYmCY3aMAkofceDPOt CkwN2yykwtqd0AV75TEdAQvIxcn0gpI4Cn+6MfaekALzL2VTeFsL05GRYT1ilejb2eH6 4Wfw== X-Gm-Message-State: APt69E0hw+5QrgtWuBZS6rYS6JI8ijLvvzJaUuAIHzo8CpW8SXI5tgqj R9vCGyaK4zs35vwHBD/a0lrv3w== X-Google-Smtp-Source: ADUXVKJr5BjTBQYVpe2HrKYsn0IUfFsl1QltN2RC16xEY59K+3tLJBXtzLF0OwA+h4ObkxU5AjXLUw== X-Received: by 2002:a63:89c2:: with SMTP id v185-v6mr1614121pgd.196.1528269294855; Wed, 06 Jun 2018 00:14:54 -0700 (PDT) Received: from rashmica.ozlabs.ibm.com ([122.99.82.10]) by smtp.gmail.com with ESMTPSA id x3-v6sm42847822pfm.2.2018.06.06.00.14.53 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 06 Jun 2018 00:14:54 -0700 (PDT) From: Rashmica Gupta To: pdbg@lists.ozlabs.org Date: Wed, 6 Jun 2018 17:14:39 +1000 Message-Id: <20180606071439.32354-1-rashmica.g@gmail.com> X-Mailer: git-send-email 2.14.4 Subject: [Pdbg] [PATCH v2] libpdbg: Attempt to restore registers that we clobbered on failure 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" --- v1 -> v2 print out variables properly... libpdbg/chip.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libpdbg/chip.c b/libpdbg/chip.c index 6d0b47e..cb92de1 100644 --- a/libpdbg/chip.c +++ b/libpdbg/chip.c @@ -266,9 +266,13 @@ static int ram_instructions(struct pdbg_target *thread_target, uint64_t *opcodes } if (thread->ram_instruction(thread, opcode, &scratch)) { - PR_DEBUG("%s: %d\n", __FUNCTION__, __LINE__); + PR_DEBUG("%s: %d, %016" PRIx64 "\n", __FUNCTION__, __LINE__, opcode); exception = 1; - break; + if (i >= 0 || i < len) + /* skip the rest and attempt to restore r0 and r1 */ + i = len - 1; + else + break; } if (i == -2)