Transaction-Level Modeling Framework for Space Applications
#include <GDBConnectionManager.hpp>
Public Member Functions | |
GDBConnectionManager (bool endianess) | |
~GDBConnectionManager () | |
void | initialize (unsigned int port) |
void | sendResponse (GDBResponse &response) |
Sends the response to the GDB debugger connected. More... | |
GDBRequest | processRequest () |
void | disconnect () |
Closes the connection with the GDB debugger. More... | |
bool | checkInterrupt () |
void | sendInterrupt () |
Manages the connection among the GDB debugger and the stub which communicates with the processor; it is responsible of handling socket connection and of the coding and decoding of the messages. For more details on the internal workings of GDB look at http://sourceware.org/gdb/current/onlinedocs/gdb_33.html
trap::GDBConnectionManager::GDBConnectionManager | ( | bool | endianess | ) |
trap::GDBConnectionManager::~GDBConnectionManager | ( | ) |
bool trap::GDBConnectionManager::checkInterrupt | ( | ) |
Keeps waiting for a character on the channel with the GDB debugger
References error_code.
void trap::GDBConnectionManager::disconnect | ( | ) |
Closes the connection with the GDB debugger.
void trap::GDBConnectionManager::initialize | ( | unsigned int | port | ) |
Creates a socket connection waiting on the specified port; this will be later used to communicate with GDB
References THROW_ERROR.
Referenced by trap::GDBStub< unsigned int >::initialize().
trap::GDBRequest trap::GDBConnectionManager::processRequest | ( | ) |
Waits for the sending of a packet from GDB; it then parses it and translates it into the correct request
References __PRETTY_FUNCTION__, trap::GDBRequest::address, trap::GDBRequest::c_req, trap::GDBRequest::C_req, trap::GDBRequest::command, trap::GDBRequest::D_req, trap::GDBRequest::data, error_code, trap::GDBRequest::ERROR_req, trap::GDBRequest::EXCL_req, trap::GDBRequest::extension, trap::GDBRequest::G_req, trap::GDBRequest::g_req, trap::GDBRequest::H_req, trap::GDBRequest::i_req, trap::GDBRequest::I_req, trap::GDBRequest::INTR_req, trap::GDBRequest::k_req, trap::GDBRequest::length, trap::GDBRequest::m_req, trap::GDBRequest::M_req, trap::GDBRequest::p_req, trap::GDBRequest::P_req, trap::GDBRequest::q_req, trap::GDBRequest::QUEST_req, trap::GDBRequest::reg, trap::GDBRequest::s_req, trap::GDBRequest::S_req, trap::GDBRequest::signal, trap::GDBRequest::t_req, trap::GDBRequest::T_req, toIntNum(), trap::GDBRequest::type, trap::GDBRequest::UNK_req, trap::GDBRequest::v_req, trap::GDBRequest::value, pysc::api::cci::write(), trap::GDBRequest::Z_req, and trap::GDBRequest::z_req.
void trap::GDBConnectionManager::sendInterrupt | ( | ) |
Sends and interrupt message to the GDB debugger signaling that the execution of the program halted: this way the GDB debugger becomes responsive and it is possible to debug the program under test
References trap::GDBResponse::payload, trap::GDBResponse::S_rsp, SIGTRAP, and trap::GDBResponse::type.
void trap::GDBConnectionManager::sendResponse | ( | GDBResponse & | response | ) |
Sends the response to the GDB debugger connected.
References __PRETTY_FUNCTION__, trap::GDBResponse::CONT_rsp, trap::GDBResponse::data, error_code, trap::GDBResponse::ERROR_rsp, trap::GDBResponse::info, trap::GDBResponse::MEM_READ_rsp, trap::GDBResponse::message, trap::GDBResponse::OK_rsp, trap::GDBResponse::OUTPUT_rsp, trap::GDBResponse::payload, trap::GDBResponse::REG_READ_rsp, trap::GDBResponse::S_rsp, trap::GDBResponse::size, trap::GDBResponse::T_rsp, trap::GDBResponse::type, trap::GDBResponse::W_rsp, pysc::api::cci::write(), and trap::GDBResponse::X_rsp.