From patchwork Thu Oct 17 05:15:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amitay Isaacs X-Patchwork-Id: 1178303 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 46ty6Y0Vcjz9sPF for ; Thu, 17 Oct 2019 16:15:33 +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="etNK0A/s"; 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 46ty6X5jTFzDr9H for ; Thu, 17 Oct 2019 16:15:32 +1100 (AEDT) X-Original-To: pdbg@lists.ozlabs.org Delivered-To: pdbg@lists.ozlabs.org Received: from ozlabs.org (bilbo.ozlabs.org [203.11.71.1]) (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 46ty6S35BpzDr8s 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="etNK0A/s"; 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 46ty6R41Pzz9sPF; 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=1571289327; bh=BzvPblbh2pYwXWnxQmoNIkFU0qfgLeWLvUl/QPMwobo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=etNK0A/s3ftuyxKDKKxZDknKqb9a9wiJEBmlLyxU80mE6OBsgV7Ja/H3RHcNCd86i 0kj4W7EMi4heuh1VQHe5/Ac8x0V2vcRRs6hbUygXyd+NzlWR7Etw4exoHBGd0YujC2 kskffy9oui4H8O+lgBmDkyJUuU8liQWqYqcBwkM+8aXO8etgyU1Wy5acvzv24+my0T sPn5bCLvbjetpDdBVdbMjDcep7hcQ5THWpEv80mj8uMFMTrOKK+m/8gcA1bDycqAer oC+wK7bnpRECHyqaH5QozWyS+x22feb3oZXEh6dlPYMwWtLvjFUhRHXh/KVewOTqxh UX5mIXu0Ni/Fg== From: Amitay Isaacs To: pdbg@lists.ozlabs.org Date: Thu, 17 Oct 2019 16:15:22 +1100 Message-Id: <20191017051523.27902-2-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 1/2] istep: Add checking for istep major/minor numbers 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 | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/src/istep.c b/src/istep.c index 7a3c8f3..810d42e 100644 --- a/src/istep.c +++ b/src/istep.c @@ -20,18 +20,40 @@ #include "optcmd.h" #include "path.h" +struct istep_data { + int major; + int minor_first; + int minor_last; +} istep_data[] = { + { 2, 2, 17 }, + { 3, 1, 22 }, + { 4, 1, 34 }, + { 5, 1, 2 }, + { 0, 0, 0 }, +}; + static int istep(uint32_t major, uint32_t minor) { struct pdbg_target *target; - int count = 0; + int count = 0, i; if (major < 2 || major > 5) { fprintf(stderr, "Istep major should be 2 to 5\n"); return 0; } - if (major == 2 && minor == 1) { - fprintf(stderr, "Istep 2 minor should be > 1\n"); - return 0; + + for (i=0; istep_data[i].major != 0; i++) { + if (istep_data[i].major != major) + continue; + + if (minor < istep_data[i].minor_first || + minor > istep_data[i].minor_last) { + fprintf(stderr, "Istep %d minor should be %d to %d\n", + major, + istep_data[i].minor_first, + istep_data[i].minor_last); + return 0; + } } for_each_path_target_class("pib", target) { 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)