[Pdbg] [PATCH v3 12/13] libpdbg/chip.c: ram_instructions add error handling
Nicholas Piggin
npiggin at gmail.com
Wed May 2 16:28:07 AEST 2018
Pass errors back to the caller, and clean up with ram_destroy on
failure.
Signed-off-by: Nicholas Piggin <npiggin at gmail.com>
---
libpdbg/chip.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
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;
--
2.17.0
More information about the Pdbg
mailing list