From d86d18bceddde867049b19d8c1ec39635cf20e0a Mon Sep 17 00:00:00 2001 From: hoffmann Date: Sat, 16 Feb 2013 22:05:00 +0000 Subject: [PATCH] T32: Code cleanup. git-svn-id: https://www4.informatik.uni-erlangen.de/i4svn/danceos/trunk/devel/fail@2104 8c4709b5-6ec9-48aa-a5cd-a96041d1645a --- debuggers/t32/api/CMakeLists.txt | 7 +--- debuggers/t32/src/CMakeLists.txt | 2 +- src/core/sal/t32/T32Config.hpp | 3 -- src/core/sal/t32/T32Connector.cc | 56 ------------------------------- src/core/sal/t32/T32Connector.hpp | 24 ------------- src/core/sal/t32/T32Controller.cc | 3 -- src/core/sal/t32/wrappers.cc | 21 ------------ 7 files changed, 2 insertions(+), 114 deletions(-) delete mode 100644 src/core/sal/t32/T32Connector.cc delete mode 100644 src/core/sal/t32/T32Connector.hpp delete mode 100644 src/core/sal/t32/wrappers.cc diff --git a/debuggers/t32/api/CMakeLists.txt b/debuggers/t32/api/CMakeLists.txt index d455b686..15ac93e6 100644 --- a/debuggers/t32/api/CMakeLists.txt +++ b/debuggers/t32/api/CMakeLists.txt @@ -1,6 +1 @@ -set(SRCS - hlinknet.cc - hremote.cc -) - -add_library(t32api ${SRCS}) +add_library(t32api hlinknet.cc hremote.cc) diff --git a/debuggers/t32/src/CMakeLists.txt b/debuggers/t32/src/CMakeLists.txt index e84d7466..5722ff4c 100644 --- a/debuggers/t32/src/CMakeLists.txt +++ b/debuggers/t32/src/CMakeLists.txt @@ -8,4 +8,4 @@ target_link_libraries(fail-client -Wl,-whole-archive t32api -Wl,-no-whole-archiv install(TARGETS fail-client RUNTIME DESTINATION bin) add_executable(t32cli t32cli.cc) -target_link_libraries(t32cli -Wl,-whole-archive t32api -Wl,-no-whole-archive) +target_link_libraries(t32cli t32api) diff --git a/src/core/sal/t32/T32Config.hpp b/src/core/sal/t32/T32Config.hpp index 1f20333d..2a1267ca 100644 --- a/src/core/sal/t32/T32Config.hpp +++ b/src/core/sal/t32/T32Config.hpp @@ -6,15 +6,12 @@ #ifndef __T32_CONFIG_HPP__ #define __T32_CONFIG_HPP__ -struct T32Timer; - namespace fail { typedef uint32_t guest_address_t; //!< the guest memory address type typedef unsigned char* host_address_t; //!< the host memory address type typedef uint32_t register_data_t; //!< register data type (64 bit) typedef int timer_t; //!< type of timer IDs -//typedef T32Timer* timer_t; //!< type of timer IDs } // end-of-namespace: fail diff --git a/src/core/sal/t32/T32Connector.cc b/src/core/sal/t32/T32Connector.cc deleted file mode 100644 index b94165d7..00000000 --- a/src/core/sal/t32/T32Connector.cc +++ /dev/null @@ -1,56 +0,0 @@ -/** - * FailT32 -- Fault Injection on the Lauterbach Trace32 System - * - * 1. Invoke t32 executable with appropriate Lauterbach Skript - * - Script has to load binary - * - and let system run until entry point - * -> Then we have a readily configured system - * - * @author Martin Hoffmann - * @date 15.02.2013 - */ - -#include -#include -#include -#include - -using namespace std; - -/* Default T32 error handler */ -void err(int ernum){ - if(err != 0){ - cerr << "Error: " << err << endl; - //exit(-1); - } -} - - - -/* Here we go... */ -int main(int argc, char** argv){ - - // Evaluate arguments - - // Setup connection to Lauterbach - cout << "Lauterbach remote connection" << endl; - int error; - char hostname[] = "localhost"; - char packlen[] = "1024"; - char port[] = "20010"; - - cout << "[T32] Connecting to " << hostname << ":" << port << " Packlen: " << packlen << endl; - T32_Config("NODE=", hostname); - T32_Config("PACKLEN=", packlen); - T32_Config("PORT=", port); - - cout << "[T32] Init." << endl; - err(T32_Init()); - - cout << "[T32] Attach." << endl; - err(T32_Attach(T32_DEV_ICD)); - - - // Let simulatorcontroller do the work. - -} diff --git a/src/core/sal/t32/T32Connector.hpp b/src/core/sal/t32/T32Connector.hpp deleted file mode 100644 index 1a60f38e..00000000 --- a/src/core/sal/t32/T32Connector.hpp +++ /dev/null @@ -1,24 +0,0 @@ -#ifndef __T32_CONNECTOR_HPP__ - #define __T32_CONNECTOR_HPP__ - -#include - -namespace fail { - -/** - * \class T32Connector - */ -class T32Connector { -public: - - - /** - * Save simulator state. Quite hard on real hardware! Also safe all HW registers! - * @param path Location to store state information - * @return \c true if the state has been successfully saved, \c false otherwise - */ -}; - -} // end-of-namespace: fail - -#endif // __T32_CONNECTOR_HPP__ diff --git a/src/core/sal/t32/T32Controller.cc b/src/core/sal/t32/T32Controller.cc index 2035236c..bf41278c 100644 --- a/src/core/sal/t32/T32Controller.cc +++ b/src/core/sal/t32/T32Controller.cc @@ -1,9 +1,6 @@ #include "T32Controller.hpp" -#include "T32Connector.hpp" - #include "../Listener.hpp" - namespace fail { void T32Controller::startup(){ diff --git a/src/core/sal/t32/wrappers.cc b/src/core/sal/t32/wrappers.cc deleted file mode 100644 index 10c0f85e..00000000 --- a/src/core/sal/t32/wrappers.cc +++ /dev/null @@ -1,21 +0,0 @@ -#include - -#include "../SALInst.hpp" -#include "../SALConfig.hpp" -#include "config/FailConfig.hpp" - -extern "C" { - -void fail_init(struct CPUX86State *env) -{ - std::cout << "FailT32" FAIL_VERSION << std::endl; - fail::simulator.startup(); -} - -void fail_watchpoint_hit(struct CPUX86State *env, uint64_t addr, int width, int is_write) -{ - // FIXME: instruction pointer - fail::simulator.onMemoryAccess(addr, width, is_write == 1, 0); -} - -}