From 1a1d3ff56e5e7a7c91497d6a2bb6c8cd76ef8d88 Mon Sep 17 00:00:00 2001 From: Marcel Telka Date: Thu, 11 Sep 2003 16:33:24 +0000 Subject: [PATCH] 2003-09-10 Marcel Telka * src/cmd/dr.c (cmd_dr_run): Added test for missing active instruction and data register (thanks to Mike Tesch for reporting). git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@561 b68d4a1b-bc3d-0410-92ed-d4ac073336b7 --- jtag/ChangeLog | 5 +++++ jtag/THANKS | 1 + jtag/src/cmd/dr.c | 11 ++++++++++- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/jtag/ChangeLog b/jtag/ChangeLog index 817f4be9..560a8486 100644 --- a/jtag/ChangeLog +++ b/jtag/ChangeLog @@ -1,3 +1,8 @@ +2003-09-10 Marcel Telka + + * src/cmd/dr.c (cmd_dr_run): Added test for missing active instruction and data register (thanks to + Mike Tesch for reporting). + 2003-09-10 Marcel Telka * src/bus/bcm1250.c (bcm1250_bus_printinfo, bcm1250_bus): Fixed typo (compatibile->compatible) in diff --git a/jtag/THANKS b/jtag/THANKS index 95e640ac..d23aa151 100644 --- a/jtag/THANKS +++ b/jtag/THANKS @@ -16,6 +16,7 @@ Guennadi Liakhovetski Brad Parker Christian Pellegrin Ramses VI +Mike Tesch Holger Schurig Matan Ziv-Av Alessandro Zummo diff --git a/jtag/src/cmd/dr.c b/jtag/src/cmd/dr.c index 36e0592f..655d86a5 100644 --- a/jtag/src/cmd/dr.c +++ b/jtag/src/cmd/dr.c @@ -50,7 +50,7 @@ cmd_dr_run( char *params[] ) } if (chain->active_part >= chain->parts->len) { - printf( _("%s: no active part\n"), "part" ); + printf( _("%s: no active part\n"), "dr" ); return 1; } @@ -63,6 +63,15 @@ cmd_dr_run( char *params[] ) return -1; } + if (chain->parts->parts[chain->active_part]->active_instruction == NULL) { + printf( _("%s: part without active instruction\n"), "dr" ); + return 1; + } + if (chain->parts->parts[chain->active_part]->active_instruction->data_register == NULL) { + printf( _("%s: part without active data register\n"), "dr" ); + return 1; + } + if (dir) r = chain->parts->parts[chain->active_part]->active_instruction->data_register->out; else