Exemplo n.º 1
0
LRESULT CDebugSymbols::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
    DlgResize_Init(false, true);

    m_SymbolsListView.Attach(GetDlgItem(IDC_SYMBOLS_LIST));
    m_SymbolsListView.SetExtendedListViewStyle(LVS_EX_FULLROWSELECT | LVS_EX_DOUBLEBUFFER);

    m_SymbolsListView.AddColumn("Address", 0);
    m_SymbolsListView.AddColumn("Type", 1);
    m_SymbolsListView.AddColumn("Name", 2);
    m_SymbolsListView.AddColumn("Value", 3);
    m_SymbolsListView.AddColumn("Description", 4);

    m_SymbolsListView.SetColumnWidth(0, 70);
    m_SymbolsListView.SetColumnWidth(1, 40);
    m_SymbolsListView.SetColumnWidth(2, 120);
    m_SymbolsListView.SetColumnWidth(3, 100);
    m_SymbolsListView.SetColumnWidth(4, 120);

    Refresh();

    m_AutoRefreshThread = CreateThread(NULL, 0, AutoRefreshProc, (void*)this, 0, NULL);

    WindowCreated();
    return 0;
}
Exemplo n.º 2
0
LRESULT CDebugScripts::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
    DlgResize_Init(false, true);

    HFONT monoFont = CreateFont(-11, 0, 0, 0,
        FW_DONTCARE, FALSE, FALSE, FALSE, DEFAULT_CHARSET,
        OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS,
        CLEARTYPE_QUALITY, FF_DONTCARE, "Consolas"
    );

    m_InstanceInfoEdit.Attach(GetDlgItem(IDC_CTX_INFO_EDIT));

    m_ScriptList.Attach(GetDlgItem(IDC_SCRIPT_LIST));
    m_ScriptList.AddColumn("Script", 0, 0);
    m_ScriptList.SetColumnWidth(0, 100);
    m_ScriptList.SetExtendedListViewStyle(LVS_EX_FULLROWSELECT | LVS_EX_DOUBLEBUFFER);
    m_ScriptList.ModifyStyle(LVS_OWNERDRAWFIXED, 0, 0);

    m_EvalEdit.Attach(GetDlgItem(IDC_EVAL_EDIT));
    m_EvalEdit.SetScriptWindow(this);
    m_EvalEdit.SetFont(monoFont);
    m_EvalEdit.EnableWindow(FALSE);

    m_ConsoleEdit.Attach(GetDlgItem(IDC_CONSOLE_EDIT));
    m_ConsoleEdit.SetLimitText(0);
    m_ConsoleEdit.SetFont(monoFont);

    RefreshList();

    WindowCreated();
    return 0;
}
NS_IMETHODIMP
EmbedChromeManager::Observe(nsISupports *aSubject,
                             const char *aTopic,
                             const PRUnichar *aData)
{
    nsresult rv;
    if (!strcmp(aTopic, "domwindowopened")) {
        nsCOMPtr<nsIDOMWindow> win = do_QueryInterface(aSubject, &rv);
        NS_ENSURE_SUCCESS(rv, NS_OK);
        WindowCreated(win);
    } else if (!strcmp(aTopic, "domwindowclosed")) {
        nsCOMPtr<nsIDOMWindow> win = do_QueryInterface(aSubject, &rv);
        NS_ENSURE_SUCCESS(rv, NS_OK);
        WindowDestroyed(win);
    } else {
        LOGT("obj:%p, top:%s", aSubject, aTopic);
    }

    return NS_OK;
}
Exemplo n.º 4
0
LRESULT	CDumpMemory::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
    m_StartAddress.Attach(GetDlgItem(IDC_E_START_ADDR));
    m_EndAddress.Attach(GetDlgItem(IDC_E_END_ADDR));
    m_PC.Attach(GetDlgItem(IDC_E_ALT_PC));

    m_StartAddress.SetDisplayType(CEditNumber::DisplayHex);
    m_EndAddress.SetDisplayType(CEditNumber::DisplayHex);
    m_PC.SetDisplayType(CEditNumber::DisplayHex);

    m_StartAddress.SetValue(0x80000000, true, true);
    m_EndAddress.SetValue(0x803FFFF0, true, true);
    m_PC.SetValue(0x80000000);
    HWND hFormatList = GetDlgItem(IDC_FORMAT);
    int pos = ::SendMessage(hFormatList, CB_ADDSTRING, (WPARAM)0, (LPARAM)"TEXT - Disassembly + PC");
    ::SendMessage(hFormatList, CB_SETITEMDATA, (WPARAM)pos, (LPARAM)DisassemblyWithPC);
    ::SendMessage(hFormatList, CB_SETCURSEL, (WPARAM)0, (LPARAM)0);

    WindowCreated();
    return TRUE;
}
LRESULT	CDebugMemorySearch::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
    m_PAddrStart.Attach(GetDlgItem(IDC_PADDR_START));
    m_PAddrStart.SetDisplayType(CEditNumber::DisplayHex);
    m_SearchLen.Attach(GetDlgItem(IDC_ADDR_END));
    m_SearchLen.SetDisplayType(CEditNumber::DisplayHex);
    m_SearchValue.Attach(GetDlgItem(IDC_SEARCH_VALUE));
    m_SearchValue.SetDisplayType(CEditNumber::DisplayDec);
    m_SearchValue.SetValue(0);
    m_MaxSearch.Attach(GetDlgItem(IDC_MAX_SEARCH));
    m_MaxSearch.SetDisplayType(CEditNumber::DisplayDec);
    m_MaxSearch.SetValue(50000);
    m_UnknownSize.Attach(GetDlgItem(IDC_UNKNOWN_ALIGN));
    AddAlignmentOptions(m_UnknownSize);
    m_ValueSize.Attach(GetDlgItem(IDC_VALUE_ALIGN));
    AddAlignmentOptions(m_ValueSize);
    m_SearchResults.Attach(GetDlgItem(IDC_LST_RESULTS));
    m_SearchResults.AddColumn("ID", 0);
    m_SearchResults.AddColumn("PAddr", 1);
    m_SearchResults.AddColumn("Value", 2);
    m_SearchResults.SetColumnWidth(0, 50);
    m_SearchResults.SetColumnWidth(1, 75);
    m_SearchResults.SetColumnWidth(2, 75);
    m_SearchResults.SetExtendedListViewStyle(LVS_EX_FULLROWSELECT);
    m_UnknownOptions.Attach(GetDlgItem(IDC_CMB_UNKNOWN));
    m_HaveResults = false;
    FixUnknownOptions(true);

    SendMessage(GetDlgItem(IDC_RADIO_VALUE), BM_SETCHECK, BST_CHECKED, 0);

    BOOL bHandled;
    OnClicked(0, IDC_BTN_RDRAM, NULL, bHandled);
    OnClicked(0, IDC_RADIO_VALUE, NULL, bHandled);
    WindowCreated();
    return TRUE;
}
LRESULT	CDebugCommandsView::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
    g_Settings->RegisterChangeCB(Debugger_WaitingForStep, this, (CSettings::SettingChangedFunc)StaticWaitingForStepChanged);
    g_Settings->RegisterChangeCB(Debugger_SteppingOps, this, (CSettings::SettingChangedFunc)StaticSteppingOpsChanged);

    m_CommandList.Attach(GetDlgItem(IDC_CMD_LIST));
    m_BreakpointList.Attach(GetDlgItem(IDC_BP_LIST));
    m_AddressEdit.Attach(GetDlgItem(IDC_ADDR_EDIT));
    m_PCEdit.Attach(GetDlgItem(IDC_PC_EDIT));
    m_ViewPCButton.Attach(GetDlgItem(IDC_VIEWPC_BTN));
    m_StepButton.Attach(GetDlgItem(IDC_STEP_BTN));
    m_StepOverButton.Attach(GetDlgItem(IDC_STEPOVER_BTN));
    m_SkipButton.Attach(GetDlgItem(IDC_SKIP_BTN));
    m_GoButton.Attach(GetDlgItem(IDC_GO_BTN));
    m_RegisterTabs.Attach(GetDlgItem(IDC_REG_TABS));
    m_Scrollbar.Attach(GetDlgItem(IDC_SCRL_BAR));
    m_BackButton.Attach(GetDlgItem(IDC_BACK_BTN));
    m_ForwardButton.Attach(GetDlgItem(IDC_FORWARD_BTN));
    m_OpEdit.Attach(GetDlgItem(IDC_OP_EDIT));

    DlgResize_Init(false, true);
    DlgToolTip_Init();

    GetWindowRect(&m_DefaultWindowRect);

    // Setup address input
    m_AddressEdit.SetDisplayType(CEditNumber32::DisplayHex);
    m_AddressEdit.SetLimitText(8);

    // Setup PC register input
    m_PCEdit.SetDisplayType(CEditNumber32::DisplayHex);
    m_PCEdit.SetLimitText(8);

    m_bIgnorePCChange = true;
    m_PCEdit.SetValue(0x80000180, false, true);

    // Setup View PC button
    m_ViewPCButton.EnableWindow(FALSE);
    m_StepButton.EnableWindow(FALSE);
    m_StepOverButton.EnableWindow(FALSE);
    m_SkipButton.EnableWindow(FALSE);
    m_GoButton.EnableWindow(FALSE);

    // Setup breakpoint list
    m_BreakpointList.ModifyStyle(NULL, LBS_NOTIFY);
    RefreshBreakpointList();

    // Setup list scrollbar
    m_Scrollbar.SetScrollRange(0, 100, FALSE);
    m_Scrollbar.SetScrollPos(50, TRUE);

    // Setup history buttons
    ToggleHistoryButtons();

    // Op editor
    m_OpEdit.SetCommandsWindow(this);

    m_bIgnoreAddrChange = true;
    m_AddressEdit.SetValue(0x80000000, false, true);
    ShowAddress(0x80000000, TRUE);

    if (isStepping())
    {
        m_ViewPCButton.EnableWindow(TRUE);
        m_StepButton.EnableWindow(TRUE);
        m_StepOverButton.EnableWindow(TRUE);
        m_SkipButton.EnableWindow(TRUE);
        m_GoButton.EnableWindow(TRUE);
    }

    _this = this;

    DWORD dwThreadID = ::GetCurrentThreadId();
    hWinMessageHook = SetWindowsHookEx(WH_GETMESSAGE, (HOOKPROC)HookProc, NULL, dwThreadID);

    WindowCreated();
    m_Attached = true;
    return TRUE;
}
LRESULT	CDebugMemoryView::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
	m_DataStartLoc = (DWORD)-1;
	m_CompareStartLoc = (DWORD)-1;
	memset(m_CompareData,0,sizeof(m_CompareData));
	memset(m_CompareValid,0,sizeof(m_CompareValid));

	HWND hScrlBar = GetDlgItem(IDC_SCRL_BAR);
	if (hScrlBar) {
		SCROLLINFO si;

		si.cbSize = sizeof(si);
		si.fMask  = SIF_RANGE | SIF_POS | SIF_PAGE;
		si.nMin   = 0;
		si.nMax   = 0xFFFF;
		si.nPos   = 0x8000;
		si.nPage  = 100;
		::SetScrollInfo(hScrlBar,SB_CTL,&si,TRUE);		
	} 

	m_MemAddr.Attach(GetDlgItem(IDC_ADDR_EDIT));
	m_MemAddr.SetDisplayType(CEditNumber::DisplayHex);
	m_MemAddr.SetValue(0x80000000,true,true);

	SendDlgItemMessage( IDC_CHK_VADDR, BM_SETCHECK, BST_CHECKED,0);

	if (m_MemoryList== NULL)
	{
		m_MemoryList = new CListCtrl;
		m_MemoryList->RegisterClass();
	}
	m_MemoryList->SubclassWindow( GetDlgItem( IDC_MEM_DETAILS ) );
	m_MemoryList->ShowHeader(false);
	m_MemoryList->SetSortEnabled(FALSE);
	m_MemoryList->AddColumn( _T( "Address" ), 90 );
	m_MemoryList->AddColumn( _T( "1" ), 20 );
	m_MemoryList->AddColumn( _T( "2" ), 20 );
	m_MemoryList->AddColumn( _T( "3" ), 20 );
	m_MemoryList->AddColumn( _T( "4" ), 20 );
	m_MemoryList->AddColumn( _T( "-" ), 10 );
	m_MemoryList->AddColumn( _T( "5" ), 20 );
	m_MemoryList->AddColumn( _T( "6" ), 20 );
	m_MemoryList->AddColumn( _T( "7" ), 20 );
	m_MemoryList->AddColumn( _T( "8" ), 20 );
	m_MemoryList->AddColumn( _T( "-" ), 10 );
	m_MemoryList->AddColumn( _T( "9" ), 20 );
	m_MemoryList->AddColumn( _T( "10" ), 20 );
	m_MemoryList->AddColumn( _T( "11" ), 20 );
	m_MemoryList->AddColumn( _T( "12" ), 20 );
	m_MemoryList->AddColumn( _T( "-" ), 10 );
	m_MemoryList->AddColumn( _T( "13" ), 20 );
	m_MemoryList->AddColumn( _T( "14" ), 20 );
	m_MemoryList->AddColumn( _T( "15" ), 20 );
	m_MemoryList->AddColumn( _T( "16" ), 35 );
	m_MemoryList->AddColumn( _T( "Memory Ascii" ), 140 );
	::SetWindowLongPtr(m_MemoryList->m_hWnd, GWL_EXSTYLE, WS_EX_CLIENTEDGE);
	RefreshMemory(false);
	int height = m_MemoryList->GetTotalHeight();
	
	RECT MemoryListRect = {0};
	::GetClientRect(GetDlgItem( IDC_MEM_DETAILS ), &MemoryListRect);

	if (height > MemoryListRect.bottom)
	{
		RECT MemoryListWindow = {0};
		GetWindowRect(&MemoryListWindow);
		SetWindowPos(NULL,0,0,MemoryListWindow.right - MemoryListWindow.left,(MemoryListWindow.bottom - MemoryListWindow.top) + (height - MemoryListRect.bottom), SWP_SHOWWINDOW | SWP_NOMOVE | SWP_NOZORDER);

		RECT DlgItemRect = {0};
		::GetWindowRect(GetDlgItem( IDC_BORDER ), &DlgItemRect);
		::SetWindowPos(GetDlgItem( IDC_BORDER ), NULL,0,0,DlgItemRect.right - DlgItemRect.left,(DlgItemRect.bottom - DlgItemRect.top) + (height - MemoryListRect.bottom), SWP_NOMOVE);

		::GetWindowRect(GetDlgItem( IDC_MEM_DETAILS ), &DlgItemRect);
		::SetWindowPos(GetDlgItem( IDC_MEM_DETAILS ), NULL,0,0,DlgItemRect.right - DlgItemRect.left,(DlgItemRect.bottom - DlgItemRect.top) + (height - MemoryListRect.bottom), SWP_NOMOVE);

		::GetWindowRect(GetDlgItem( IDC_SCRL_BAR ), &DlgItemRect);
		::SetWindowPos(GetDlgItem( IDC_SCRL_BAR ), NULL,0,0,DlgItemRect.right - DlgItemRect.left,(DlgItemRect.bottom - DlgItemRect.top) + (height - MemoryListRect.bottom), SWP_NOMOVE);
	}
	WindowCreated();
	return TRUE;
}
Exemplo n.º 8
0
LRESULT	CDebugTlb::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
    LV_COLUMN  col;

    col.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;
    col.fmt = LVCFMT_LEFT;

    col.pszText = "Index";
    col.cx = 40;
    col.iSubItem = 0;
    ListView_InsertColumn(GetDlgItem(IDC_LIST), 0, &col);

    col.pszText = "Page Mask";
    col.cx = 90;
    col.iSubItem = 1;
    ListView_InsertColumn(GetDlgItem(IDC_LIST), 1, &col);

    col.pszText = "Entry Hi";
    col.cx = 90;
    col.iSubItem = 2;
    ListView_InsertColumn(GetDlgItem(IDC_LIST), 2, &col);

    col.pszText = "Entry Lo0";
    col.cx = 90;
    col.iSubItem = 3;
    ListView_InsertColumn(GetDlgItem(IDC_LIST), 3, &col);

    col.pszText = "Entry Lo1";
    col.cx = 90;
    col.iSubItem = 4;
    ListView_InsertColumn(GetDlgItem(IDC_LIST), 4, &col);

    col.pszText = "Index";
    col.cx = 40;
    col.iSubItem = 0;
    ListView_InsertColumn(GetDlgItem(IDC_LIST2), 0, &col);

    col.pszText = "Valid";
    col.cx = 40;
    col.iSubItem = 1;
    ListView_InsertColumn(GetDlgItem(IDC_LIST2), 1, &col);

    col.pszText = "Dirty";
    col.cx = 40;
    col.iSubItem = 2;
    ListView_InsertColumn(GetDlgItem(IDC_LIST2), 2, &col);

    col.pszText = "Rule";
    col.cx = 270;
    col.iSubItem = 3;
    ListView_InsertColumn(GetDlgItem(IDC_LIST2), 3, &col);

    RefreshTLBWindow();
    SendMessage(GetDlgItem(IDC_TLB_ENTRIES), BM_SETCHECK, BST_CHECKED, 0);

    //	if (Settings().Load(TLBWindowLeft) <= 0)
    //	{
    //		SetWindowPos(NULL,Settings().Load(TLBWindowLeft),Settings().Load(TLBWindowTop),0,0, SWP_NOZORDER | SWP_NOSIZE | SWP_SHOWWINDOW);
    //	}
    WindowCreated();
    return TRUE;
}