diff options
| author | hrydgard <hrydgard@gmail.com> | 2008-09-14 09:18:03 +0000 |
|---|---|---|
| committer | hrydgard <hrydgard@gmail.com> | 2008-09-14 09:18:03 +0000 |
| commit | 4c6d684a9ff7a912fa8f02b272c902ea6bbe6cbb (patch) | |
| tree | 612205aa207cbf62813f5f3c1e9ae9d93a32f96f /Source/Core/DebuggerWX/src | |
| parent | a56fcd4e981802f82b2dfadd125061d49ef8b104 (diff) | |
Some sanity checks in the debugger.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@524 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core/DebuggerWX/src')
| -rw-r--r-- | Source/Core/DebuggerWX/src/CodeWindow.cpp | 35 | ||||
| -rw-r--r-- | Source/Core/DebuggerWX/src/MemoryWindow.cpp | 11 |
2 files changed, 27 insertions, 19 deletions
diff --git a/Source/Core/DebuggerWX/src/CodeWindow.cpp b/Source/Core/DebuggerWX/src/CodeWindow.cpp index 11ca93ba4a..abb1685ac4 100644 --- a/Source/Core/DebuggerWX/src/CodeWindow.cpp +++ b/Source/Core/DebuggerWX/src/CodeWindow.cpp @@ -538,25 +538,31 @@ void CCodeWindow::OnAddrBoxChange(wxCommandEvent& event) void CCodeWindow::OnCallstackListChange(wxCommandEvent& event)
{
int index = callstack->GetSelection();
- u32 address = (u32)(u64)(callstack->GetClientData(index));
- if (address)
- JumpToAddress(address);
+ if (index >= 0) {
+ u32 address = (u32)(u64)(callstack->GetClientData(index));
+ if (address)
+ JumpToAddress(address);
+ }
}
void CCodeWindow::OnCallersListChange(wxCommandEvent& event)
{
int index = callers->GetSelection();
- u32 address = (u32)(u64)(callers->GetClientData(index));
- if (address)
- JumpToAddress(address);
+ if (index >= 0) {
+ u32 address = (u32)(u64)(callers->GetClientData(index));
+ if (address)
+ JumpToAddress(address);
+ }
}
void CCodeWindow::OnCallsListChange(wxCommandEvent& event)
{
int index = calls->GetSelection();
- u32 address = (u32)(u64)(calls->GetClientData(index));
- if (address)
- JumpToAddress(address);
+ if (index >= 0) {
+ u32 address = (u32)(u64)(calls->GetClientData(index));
+ if (address)
+ JumpToAddress(address);
+ }
}
void CCodeWindow::Update()
@@ -635,11 +641,12 @@ void CCodeWindow::UpdateButtonStates() void CCodeWindow::OnSymbolListChange(wxCommandEvent& event)
{
int index = symbols->GetSelection();
- Symbol* pSymbol = static_cast<Symbol *>(symbols->GetClientData(index));
-
- if (pSymbol != NULL)
- {
- JumpToAddress(pSymbol->address);
+ if (index >= 0) {
+ Symbol* pSymbol = static_cast<Symbol *>(symbols->GetClientData(index));
+ if (pSymbol != NULL)
+ {
+ JumpToAddress(pSymbol->address);
+ }
}
}
diff --git a/Source/Core/DebuggerWX/src/MemoryWindow.cpp b/Source/Core/DebuggerWX/src/MemoryWindow.cpp index 5d710fcb2d..506cea150d 100644 --- a/Source/Core/DebuggerWX/src/MemoryWindow.cpp +++ b/Source/Core/DebuggerWX/src/MemoryWindow.cpp @@ -168,11 +168,12 @@ void CMemoryWindow::NotifyMapLoaded() void CMemoryWindow::OnSymbolListChange(wxCommandEvent& event)
{
int index = symbols->GetSelection();
- Symbol* pSymbol = static_cast<Symbol *>(symbols->GetClientData(index));
-
- if (pSymbol != NULL)
- {
- memview->Center(pSymbol->address);
+ if (index >= 0) {
+ Symbol* pSymbol = static_cast<Symbol *>(symbols->GetClientData(index));
+ if (pSymbol != NULL)
+ {
+ memview->Center(pSymbol->address);
+ }
}
}
|
