From 8bcaccbfbd0f1caa6e160f93257337ab084d12ab Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Mon, 8 Feb 2010 23:01:24 +0000 Subject: [PATCH] add a better log for missing register/instruction definitions git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@1773 b68d4a1b-bc3d-0410-92ed-d4ac073336b7 --- urjtag/ChangeLog | 3 +++ urjtag/src/bfin/bfin.c | 8 +++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/urjtag/ChangeLog b/urjtag/ChangeLog index 2ba7633f..1a377688 100644 --- a/urjtag/ChangeLog +++ b/urjtag/ChangeLog @@ -11,6 +11,9 @@ * src/bfin/bfin-part-bfin.c (bfin_init): Add BF548M and BF592. * data/analog/PARTS: Add note that bfin_init() needs to be in sync. + * src/bfin/bfin.c (bfin_set_scan): Replace assert() with a more helpful error + message showing the instruction that had a problem with loading. + 2010-02-08 Jie Zhang * include/urjtag/part.h (struct URJ_PART_PARAMS): Add wait_ready. diff --git a/urjtag/src/bfin/bfin.c b/urjtag/src/bfin/bfin.c index 47d365bc..c9baa992 100644 --- a/urjtag/src/bfin/bfin.c +++ b/urjtag/src/bfin/bfin.c @@ -112,7 +112,13 @@ bfin_set_scan (urj_part_t *part, int scan) if (BFIN_PART_SCAN (part) != scan) { urj_part_set_instruction (part, scans[scan]); - assert (part->active_instruction != NULL); + if (part->active_instruction == NULL) + { + urj_log (URJ_LOG_LEVEL_ERROR, + _("%s: unable to load instruction '%s'\n"), + "bfin", scans[scan]); + return -1; + } BFIN_PART_SCAN (part) = scan; return 1; }