Ejemplo n.º 1
0
LRESULT CDebugCommandsView::OnAddBPButton(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hwnd*/, BOOL& /*bHandled*/)
{
    m_AddBreakpointDlg.DoModal(m_Debugger);
    RefreshBreakpointList();
    ShowAddress(m_StartAddress, TRUE);
    return FALSE;
}
Ejemplo n.º 2
0
LRESULT CDebugCommandsView::OnClearBPButton(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hwnd*/, BOOL& /*bHandled*/)
{
    m_Breakpoints->BPClear();
    RefreshBreakpointList();
    ShowAddress(m_StartAddress, TRUE);
    return FALSE;
}
Ejemplo n.º 3
0
LRESULT	CDebugCommandsView::OnSizing(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
    CRect listRect;
    m_CommandList.GetWindowRect(listRect);

    CRect headRect;
    CHeaderCtrl listHead = m_CommandList.GetHeader();
    listHead.GetWindowRect(&headRect);

    int rowsHeight = listRect.Height() - headRect.Height();

    int nRows = (rowsHeight / m_RowHeight);

    if (m_CommandListRows != nRows)
    {
        m_CommandListRows = nRows;
        ShowAddress(m_StartAddress, TRUE);
    }

    m_RegisterTabs.RedrawCurrentTab();

    // Fix cmd list header
    listHead.ResizeClient(listRect.Width(), headRect.Height());

    return FALSE;
}
Ejemplo n.º 4
0
LRESULT CDebugCommandsView::OnPopupmenuFollowJump(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hwnd*/, BOOL& /*bHandled*/)
{
    HistoryPushState();
    ShowAddress(m_FollowAddress, TRUE);
    HistoryPushState();
    return FALSE;
}
Ejemplo n.º 5
0
LRESULT CDebugCommandsView::OnViewPCButton(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hwnd*/, BOOL& /*bHandled*/)
{
    if (g_Reg != NULL && isStepping())
    {
        ShowAddress(g_Reg->m_PROGRAM_COUNTER, TRUE);
    }
    return FALSE;
}
Ejemplo n.º 6
0
void CDebugCommandsView::GotoEnteredAddress()
{
    char text[9];

    m_AddressEdit.GetWindowTextA(text, 9);

    DWORD address = strtoul(text, NULL, 16);
    address = address - address % 4;
    ShowAddress(address, TRUE);
}
Ejemplo n.º 7
0
/**
 * フォームロード
 */
