From patchwork Wed Jun 6 06:58:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rashmica Gupta X-Patchwork-Id: 925755 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 41100b329WzB3sh for ; Wed, 6 Jun 2018 16:59: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="NTfYZi33"; 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 41100b1CVCzF31B for ; Wed, 6 Jun 2018 16:59:43 +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="NTfYZi33"; 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::241; helo=mail-pf0-x241.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="NTfYZi33"; dkim-atps=neutral Received: from mail-pf0-x241.google.com (mail-pf0-x241.google.com [IPv6:2607:f8b0:400e:c00::241]) (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 410zzc670HzF31J for ; Wed, 6 Jun 2018 16:58:52 +1000 (AEST) Received: by mail-pf0-x241.google.com with SMTP id h12-v6so2682773pfk.11 for ; Tue, 05 Jun 2018 23:58:52 -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=wDgq4VnUTekV7HgWonvykf6UFIkqRYoXO6wZwTp2v74=; b=NTfYZi339oE/0JOkOhnYZai/hRH/uKo7sQF/6j6PhU9ECRXMMxbcciSetkPxm3/Ohe dJWCRWgWoEwfxm/lv3ZHzZ690JnnknBMdk9vRrzUrUoQdzCYQLgHiYJ8GnYknPzK68ec 89VP+JgiqDqKJnQthQNnu7byzmQoCj8GEeXxXXT4b0ZpFvTid1lGa0mtbiV/X8zMS8GF 51t3wxklfv+0OAPq83sBUh3KmUl99rJpZcj2HOMiGFQLUlwt0OILdhSXdDdaV4ifBUVc p5DGZEfZaNbZyAwK3zlm/yawsLoyCZbeyljkkssF1whmpPUICrl/JonRAxTh3gRUiTBh Xlug== 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=wDgq4VnUTekV7HgWonvykf6UFIkqRYoXO6wZwTp2v74=; b=MK8ltniuuPKPDg46MF3v98W95FI6F6mY/gNZ/G/5CBOAE2avpmCf49koNmqL7XSX1N ZnmkvWG2IdIPdR61pBPjiMDDQKQlA/Z6xNkK+2zhYGypRgUgJK17SabRV3kiUBZwDjdy iD+ZUfCXEUXtxFNf9XJNl4WkopOLTx6dE6/sGRtytbRkhP7WczXX+ZbFawZSR1RyvBUd OvgmojXzjSLpW2Py+IDElINmLe+8BDKeI9+3Dy92gxhxAiWlIkSoG5AKX4H40hQ0JktL LgriiJD2+Rea7gwSjktu2+ZZTP0cjULiwE4e5odwZoYCFjWhTyO7cJmy7BvEfKXbDQ4J TiNQ== X-Gm-Message-State: APt69E2py/Zri0f9nclCT7rwWch/PAaViOyJOP94LDmovvv6VuBzuFeo 8E3ykfphPLV/lH4wW9Fe8BBG4g== X-Google-Smtp-Source: ADUXVKK/Ns4uGTt+LYIuxB9FyOA9klyqmCc32BCnnDJInliLQeloxkRjRibnwDKJXhjekEwsgU2PPQ== X-Received: by 2002:a62:e117:: with SMTP id q23-v6mr1272387pfh.75.1528268330220; Tue, 05 Jun 2018 23:58:50 -0700 (PDT) Received: from rashmica.ozlabs.ibm.com ([122.99.82.10]) by smtp.gmail.com with ESMTPSA id 10-v6sm56396207pgb.40.2018.06.05.23.58.48 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 05 Jun 2018 23:58:49 -0700 (PDT) From: Rashmica Gupta To: pdbg@lists.ozlabs.org Date: Wed, 6 Jun 2018 16:58:38 +1000 Message-Id: <20180606065838.30364-1-rashmica.g@gmail.com> X-Mailer: git-send-email 2.14.4 Subject: [Pdbg] [PATCH] 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" --- libpdbg/chip.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libpdbg/chip.c b/libpdbg/chip.c index 6d0b47e..f35d783 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, %lx\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)