diff options
author | Chris Johns <chrisj@rtems.org> | 2018-05-11 14:24:11 +1200 |
---|---|---|
committer | Chris Johns <chrisj@rtems.org> | 2018-06-18 12:26:16 +1000 |
commit | 881824f766937a47fb494f97f4ebcd44c99135cc (patch) | |
tree | 0af3d9422ba8e0eae6df8458cc08d4aafacff301 /tester/covoar/TargetBase.cc | |
parent | linkers/exe-info: Add DWARF support to gather and check producer details. (diff) | |
download | rtems-tools-881824f766937a47fb494f97f4ebcd44c99135cc.tar.bz2 |
tester/covoar: Remove all exit() calls and throw an rld::error exception.
Add a suitable catch to covoar's main.
Diffstat (limited to 'tester/covoar/TargetBase.cc')
-rw-r--r-- | tester/covoar/TargetBase.cc | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/tester/covoar/TargetBase.cc b/tester/covoar/TargetBase.cc index e5a0ee6..354a580 100644 --- a/tester/covoar/TargetBase.cc +++ b/tester/covoar/TargetBase.cc @@ -1,20 +1,22 @@ /*! @file TargetBase.cc * @brief TargetBase 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 "TargetBase.h" -#include "qemu-traces.h" - #include <algorithm> #include <stdio.h> #include <stdlib.h> +#include <rld.h> + +#include "TargetBase.h" +#include "qemu-traces.h" + namespace Target { - TargetBase::TargetBase( + TargetBase::TargetBase( std::string targetName ): targetName_m( targetName ) @@ -65,13 +67,12 @@ namespace Target { std::list <std::string>::iterator i; if (branchInstructions.empty()) { - fprintf( - stderr, - "DETERMINE BRANCH INSTRUCTIONS FOR THIS ARCHITECTURE! -- fix me\n" - ); - exit( -1 ); + throw rld::error( + "DETERMINE BRANCH INSTRUCTIONS FOR THIS ARCHITECTURE! -- fix me", + "TargetBase::isBranch" + ); } - + i = find(branchInstructions.begin(), branchInstructions.end(), instruction); if ( i == branchInstructions.end() ) return false; @@ -90,11 +91,11 @@ namespace Target { char instruction[120]; int result; - + ch = &(line[0]); // Increment to the first tab in the line - while ((*ch != '\t') && (*ch != '\0')) { + while ((*ch != '\t') && (*ch != '\0')) { ch++; } if (*ch != '\t') { @@ -104,7 +105,7 @@ namespace Target { ch++; // Increment to the second tab in the line - while ((*ch != '\t') && (*ch != '\0')) + while ((*ch != '\t') && (*ch != '\0')) ch++; if (*ch != '\t') { fprintf( stderr, WARNING, 2, line) ; |