summaryrefslogtreecommitdiffstats
path: root/tester/covoar/TargetBase.cc
diff options
context:
space:
mode:
authorChris Johns <chrisj@rtems.org>2018-05-11 14:24:11 +1200
committerChris Johns <chrisj@rtems.org>2018-06-18 12:26:16 +1000
commit881824f766937a47fb494f97f4ebcd44c99135cc (patch)
tree0af3d9422ba8e0eae6df8458cc08d4aafacff301 /tester/covoar/TargetBase.cc
parentlinkers/exe-info: Add DWARF support to gather and check producer details. (diff)
downloadrtems-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.cc29
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) ;