__fastcall TForm1::TForm1(TComponent* Owner)
	: TForm(Owner)
{
	// メソッド内変数宣言
	TGridRect selection;

	try
	{
		//**************************************************
		//【初期化】
		//  変数
		//**************************************************
		selection.Left = -1;
		selection.Top = -1;
		selection.Right = -1;
		selection.Bottom = -1;

		//**************************************************
		//【初期化】
		//  コントロール
		//**************************************************
		// 住所リスト
		this->grd_Address->RowCount = 1;
		this->grd_Address->RowHeights[0] = 24;
		this->grd_Address->FixedRows = 0;

		// 住所リスト(ヘッダ)
		this->grd_Address->Cells[0][0] = "ID";
		this->grd_Address->ColWidths[0] = 50;

		this->grd_Address->Cells[1][0] = L"名前";
		this->grd_Address->ColWidths[1] = 100;

		this->grd_Address->Cells[2][0] = L"住所";
		this->grd_Address->ColWidths[2] = 174;

		this->grd_Address->Cells[3][0] = L"メモ";
		this->grd_Address->ColWidths[3] = 150;

		this->grd_Address->Cells[4][0] = L"有効";
		this->grd_Address->ColWidths[4] = 45;

		// 住所リスト(選択状態)
		this->grd_Address->Selection = selection;

		//**************************************************
		//【住所リスト表示】
		//**************************************************
		ShowAddress();
	}
	catch (int e)
	{
		ShowMessage("初期表示中に例外が発生しました。");
	}
}
Ejemplo n.º 8
0
void CDebugCommandsView::SteppingOpsChanged(void)
{
    if (!g_Settings->LoadBool(Debugger_SteppingOps))
    {
        m_Debugger->Debug_RefreshStackWindow();
        m_Debugger->Debug_RefreshStackTraceWindow();
        m_RegisterTabs.SetColorsEnabled(false);
        m_RegisterTabs.RefreshEdits();
        ShowAddress(m_StartAddress, TRUE);
    }
}
Ejemplo n.º 9
0
std::vector<CAAddressBookRecord*> CAAddressManager::getAddressBook()
{
    
    if (_addressBookArr.size()>0) {
        return _addressBookArr;
    }
    this->releaseJson(ShowAddress());
    
    return _addressBookArr;
    
    
}
Ejemplo n.º 10
0
LRESULT CDebugCommandsView::OnScroll(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
    WORD type = LOWORD(wParam);

    switch (type)
    {
    case SB_LINEUP:
        ShowAddress(m_StartAddress - 4, TRUE);
        break;
    case SB_LINEDOWN:
        ShowAddress(m_StartAddress + 4, TRUE);
        break;
    case SB_THUMBTRACK:
    {
        //int scrollPos = HIWORD(wParam);
        //ShowAddress(m_StartAddress + (scrollPos - 50) * 4, TRUE);
    }
    break;
    }

    return FALSE;
}
Ejemplo n.º 11
0
LRESULT CDebugCommandsView::OnActivate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
    if (!m_Attached)
    {
        return false;
    }
    if (LOWORD(wParam) != WA_INACTIVE)
    {
        ShowAddress(m_StartAddress, TRUE);
        RefreshBreakpointList();
    }
    return FALSE;
}
Ejemplo n.º 12
0
vector<CAAddressBookRecord> getAddressBook()
{
    if (_addressBookArr.size() > 0 )
    {
        return _addressBookArr;
    }
    
    CSJson::Reader read;
    CSJson::Value root;
    
    if (read.parse(ShowAddress(), root))
    {
        CSJson::Value personlist;
        personlist = root["person"];
        
        for (int i=0; i<personlist.size(); i++)
        {
            CSJson::Value person;
            person = personlist[i];
            CAAddressBookRecord addrec;
            
            addrec.fullname = person["name"].asString();
            
            CSJson::Value phonelist = person["phone"];
            
            for (int i=0; i<1; i++)
            {
                addrec.phoneNumber = phonelist[i].asString();
            }
            
            addrec.email = person["email"].asString();
            
            addrec.street = person["address_street"].asString();
            
            addrec.province = person["address_region"].asString();
            
            addrec.city = person["address_city"].asString();
            
            addrec.nickname = person["nickname"].asString();
            
            addrec.zip = person["address_postCode"].asString();
            
            _addressBookArr.push_back(addrec);
            
        }
    }

    return _addressBookArr;
}
Ejemplo n.º 13
0
void CDebugCommandsView::WaitingForStepChanged(void)
{
    if (WaitingForStep())
    {
        ShowAddress(g_Reg->m_PROGRAM_COUNTER, false);
        m_Debugger->Debug_RefreshStackWindow();
        m_Debugger->Debug_RefreshStackTraceWindow();
        m_StepButton.EnableWindow(true);
        m_StepOverButton.EnableWindow(true);
        m_GoButton.EnableWindow(true);
        m_AddressEdit.SetFocus();
    }
    else
    {
        m_StepButton.EnableWindow(false);
        m_StepOverButton.EnableWindow(false);
        m_GoButton.EnableWindow(false);
    }
}
Ejemplo n.º 14
0
void CDebugCommandsView::EditOp(uint32_t address, uint32_t op)
{
    uint32_t currentOp;
    g_MMU->LW_VAddr(address, currentOp);

    if (currentOp == op)
    {
        return;
    }

    g_MMU->SW_VAddr(address, op);

    if (!IsOpEdited(address))
    {
        m_EditedOps.push_back({ address, currentOp });
    }

    ShowAddress(m_StartAddress, TRUE);
}
Ejemplo n.º 15
0
LRESULT CDebugCommandsView::OnListBoxClicked(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
{
    if (wID == IDC_BP_LIST)
    {
        int index = m_BreakpointList.GetCaretIndex();
        uint32_t address = m_BreakpointList.GetItemData(index);
        int len = m_BreakpointList.GetTextLen(index);
        char* rowText = (char*)malloc(len + 1);
        rowText[len] = '\0';
        m_BreakpointList.GetText(index, rowText);
        if (*rowText == 'E')
        {
            ShowAddress(address, true);
        }
        else
        {
            m_Debugger->Debug_ShowMemoryLocation(address, true);
        }
        free(rowText);
    }
    return FALSE;
}
Ejemplo n.º 16
0
LRESULT CDebugCommandsView::OnRemoveBPButton(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hwnd*/, BOOL& /*bHandled*/)
{
    RemoveSelectedBreakpoints();
    ShowAddress(m_StartAddress, TRUE);
    return FALSE;
}
Ejemplo n.º 17
0
LRESULT CDebugCommandsView::OnPopupmenuRestoreAll(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hwnd*/, BOOL& /*bHandled*/)
{
    RestoreAllOps();
    ShowAddress(m_StartAddress, TRUE);
    return FALSE;
}
Ejemplo n.º 18
0
LRESULT CDebugCommandsView::OnPopupmenuInsertNOP(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hwnd*/, BOOL& /*bHandled*/)
{
    EditOp(m_SelectedAddress, 0x00000000);
    ShowAddress(m_StartAddress, TRUE);
    return FALSE;
}
Ejemplo n.º 19
0
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;
}
Ejemplo n.º 20
0
LRESULT CDebugCommandsView::OnPopupmenuClearBP(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hwnd*/, BOOL& /*bHandled*/)
{
    m_Breakpoints->EBPClear();
    ShowAddress(m_StartAddress, TRUE);
    return FALSE;
}