示例#1
0
/*
 * ScrollAsmDisplay - move asm display in response to a scroll request
 */
static void ScrollAsmDisplay( HWND hwnd, WORD wparam, address *paddr )
{
    switch( wparam ) {
    case SB_PAGEDOWN:
        if( !InstructionFoward( 8, paddr ) ) {
            return;
        }
        break;
    case SB_PAGEUP:
        if( !InstructionBackward( 8, paddr ) ) {
            return;
        }
        break;
    case SB_LINEDOWN:
        if( !InstructionFoward(1, paddr)){
            return;
        }
        break;
    case SB_LINEUP:
        if( !InstructionBackward( 1, paddr ) ){
            return;
        }
        break;
    default:
        return;
    }
    DisplayAsmLines( hwnd, paddr );

} /* ScrollAsmDisplay */
示例#2
0
/*
 * logDisasm - log some disassembly
 */
static void logDisasm( ExceptDlgInfo *info ) {
    int         i;
    address     addr;
    address     flagaddr;
    char        str[256];

    SetDisasmInfo( info->procinfo->prochdl, info->module );

    GetCurrAddr( &flagaddr, info->regs );
    addr = flagaddr;
    InstructionBackward( LogData.asm_bkup, &addr );

    for( i = 0; i <= LogData.asm_cnt; i++ ) {
        if( MADAddrComp( &addr, &flagaddr, MAF_FULL ) == 0 ) {
            logStrPrintf( "--->" );
        } else {
            logStrPrintf( "    " );
        }

        Disassemble( &addr, str, TRUE, 255 );
        logStrPrintf( "%s\n", str );
    }

} /* logDisasm */
示例#3
0
/*
 * InitStatDialog
 */
static void InitStatDialog( HWND hwnd )
{
    int                 i;
    char                buff[256];
    ExceptDlgInfo       *info;
    syminfo             si;
    CreateRegListData   data;
    StatData            *statdata;
    RECT                c_rect;
    HWND                combo;

    info = StatGetExceptDlgInfo( hwnd );
    StatHdl = hwnd;
    statdata = MemAlloc( sizeof( StatData ) );

    /*
     * fill in source information
     */
    GetCurrAddr( &( statdata->curr_addr ), info->regs );
    if( FindWatSymbol( &( statdata->curr_addr ), &si, TRUE ) == FOUND ) {
        RCsprintf( buff, STR_SRC_INFO_FMT, si.linenum, si.filename );
        StatShowSymbols = TRUE;
        CheckDlgButton( hwnd, STAT_SYMBOLS, ( StatShowSymbols ) ? BST_CHECKED : BST_UNCHECKED );
    } else {
        RCsprintf( buff, STR_N_A );
        StatShowSymbols = FALSE;
        EnableWindow( GetDlgItem( hwnd, STAT_SYMBOLS ), FALSE );
    }
    SetDlgMonoFont( hwnd, STAT_SRC_INFO );
    SetDlgItemText( hwnd, STAT_SRC_INFO, buff );

#ifdef __NT__
    {
        ProcStats       procinfo;
        HWND            button;
        if( GetProcessInfo( info->procinfo->procid, &procinfo ) ) {
            RCsprintf( buff, STR_STATUS_4_PROC_X, info->procinfo->procid, procinfo.name );
            SetWindowText( hwnd, buff );
        }
        CopyRCString( STR_VIEW_MEM_HT_KEY, buff, sizeof( buff ) );
        SetDlgItemText( hwnd, STAT_SEG_MAP, buff );
        button = GetDlgItem( hwnd, STAT_STACK_TRACE );
        ShowWindow( button, SW_HIDE );
    }
#endif
    InstructionBackward( 2, &( statdata->curr_addr ) );
    for( i = STAT_DISASM_1;i <= STAT_DISASM_8; i++ ) {
        SetDlgCourierFont( hwnd, i );
    }
    DisplayAsmLines( hwnd, &( statdata->curr_addr ) );
    data.index = 0;
    data.parent = hwnd;
    data.max_len = 0;
    combo = GetDlgItem( hwnd, STAT_REGISTER_COMBO );
    MADRegSetWalk( MTK_ALL, CreateAllRegLists, &data );
    if( data.index == 1 ) {
        SendMessage( combo, CB_GETLBTEXT, (WPARAM)0, (LPARAM)buff );
        SetDlgItemText( hwnd, STAT_REGISTER_SET, buff );
        DestroyWindow( combo );
    } else {
        GetChildPos( hwnd, combo, &c_rect );
        SendMessage( combo, CB_SETCURSEL, (WPARAM)0, (LPARAM)0 );
        c_rect.right += data.max_len;
        c_rect.bottom += SendMessage( combo, CB_GETITEMHEIGHT, 0, 0 ) * ( data.index + 1);
        MoveWindow( combo, c_rect.left, c_rect.top, c_rect.right, c_rect.bottom, FALSE );
    }
    SetFocus( GetDlgItem( hwnd, IDOK ) );
    statdata->reg_set_index = 0;
    SetWindowLong(hwnd,DWL_USER,(LONG)statdata);
} /* InitStatDialog */