void GTicketInternalClient::ServiceInfo(strstream & s)
{
	boost::posix_time::ptime now = boost::posix_time::second_clock::local_time();
	string t;
	IsConnection()?t=to_simple_string(connected):t=to_simple_string(disconnected);
	s<<boost::format("%|-8d|%|-12s|%|-20s|%|-12s|%|-22s|%|-10d|%|-10d|%|-11d|%|-10d|")%
		client_service_group % GetServiceName(client_service_type) % AddrToString(addr)() % (IsConnection()?"Connected":"Error") %t % (sequence_number-1) % (int)out.size() % (int)wait.size() % (int)(last_latency / GSECOND_1);
	s<<lend;
}
Exemplo n.º 2
0
char *UniqStrAddr( address *addr, char *buff, size_t buff_len )
{
    char        *p;

    p = CnvAddr( *addr, CAO_NORMAL_PLUS, true, buff, buff_len );
    if( p == NULL ) {
        p = AddrToString( addr, MAF_FULL, buff, buff_len );
    }
    return( p );
}
Exemplo n.º 3
0
char *CnvNearestAddr( address addr, char *buff, size_t buff_len )
{
    char        *p;

    p = CnvAddr( addr, CAO_OMIT_PLUS, false, buff, buff_len );
    if( p == NULL ) {
        p = AddrToString( &addr, MAF_FULL, buff, buff_len );
    }
    return( p );
}
Exemplo n.º 4
0
static  void    CalcAddrLen( a_window *wnd, address addr )
{
    asm_window  *asw = WndAsm( wnd );
    unsigned    old;

    old = NewCurrRadix( asw->hex ? 16 : 10 );
    AddrToString( &addr, MAF_OFFSET, TxtBuff, TXT_LEN );
    asw->address_end = MaxGadgetLength;
    asw->address_end += ( strlen( TxtBuff ) + 1 ) * WndMidCharX( wnd );
    NewCurrRadix( old );
}
Exemplo n.º 5
0
static void AsmSetFirst( a_window *wnd, address addr, bool use_first_source )
{
    int                 row,rows;
    asm_window          *asw = WndAsm( wnd );
    char                chr;
    mad_disasm_data     *dd;
    unsigned            addr_len;
    DIPHDL( cue, ch );

    _AllocA( dd, asw->ddsize );


    if( IS_NIL_ADDR( addr ) || ProgPeek( addr, &chr, 1 ) != 1 ) {
        addr = NilAddr;
    }
    asw->ins[ 0 ].addr = addr;
    asw->ins[ 0 ].line = 0;
    addr_len = AddrToString( &addr, MAF_OFFSET, TxtBuff, TXT_LEN ) - TxtBuff;
    if( addr_len != asw->addr_len ) {
        asw->addr_len = addr_len;
        AsmResize( wnd ); // recusively calls this routine!
        WndZapped( wnd );
        return;
    }
    rows = WndRows( wnd );
    for( row = 0; row < rows; ++row ) {
        asw->ins[ row ].addr = addr;
        if( IS_NIL_ADDR( addr ) ) continue;
        if( ExactCueAt( asw, addr, ch ) ) {
            if( row != 0 || use_first_source ) {
                asw->ins[ row ].addr = addr;
                asw->ins[ row ].line = CueLine( ch );
                ++row;
                if( row >= rows ) break;
            }
        }
        asw->ins[ row ].addr = addr;
        asw->ins[ row ].line = 0;
        if( MADDisasm( dd, &addr, 0 ) != MS_OK ) {
            addr = NilAddr;
        }
    }
}
Exemplo n.º 6
0
static char *GetBPCmd( brkp *bp, brk_event event, char *buff, unsigned buff_len )
{
    char        *cmds;
    char        *cond;
    char        *p;
    char        *end = buff + buff_len ;

    cmds = cond = LIT_ENG( Empty );
    if( bp != NULL ) {
        if( bp->cmds != NULL ) cmds = bp->cmds->buff;
        if( bp->condition != NULL ) cond = bp->condition;
    }
    p = Format( buff, "%s", GetCmdName( CMD_BREAK ) );
    switch( event ) {
    case B_SET:
        *p++ = '/';
        if( IS_BP_EXECUTE( bp->th ) ) {
            p = GetCmdEntry( PointNameTab, B_SET, p );
        } else {
            p += GetMADTypeNameForCmd( bp->th, p, end - p );
            *p++ = ' ';
        }
        if( bp->status.b.resume ) {
            *p++ = '/';
            p = GetCmdEntry( PointNameTab, B_RESUME, p );
        }
        if( !bp->status.b.active ) {
            *p++ = '/';
            p = GetCmdEntry( PointNameTab, B_DEACTIVATE, p );
        }
        *p++ = ' ';
        *p++ = '/';
        p = GetCmdEntry( PointNameTab, B_INDEX, p );
        p = Format( p, " %d, ", bp->index );
        if( bp->loc.image_name != NULL ) {
            *p++ = '/';
            p = GetCmdEntry( PointNameTab, B_UNMAPPED, p );
            *p++ = ' ';
            *p++ = '/';
            p = GetCmdEntry( PointNameTab, B_MAPADDRESS, p );
            *p++ = ' ';
            p = StrCopy( bp->loc.image_name, p );
            *p++ = ' ';
            p = AddHexSpec( p );
            p = CnvULongHex( bp->loc.addr.mach.segment, p, end - p );
            *p++ = ' ';
            p = AddHexSpec( p );
            p = CnvULongHex( bp->loc.addr.mach.offset, p, end - p );
            *p++ = ',';
        } else if( bp->image_name != NULL && bp->mod_name != NULL ) {
            *p++ = '/';
            p = GetCmdEntry( PointNameTab, B_UNMAPPED, p );
            *p++ = ' ';
            *p++ = '/';
            p = GetCmdEntry( PointNameTab, B_SYMADDRESS, p );
            *p++ = ' ';
            p = StrCopy( bp->image_name, p );
            *p++ = ' ';
            p = StrCopy( bp->mod_name, p );
            *p++ = ' ';
            p = StrCopy( bp->sym_name, p );
            *p++ = ' ';
            p = AddHexSpec( p );
            p = CnvULongHex( bp->cue_diff, p, end - p );
            *p++ = ' ';
            p = AddHexSpec( p );
            p = CnvULongHex( bp->addr_diff, p, end - p );
            *p++ = ',';
        } else {
            p = AddrToString( &bp->loc.addr, MAF_FULL, p, end - p );
//          p = Format( p, " %A", bp->loc.addr );
        }
        p = Format( p, " {%s} {%s}", cmds, cond );
        if( bp->initial_countdown != 0 ) {
            p = StrCopy( " ", p );
            p = AddHexSpec( p );
            p = CnvULongHex( bp->initial_countdown, p, end - p );
        }
        return( p );
    case B_CLEAR:
    case B_ACTIVATE:
    case B_DEACTIVATE:
    case B_RESUME:
    case B_UNRESUME:
        *p++ = '/';
        p = GetCmdEntry( PointNameTab, event, p );
        if( bp == NULL ) {
            p = StrCopy( "*", p );
        } else {
            p = AddrToString( &bp->loc.addr, MAF_FULL, p, end - p );
//          p = Format( p, " %A", bp->loc.addr );
        }
        return( p );
    }
    return( NULL );
}
Exemplo n.º 7
0
//--------------------------------------------------------------------------------
void CIPAddress::GetAddress(CString& sStr) const
	{
	sStr = AddrToString(m_nDWord);
	}