diff options
| author | Michael Neuling <mikey@neuling.org> | 2018-06-28 12:02:55 +1000 |
|---|---|---|
| committer | Alistair Popple <alistair@popple.id.au> | 2018-07-12 13:08:20 +1000 |
| commit | 01ff6c72bf68ead3d7d6dcfc9f9f5012709589cb (patch) | |
| tree | 648ff6be58200b4053e7966cffcf5123f7bdad97 | |
| parent | a31ceb742eed60694cd7c9d9cfde3639c29d76a7 (diff) | |
| download | pdbg-01ff6c72bf68ead3d7d6dcfc9f9f5012709589cb.tar.gz pdbg-01ff6c72bf68ead3d7d6dcfc9f9f5012709589cb.zip | |
htm: Remove size from dump
This isn't used and just complicates things.
Signed-off-by: Michael Neuling <mikey@neuling.org>
| -rw-r--r-- | libpdbg/htm.c | 13 | ||||
| -rw-r--r-- | libpdbg/libpdbg.h | 2 | ||||
| -rw-r--r-- | libpdbg/target.h | 2 | ||||
| -rw-r--r-- | src/htm.c | 2 |
4 files changed, 9 insertions, 10 deletions
diff --git a/libpdbg/htm.c b/libpdbg/htm.c index 4e0c7aa..d9b1bbd 100644 --- a/libpdbg/htm.c +++ b/libpdbg/htm.c @@ -218,14 +218,14 @@ int htm_status(struct pdbg_target *target) return htm ? htm->status(htm) : -1; } -int htm_dump(struct pdbg_target *target, uint64_t size, char *filename) +int htm_dump(struct pdbg_target *target, char *filename) { struct htm *htm = check_and_convert(target); if (!htm || !filename) return -1; - return htm->dump(htm, 0, filename); + return htm->dump(htm, filename); } int htm_record(struct pdbg_target *target, char *filename) @@ -972,11 +972,12 @@ static int do_htm_status(struct htm *htm) * FIXME: * Look for eyecatcher 0xacef_f000 at start, otherwise assume wrapping */ -static int do_htm_dump(struct htm *htm, uint64_t size, char *filename) +static int do_htm_dump(struct htm *htm, char *filename) { char *trace_file; struct htm_status status; uint64_t trace[0x1000]; + uint64_t size; int trace_fd, dump_fd; uint32_t chip_id; size_t r; @@ -996,9 +997,7 @@ static int do_htm_dump(struct htm *htm, uint64_t size, char *filename) if (chip_id == -1) return -1; - /* If size is zero they must want the entire thing */ - if (size == 0) - size = status.mem_last - status.mem_base; + size = status.mem_last - status.mem_base; printf("Dumping %" PRIi64 "i MB to %s\n", size >> 20, filename); if (status.mem_last - status.mem_base > size) { @@ -1063,7 +1062,7 @@ static int do_htm_record(struct htm *htm, char *filename) if (do_htm_stop(htm) < 0) return -1; - if (do_htm_dump(htm, 0, filename) < 0) + if (do_htm_dump(htm, filename) < 0) return -1; diff --git a/libpdbg/libpdbg.h b/libpdbg/libpdbg.h index 6b635a9..1c345cb 100644 --- a/libpdbg/libpdbg.h +++ b/libpdbg/libpdbg.h @@ -165,7 +165,7 @@ struct thread_state { int htm_start(struct pdbg_target *target); int htm_stop(struct pdbg_target *target); int htm_status(struct pdbg_target *target); -int htm_dump(struct pdbg_target *target, uint64_t size, char *filename); +int htm_dump(struct pdbg_target *target, char *filename); int htm_record(struct pdbg_target *target, char *filename); int adu_getmem(struct pdbg_target *target, uint64_t addr, uint8_t *ouput, uint64_t size); diff --git a/libpdbg/target.h b/libpdbg/target.h index 9d2ad90..6c2fa17 100644 --- a/libpdbg/target.h +++ b/libpdbg/target.h @@ -94,7 +94,7 @@ struct htm { int (*start)(struct htm *); int (*stop)(struct htm *); int (*status)(struct htm *); - int (*dump)(struct htm *, uint64_t, char *); + int (*dump)(struct htm *, char *); int (*record)(struct htm *, char *); }; #define target_to_htm(x) container_of(x, struct htm, target) @@ -166,7 +166,7 @@ static int run_dump(enum htm_type type) /* size = 0 will dump everything */ printf("Dumping HTM@"); print_htm_address(type, target); - if (htm_dump(target, 0, filename) != 1) { + if (htm_dump(target, filename) != 1) { printf("Couldn't dump HTM@"); print_htm_address(type, target); } |

