GDBServerFoundation::GDBServer Class Reference

Implements a TCP/IP server handling the gdbserver protocol. More...

#include <GDBServer.h>

Inheritance diagram for GDBServerFoundation::GDBServer:

Public Member Functions

 GDBServer (IGDBStubFactory *pFactory, bool own=true)
 Creates a new instance of the GDB Server.
 
BazisLib::ActionStatus Start (unsigned port)
 Starts listening for incoming connections.
 
void WaitForTermination ()
 Waits till the server is stopped by calling StopListening() and the last connection is closed.
 
void StopListening ()
 Stops listening for new incoming connections. The existing connections are not affected.
 

Protected Member Functions

void OnPacketError (const BazisLib::String &msg)
 

Detailed Description

Implements a TCP/IP server handling the gdbserver protocol.

The common use case for this class is to create the stub factory (implementing the IGDBStubFactory interface) and start listening for incoming connections:

int main()
{
int kTCPPort = 2000;
GDBServer srv(new MyStubFactory());
srv.Start(kTCPPort);
srv.WaitForTermination();
return 0;
}
Examples:
SimpleWin32Server/SimpleWin32Server.cpp.

Constructor & Destructor Documentation

GDBServerFoundation::GDBServer::GDBServer ( IGDBStubFactory pFactory,
bool  own = true 
)
inline

Creates a new instance of the GDB Server.

Parameters
pFactorySpecifies the factory object that creates instances of GDBStub for the incoming connections.
ownIf true, the pFactory will be depeted when the GDBServer is destroyed.

Member Function Documentation

void GDBServerFoundation::GDBServer::OnPacketError ( const BazisLib::String &  msg)
inlineprotected
BazisLib::ActionStatus GDBServerFoundation::GDBServer::Start ( unsigned  port)

Starts listening for incoming connections.

Examples:
SimpleWin32Server/SimpleWin32Server.cpp.
void GDBServerFoundation::GDBServer::StopListening ( )
inline

Stops listening for new incoming connections. The existing connections are not affected.

Examples:
SimpleWin32Server/SimpleWin32Server.cpp.
void GDBServerFoundation::GDBServer::WaitForTermination ( )
inline

Waits till the server is stopped by calling StopListening() and the last connection is closed.

Examples:
SimpleWin32Server/SimpleWin32Server.cpp.

The documentation for this class was generated from the following files: