Merge pull request #1556 from shygoo2/cmds-fix-addr-textbox

[Debugger] Commands: Update address textbox when address is changed
This commit is contained in:
zilmar 2019-01-18 15:29:30 +10:30 committed by GitHub
commit 557892e47e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 17 deletions

View File

@ -469,11 +469,17 @@ const char* CDebugCommandsView::GetCodeAddressNotes(uint32_t vAddr)
return NULL;
}
void CDebugCommandsView::ShowAddress(uint32_t address, bool top)
void CDebugCommandsView::ShowAddress(uint32_t address, bool top, bool bUserInput)
{
if (top == TRUE)
{
m_StartAddress = address;
m_StartAddress = address - address % 4;
if (!bUserInput)
{
m_bIgnoreAddrChange = true;
m_AddressEdit.SetValue(address, false, true);
}
if (!isStepping())
{
@ -494,7 +500,7 @@ void CDebugCommandsView::ShowAddress(uint32_t address, bool top)
if (bOutOfView)
{
m_StartAddress = address;
m_StartAddress = address - address % 4;
m_bIgnoreAddrChange = true;
m_AddressEdit.SetValue(address, false, true);
}
@ -1246,17 +1252,6 @@ LRESULT CDebugCommandsView::OnPopupmenuClearBP(WORD /*wNotifyCode*/, WORD /*wID*
return FALSE;
}
void CDebugCommandsView::GotoEnteredAddress()
{
char text[9];
m_AddressEdit.GetWindowTextA(text, 9);
DWORD address = strtoul(text, NULL, 16);
address = address - address % 4;
ShowAddress(address, TRUE);
}
void CDebugCommandsView::BeginOpEdit(uint32_t address)
{
uint32_t opcode;
@ -1310,7 +1305,10 @@ LRESULT CDebugCommandsView::OnAddrChanged(WORD /*wNotifyCode*/, WORD /*wID*/, HW
m_bIgnoreAddrChange = false;
return 0;
}
GotoEnteredAddress();
uint32_t address = m_AddressEdit.GetValue();
ShowAddress(address, TRUE, TRUE);
return 0;
}

View File

@ -81,7 +81,7 @@ public:
CDebugCommandsView(CDebuggerUI * debugger, SyncEvent &StepEvent);
virtual ~CDebugCommandsView(void);
void ShowAddress(uint32_t address, bool top);
void ShowAddress(uint32_t address, bool top, bool bUserInput = false);
void ShowPIRegTab();
void Reset();
@ -217,7 +217,6 @@ private:
void BeginOpEdit(uint32_t address);
void EndOpEdit();
void GotoEnteredAddress();
void RefreshBreakpointList();
void RemoveSelectedBreakpoints();