diff options
author | Alistair Popple <alistair@popple.id.au> | 2018-04-30 14:45:11 +1000 |
---|---|---|
committer | Alistair Popple <alistair@popple.id.au> | 2018-04-30 17:14:57 +1000 |
commit | cb42782a85d1994f55af6452c6a60fb7a6235ebf (patch) | |
tree | 3b4aad0d81fc0b732d5ac8eba655cc892b367ca7 /src/htm.c | |
parent | ad058f045c4403346c92ddd9115397a939b44a79 (diff) | |
download | pdbg-cb42782a85d1994f55af6452c6a60fb7a6235ebf.tar.gz pdbg-cb42782a85d1994f55af6452c6a60fb7a6235ebf.zip |
src/htm.c: Only run on selected targets
The HTM does not call the same target iterators as the rest of the pdbg
application. Therefore the changes to device selection were not carried
over. Longer term we should change the HTM code to call the same iterators
as the rest of the pdbg application, but for the moment just copy the
device selection code across as the longer term fix really requires
rewritting the iterators to not use callbacks.
Signed-off-by: Alistair Popple <alistair@popple.id.au>
Diffstat (limited to 'src/htm.c')
-rw-r--r-- | src/htm.c | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -80,6 +80,8 @@ static int run_start(enum htm_type type, int optind, int argc, char *argv[]) int rc = 0; pdbg_for_each_class_target(HTM_ENUM_TO_STRING(type), target) { + if (!target_selected(target)) + continue; pdbg_target_probe(target); if (target_is_disabled(target)) continue; @@ -102,6 +104,8 @@ static int run_stop(enum htm_type type, int optind, int argc, char *argv[]) int rc = 0; pdbg_for_each_class_target(HTM_ENUM_TO_STRING(type), target) { + if (!target_selected(target)) + continue; pdbg_target_probe(target); if (target_is_disabled(target)) continue; @@ -124,6 +128,8 @@ static int run_status(enum htm_type type, int optind, int argc, char *argv[]) int rc = 0; pdbg_for_each_class_target(HTM_ENUM_TO_STRING(type), target) { + if (!target_selected(target)) + continue; pdbg_target_probe(target); if (target_is_disabled(target)) continue; @@ -148,6 +154,8 @@ static int run_reset(enum htm_type type, int optind, int argc, char *argv[]) int rc = 0; pdbg_for_each_class_target(HTM_ENUM_TO_STRING(type), target) { + if (!target_selected(target)) + continue; pdbg_target_probe(target); if (target_is_disabled(target)) continue; @@ -185,6 +193,8 @@ static int run_dump(enum htm_type type, int optind, int argc, char *argv[]) /* size = 0 will dump everything */ printf("Dumping HTM trace to file [chip].[#]%s\n", filename); pdbg_for_each_class_target(HTM_ENUM_TO_STRING(type), target) { + if (!target_selected(target)) + continue; pdbg_target_probe(target); if (target_is_disabled(target)) continue; @@ -326,6 +336,14 @@ int run_htm(int optind, int argc, char *argv[]) return 0; } } + + /* Select the correct chtm target */ + pdbg_for_each_child_target(core_target, target) { + if (!strcmp(pdbg_target_class_name(target), "chtm")) { + target_select(target); + pdbg_target_probe(target); + } + } } optind++; |