[Pdbg] [PATCH v3 2/2] istep: Run all sub-steps if minor is 0
Amitay Isaacs
amitay at ozlabs.org
Thu Oct 17 16:15:23 AEDT 2019
Signed-off-by: Amitay Isaacs <amitay at ozlabs.org>
---
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", "<major> <minor>", "Execute istep on SBE" },
+ { "istep", "<major> <minor>|0", "Execute istep on SBE" },
};
static void print_usage(void)
--
2.21.0
More information about the Pdbg
mailing list