From 881824f766937a47fb494f97f4ebcd44c99135cc Mon Sep 17 00:00:00 2001 From: Chris Johns Date: Fri, 11 May 2018 14:24:11 +1200 Subject: tester/covoar: Remove all exit() calls and throw an rld::error exception. Add a suitable catch to covoar's main. --- tester/covoar/Target_arm.cc | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'tester/covoar/Target_arm.cc') diff --git a/tester/covoar/Target_arm.cc b/tester/covoar/Target_arm.cc index a2b65c8..a33ec80 100644 --- a/tester/covoar/Target_arm.cc +++ b/tester/covoar/Target_arm.cc @@ -1,15 +1,19 @@ /*! @file Target_arm.cc * @brief Target_arm Implementation * - * This file contains the implementation of the base class for + * This file contains the implementation of the base class for * functions supporting target unique functionallity. */ -#include "Target_arm.h" + #include #include #include #include +#include + +#include "Target_arm.h" + namespace Target { Target_arm::Target_arm( std::string targetName ): @@ -31,7 +35,7 @@ namespace Target { branchInstructions.push_back("bpl"); branchInstructions.push_back("bvc"); branchInstructions.push_back("bvs"); - + branchInstructions.sort(); } @@ -46,7 +50,7 @@ namespace Target { ) { if (!strcmp( &line[strlen(line)-3], "nop")) { - size = 4; + size = 4; return true; } @@ -66,15 +70,17 @@ namespace Target { } return false; - + } bool Target_arm::isBranch( const char* instruction - ) + ) { - fprintf( stderr, "DETERMINE BRANCH INSTRUCTIONS FOR THIS ARCHITECTURE! -- fix me\n" ); - exit( -1 ); + throw rld::error( + "DETERMINE BRANCH INSTRUCTIONS FOR THIS ARCHITECTURE! -- fix me", + "Target_arm::isBranch" + ); } TargetBase *Target_arm_Constructor( -- cgit v1.2.3