From patchwork Thu Oct 17 05:15:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amitay Isaacs X-Patchwork-Id: 1178305 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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46ty6k1F3Dz9sPJ for ; Thu, 17 Oct 2019 16:15:42 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=ozlabs.org header.i=@ozlabs.org header.b="fmGlueuO"; dkim-atps=neutral Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 46ty6j5mqMzDr9Q for ; Thu, 17 Oct 2019 16:15:41 +1100 (AEDT) X-Original-To: pdbg@lists.ozlabs.org Delivered-To: pdbg@lists.ozlabs.org Received: from ozlabs.org (bilbo.ozlabs.org [IPv6:2401:3900:2:1::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 46ty6S5fnzzDr8t for ; Thu, 17 Oct 2019 16:15:28 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=ozlabs.org Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=ozlabs.org header.i=@ozlabs.org header.b="fmGlueuO"; dkim-atps=neutral Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 46ty6S1ybSz9sPJ; Thu, 17 Oct 2019 16:15:27 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ozlabs.org; s=201707; t=1571289328; bh=w2kpMU2veF31lghD8rsCH6GmdEBBusJG9yQ6AOPZ1Kc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fmGlueuOP3nbGrjXpMfZr3hXn/hUsWKfQRZvBz0gx9zOAgE5Bs9VprADTD49NfxVh eruX0P1ndl/mz46DBTD15VxLSYNHcr4Y728mtXm02c8nWXiD/M6+rYKycvxjV81WI+ pTzc46clEAwN2T1145MdneXLdv8b5mv9TzzG1Q0FDWZjXrmS/8DogKolBGPCUOal8q fFG1bC7j3VYrIPmYKwgVEheyR19srHZZDGJUe4J/txU0jOs65JWfx/8DtnFVuVILfK 7zrl1CB76u0Kf2MViCco9gNJcqt69tibAMS37A/Ii6v8Ig6X2qsaplf71sLBqNXPmn XDeJxTVV0jXAg== From: Amitay Isaacs To: pdbg@lists.ozlabs.org Date: Thu, 17 Oct 2019 16:15:23 +1100 Message-Id: <20191017051523.27902-3-amitay@ozlabs.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191017051523.27902-1-amitay@ozlabs.org> References: <20191017051523.27902-1-amitay@ozlabs.org> MIME-Version: 1.0 Subject: [Pdbg] [PATCH v3 2/2] istep: Run all sub-steps if minor is 0 X-BeenThere: pdbg@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "mailing list for https://github.com/open-power/pdbg development" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Amitay Isaacs Errors-To: pdbg-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Pdbg" Signed-off-by: Amitay Isaacs --- src/istep.c | 19 ++++++++++++++++--- src/main.c | 2 +- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/src/istep.c b/src/istep.c index 810d42e..ca6bed3 100644 --- a/src/istep.c +++ b/src/istep.c @@ -36,6 +36,7 @@ static int istep(uint32_t major, uint32_t minor) { struct pdbg_target *target; int count = 0, i; + int first = minor, last = minor; if (major < 2 || major > 5) { fprintf(stderr, "Istep major should be 2 to 5\n"); @@ -46,6 +47,12 @@ static int istep(uint32_t major, uint32_t minor) if (istep_data[i].major != major) continue; + if (minor == 0) { + first = istep_data[i].minor_first; + last = istep_data[i].minor_last; + break; + } + if (minor < istep_data[i].minor_first || minor > istep_data[i].minor_last) { fprintf(stderr, "Istep %d minor should be %d to %d\n", @@ -62,11 +69,17 @@ static int istep(uint32_t major, uint32_t minor) if (pdbg_target_status(target) != PDBG_TARGET_ENABLED) continue; - rc = sbe_istep(target, major, minor); - if (!rc) - count++; + for (i = first; i <= last ; i++) { + printf("Running istep %d.%d\n", major, i); + rc = sbe_istep(target, major, i); + if (rc) + goto fail; + } + + count++; } +fail: return count; } OPTCMD_DEFINE_CMD_WITH_ARGS(istep, istep, (DATA32, DATA32)); diff --git a/src/main.c b/src/main.c index efdc4bb..029ed07 100644 --- a/src/main.c +++ b/src/main.c @@ -125,7 +125,7 @@ static struct action actions[] = { { "sreset", "", "Reset" }, { "regs", "[--backtrace]", "State (optionally display backtrace)" }, { "gdbserver", "", "Start a gdb server" }, - { "istep", " ", "Execute istep on SBE" }, + { "istep", " |0", "Execute istep on SBE" }, }; static void print_usage(void)