[Pdbg] [PATCH] libpdbg: Always fail sreset on p8

Rashmica Gupta rashmica.g at gmail.com
Wed Jun 6 17:02:13 AEST 2018


Currently attempting to do a './pdbg -p x -c x -t x sreset'
segfaults as there is no sreset function defined for p8. Apparently
we can't easily sreset on p8, so add in function that always fails
as this is better than segfaulting.
---
 libpdbg/p8chip.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/libpdbg/p8chip.c b/libpdbg/p8chip.c
index 817ef2c..5e3ad97 100644
--- a/libpdbg/p8chip.c
+++ b/libpdbg/p8chip.c
@@ -283,6 +283,12 @@ static int p8_thread_start(struct thread *thread)
 	return 0;
 }
 
+static int p8_thread_sreset(struct thread *thread)
+{
+	/* Broken on p8 */
+	return 1;
+}
+
 static int p8_ram_setup(struct thread *thread)
 {
 	struct pdbg_target *target;
@@ -432,6 +438,7 @@ static struct thread p8_thread = {
 	.step = p8_thread_step,
 	.start = p8_thread_start,
 	.stop = p8_thread_stop,
+	.sreset = p8_thread_sreset,
 	.ram_setup = p8_ram_setup,
 	.ram_instruction = p8_ram_instruction,
 	.ram_destroy = p8_ram_destroy,
-- 
2.14.4



More information about the Pdbg mailing list