summaryrefslogtreecommitdiffstats
path: root/tester/covoar/TargetFactory.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/TargetFactory.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/TargetFactory.cc')
-rw-r--r--tester/covoar/TargetFactory.cc23
1 files changed, 11 insertions, 12 deletions
diff --git a/tester/covoar/TargetFactory.cc b/tester/covoar/TargetFactory.cc
index 27b0bc1..fc9c30b 100644
--- a/tester/covoar/TargetFactory.cc
+++ b/tester/covoar/TargetFactory.cc
@@ -8,6 +8,13 @@
//! instances of a family of classes derived from TargetBase.
//!
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <rld.h>
+
#include "TargetFactory.h"
#include "Target_arm.h"
@@ -16,10 +23,6 @@
#include "Target_powerpc.h"
#include "Target_lm32.h"
#include "Target_sparc.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
namespace Target {
@@ -34,7 +37,7 @@ namespace Target {
//! This is the string found in configuration to match.
const char *theTarget;
//! This is the static wrapper for the constructor.
- TargetBase *(*theCtor)(
+ TargetBase *(*theCtor)(
std::string
);
} FactoryEntry_t;
@@ -76,13 +79,9 @@ namespace Target {
return FactoryTable[i].theCtor( targetName );
}
- fprintf(
- stderr,
- "ERROR!!! %s is not a known architecture!!!\n",
- cpu.c_str()
- );
- fprintf( stderr, "-- fix me\n" );
- exit( 1 );
+ std::ostringstream what;
+ what << cpu << "is not a known architecture!!! - fix me" << std::endl;
+ throw rld::error( what, "TargetFactory" );
return NULL;
}