summaryrefslogtreecommitdiffstats
path: root/libpdbg/chip.c
diff options
context:
space:
mode:
authorNicholas Piggin <npiggin@gmail.com>2018-05-02 16:28:07 +1000
committerAlistair Popple <alistair@popple.id.au>2018-05-08 11:45:28 +1000
commit7eada1803eb06d2f55869cdf75688127b718ab05 (patch)
tree74c6e9e4a9466bb09a0e8a7d8a15ab66badc2614 /libpdbg/chip.c
parentcd00246a47b6d8095bd1e2468a0b56fbafd73194 (diff)
downloadpdbg-7eada1803eb06d2f55869cdf75688127b718ab05.tar.gz
pdbg-7eada1803eb06d2f55869cdf75688127b718ab05.zip
libpdbg/chip.c: ram_instructions add error handling
Pass errors back to the caller, and clean up with ram_destroy on failure. Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Diffstat (limited to 'libpdbg/chip.c')
-rw-r--r--libpdbg/chip.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libpdbg/chip.c b/libpdbg/chip.c
index 79bc87d..ebfaaa8 100644
--- a/libpdbg/chip.c
+++ b/libpdbg/chip.c
@@ -168,7 +168,11 @@ static int ram_instructions(struct pdbg_target *thread_target, uint64_t *opcodes
opcode = mfspr(1, 277);
}
- CHECK_ERR(thread->ram_instruction(thread, opcode, &scratch));
+ if (thread->ram_instruction(thread, opcode, &scratch)) {
+ PR_DEBUG("%s: %d\n", __FUNCTION__, __LINE__);
+ exception = 1;
+ break;
+ }
if (i == -2)
r1 = scratch;
OpenPOWER on IntegriCloud