mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-21 05:09:34 -06:00
WX: HiDPI: FrameAUI / Debugger
Changes: - MemoryWindow was cleaned up and gives more feedback on searches. Some bugs were fixed as well: - A complex bug that allowed tearing off tabs and opening multiple copies of a debug panel which lead to segfaults - Another segfault related to right-click menus on code/memory views when those tools were floating in their own window.
This commit is contained in:
@ -2,6 +2,8 @@
|
||||
// Licensed under GPLv2+
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include <algorithm>
|
||||
#include <cctype>
|
||||
#include <cmath>
|
||||
#include <string>
|
||||
#include <wx/brush.h>
|
||||
@ -17,6 +19,7 @@
|
||||
#include "Common/CommonTypes.h"
|
||||
#include "Common/DebugInterface.h"
|
||||
#include "Common/StringUtil.h"
|
||||
#include "Core/HW/Memmap.h"
|
||||
#include "Core/PowerPC/PPCSymbolDB.h"
|
||||
#include "Core/PowerPC/PowerPC.h"
|
||||
#include "DolphinWX/Debugger/CodeWindow.h"
|
||||
@ -25,6 +28,7 @@
|
||||
#include "DolphinWX/Debugger/WatchWindow.h"
|
||||
#include "DolphinWX/Frame.h"
|
||||
#include "DolphinWX/Globals.h"
|
||||
#include "DolphinWX/Main.h"
|
||||
#include "DolphinWX/WxUtils.h"
|
||||
|
||||
enum
|
||||
@ -42,11 +46,12 @@ enum
|
||||
IDM_VIEWASHEX,
|
||||
};
|
||||
|
||||
wxDEFINE_EVENT(DOLPHIN_EVT_MEMORY_VIEW_DATA_TYPE_CHANGED, wxCommandEvent);
|
||||
|
||||
CMemoryView::CMemoryView(DebugInterface* debuginterface, wxWindow* parent)
|
||||
: wxControl(parent, wxID_ANY), debugger(debuginterface),
|
||||
align(debuginterface->GetInstructionSize(0)), rowHeight(13), selection(0), oldSelection(0),
|
||||
selecting(false), memory(0), curAddress(debuginterface->GetPC()),
|
||||
dataType(MemoryDataType::U8), viewAsType(VIEWAS_FP)
|
||||
: wxControl(parent, wxID_ANY), debugger(debuginterface), align(0), rowHeight(FromDIP(13)),
|
||||
m_left_col_width(FromDIP(LEFT_COL_WIDTH)), selection(0), oldSelection(0), selecting(false),
|
||||
memory(0), curAddress(debuginterface->GetPC()), m_data_type(MemoryDataType::U8)
|
||||
{
|
||||
Bind(wxEVT_PAINT, &CMemoryView::OnPaint, this);
|
||||
Bind(wxEVT_LEFT_DOWN, &CMemoryView::OnMouseDownL, this);
|
||||
@ -56,6 +61,38 @@ CMemoryView::CMemoryView(DebugInterface* debuginterface, wxWindow* parent)
|
||||
Bind(wxEVT_MOUSEWHEEL, &CMemoryView::OnScrollWheel, this);
|
||||
Bind(wxEVT_MENU, &CMemoryView::OnPopupMenu, this);
|
||||
Bind(wxEVT_SIZE, &CMemoryView::OnResize, this);
|
||||
|
||||
SetDataType(MemoryDataType::FloatingPoint);
|
||||
|
||||
// Every pixel will be drawn over in the paint event so erasing will just cause flickering.
|
||||
SetBackgroundStyle(wxBG_STYLE_PAINT);
|
||||
#if defined(__WXMSW__) || defined(__WXGTK__)
|
||||
SetDoubleBuffered(true);
|
||||
#endif
|
||||
}
|
||||
|
||||
void CMemoryView::SetDataType(MemoryDataType data_type)
|
||||
{
|
||||
if (m_data_type == data_type)
|
||||
return;
|
||||
|
||||
m_data_type = data_type;
|
||||
switch (data_type)
|
||||
{
|
||||
case MemoryDataType::FloatingPoint:
|
||||
case MemoryDataType::ASCII:
|
||||
align = 4;
|
||||
break;
|
||||
default:
|
||||
align = 16;
|
||||
m_last_hex_type = data_type;
|
||||
break;
|
||||
}
|
||||
Refresh();
|
||||
|
||||
wxCommandEvent ev(DOLPHIN_EVT_MEMORY_VIEW_DATA_TYPE_CHANGED, GetId());
|
||||
ev.SetInt(static_cast<int>(data_type));
|
||||
GetEventHandler()->ProcessEvent(ev);
|
||||
}
|
||||
|
||||
int CMemoryView::YToAddress(int y)
|
||||
@ -68,10 +105,10 @@ int CMemoryView::YToAddress(int y)
|
||||
|
||||
void CMemoryView::OnMouseDownL(wxMouseEvent& event)
|
||||
{
|
||||
int x = event.m_x;
|
||||
int y = event.m_y;
|
||||
int x = event.GetX();
|
||||
int y = event.GetY();
|
||||
|
||||
if (x > 16)
|
||||
if (x > m_left_col_width)
|
||||
{
|
||||
oldSelection = selection;
|
||||
selection = YToAddress(y);
|
||||
@ -99,7 +136,7 @@ void CMemoryView::OnMouseMove(wxMouseEvent& event)
|
||||
{
|
||||
wxRect rc = GetClientRect();
|
||||
|
||||
if (event.m_leftDown && event.m_x > 16)
|
||||
if (event.m_leftDown && event.m_x > m_left_col_width)
|
||||
{
|
||||
if (event.m_y < 0)
|
||||
{
|
||||
@ -120,7 +157,7 @@ void CMemoryView::OnMouseMove(wxMouseEvent& event)
|
||||
|
||||
void CMemoryView::OnMouseUpL(wxMouseEvent& event)
|
||||
{
|
||||
if (event.m_x > 16)
|
||||
if (event.m_x > m_left_col_width)
|
||||
{
|
||||
curAddress = YToAddress(event.m_y);
|
||||
selecting = false;
|
||||
@ -137,11 +174,11 @@ void CMemoryView::OnScrollWheel(wxMouseEvent& event)
|
||||
|
||||
if (scroll_down)
|
||||
{
|
||||
curAddress += num_lines * 4;
|
||||
curAddress += num_lines * align;
|
||||
}
|
||||
else
|
||||
{
|
||||
curAddress -= num_lines * 4;
|
||||
curAddress -= num_lines * align;
|
||||
}
|
||||
|
||||
Refresh();
|
||||
@ -150,25 +187,26 @@ void CMemoryView::OnScrollWheel(wxMouseEvent& event)
|
||||
|
||||
void CMemoryView::OnPopupMenu(wxCommandEvent& event)
|
||||
{
|
||||
CFrame* main_frame = static_cast<CFrame*>(GetGrandParent()->GetParent());
|
||||
CCodeWindow* code_window = main_frame->g_pCodeWindow;
|
||||
CWatchWindow* watch_window = code_window->m_WatchWindow;
|
||||
|
||||
#if wxUSE_CLIPBOARD
|
||||
wxTheClipboard->Open();
|
||||
#endif
|
||||
// FIXME: This is terrible. Generate events instead.
|
||||
CFrame* cframe = wxGetApp().GetCFrame();
|
||||
CCodeWindow* code_window = cframe->g_pCodeWindow;
|
||||
CWatchWindow* watch_window = code_window->GetPanel<CWatchWindow>();
|
||||
|
||||
switch (event.GetId())
|
||||
{
|
||||
#if wxUSE_CLIPBOARD
|
||||
case IDM_COPYADDRESS:
|
||||
{
|
||||
wxClipboardLocker clipboard_lock;
|
||||
wxTheClipboard->SetData(new wxTextDataObject(wxString::Format("%08x", selection)));
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case IDM_COPYHEX:
|
||||
{
|
||||
std::string temp = StringFromFormat("%08x", debugger->ReadExtraMemory(memory, selection));
|
||||
wxTheClipboard->SetData(new wxTextDataObject(StrToWxStr(temp)));
|
||||
wxClipboardLocker clipboard_lock;
|
||||
wxTheClipboard->SetData(new wxTextDataObject(
|
||||
wxString::Format("%08x", debugger->ReadExtraMemory(memory, selection))));
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
@ -186,24 +224,21 @@ void CMemoryView::OnPopupMenu(wxCommandEvent& event)
|
||||
break;
|
||||
|
||||
case IDM_VIEWASFP:
|
||||
viewAsType = VIEWAS_FP;
|
||||
Refresh();
|
||||
SetDataType(MemoryDataType::FloatingPoint);
|
||||
break;
|
||||
|
||||
case IDM_VIEWASASCII:
|
||||
viewAsType = VIEWAS_ASCII;
|
||||
Refresh();
|
||||
SetDataType(MemoryDataType::ASCII);
|
||||
break;
|
||||
|
||||
case IDM_VIEWASHEX:
|
||||
viewAsType = VIEWAS_HEX;
|
||||
Refresh();
|
||||
SetDataType(m_last_hex_type);
|
||||
break;
|
||||
|
||||
default:
|
||||
event.Skip();
|
||||
break;
|
||||
}
|
||||
|
||||
#if wxUSE_CLIPBOARD
|
||||
wxTheClipboard->Close();
|
||||
#endif
|
||||
event.Skip();
|
||||
}
|
||||
|
||||
void CMemoryView::OnMouseDownR(wxMouseEvent& event)
|
||||
@ -216,12 +251,14 @@ void CMemoryView::OnMouseDownR(wxMouseEvent& event)
|
||||
menu.Append(IDM_COPYHEX, _("Copy &hex"));
|
||||
#endif
|
||||
menu.Append(IDM_WATCHADDRESS, _("Add to &watch"));
|
||||
menu.Append(IDM_TOGGLEMEMORY, _("Toggle &memory"));
|
||||
menu.AppendCheckItem(IDM_TOGGLEMEMORY, _("Toggle &memory"))->Check(memory != 0);
|
||||
|
||||
wxMenu* viewAsSubMenu = new wxMenu;
|
||||
viewAsSubMenu->Append(IDM_VIEWASFP, _("FP value"));
|
||||
viewAsSubMenu->Append(IDM_VIEWASASCII, "ASCII");
|
||||
viewAsSubMenu->Append(IDM_VIEWASHEX, _("Hex"));
|
||||
viewAsSubMenu->AppendRadioItem(IDM_VIEWASFP, _("FP value"))
|
||||
->Check(m_data_type == MemoryDataType::FloatingPoint);
|
||||
viewAsSubMenu->AppendRadioItem(IDM_VIEWASASCII, "ASCII")
|
||||
->Check(m_data_type == MemoryDataType::ASCII);
|
||||
viewAsSubMenu->AppendRadioItem(IDM_VIEWASHEX, _("Hex"))->Check(IsHexMode());
|
||||
menu.AppendSubMenu(viewAsSubMenu, _("View As:"));
|
||||
|
||||
PopupMenu(&menu);
|
||||
@ -231,176 +268,160 @@ void CMemoryView::OnPaint(wxPaintEvent& event)
|
||||
{
|
||||
wxPaintDC dc(this);
|
||||
wxRect rc = GetClientRect();
|
||||
wxFont hFont("Courier");
|
||||
hFont.SetFamily(wxFONTFAMILY_TELETYPE);
|
||||
|
||||
wxCoord w, h;
|
||||
dc.GetTextExtent("0WJyq", &w, &h, nullptr, nullptr, &hFont);
|
||||
if (h > rowHeight)
|
||||
rowHeight = h;
|
||||
dc.GetTextExtent("0WJyq", &w, &h, nullptr, nullptr, &DebuggerFont);
|
||||
if (h > rowHeight)
|
||||
rowHeight = h;
|
||||
|
||||
if (viewAsType == VIEWAS_HEX)
|
||||
dc.SetFont(hFont);
|
||||
else
|
||||
if (DebuggerFont.IsFixedWidth())
|
||||
{
|
||||
dc.SetFont(DebuggerFont);
|
||||
}
|
||||
else
|
||||
{
|
||||
dc.SetFont(wxFont(DebuggerFont.GetPointSize(), wxFONTFAMILY_TELETYPE, wxFONTSTYLE_NORMAL,
|
||||
wxFONTWEIGHT_NORMAL, false, "Courier"));
|
||||
}
|
||||
|
||||
dc.GetTextExtent("W", &w, &h);
|
||||
int fontSize = w;
|
||||
int textPlacement = 17 + 9 * fontSize;
|
||||
int font_width;
|
||||
{
|
||||
wxFontMetrics metrics = dc.GetFontMetrics();
|
||||
font_width = metrics.averageWidth;
|
||||
if (metrics.height > rowHeight)
|
||||
rowHeight = metrics.height;
|
||||
}
|
||||
|
||||
// TODO: Add any drawing code here...
|
||||
int width = rc.width;
|
||||
int numRows = (rc.height / rowHeight) / 2 + 2;
|
||||
dc.SetBackgroundMode(wxPENSTYLE_TRANSPARENT);
|
||||
const wxColour bgColor = *wxWHITE;
|
||||
wxPen nullPen(bgColor);
|
||||
wxPen currentPen(*wxBLACK_PEN);
|
||||
wxPen selPen(*wxGREY_PEN);
|
||||
nullPen.SetStyle(wxPENSTYLE_TRANSPARENT);
|
||||
const int row_start_x = m_left_col_width + 1;
|
||||
const int mchk_x = FromDIP(LEFT_COL_WIDTH / 8);
|
||||
const wxSize mchk_size = FromDIP(wxSize(LEFT_COL_WIDTH * 3 / 4, LEFT_COL_WIDTH * 3 / 4));
|
||||
const int mchk_offset_y = (rowHeight - mchk_size.GetHeight()) / 2;
|
||||
|
||||
wxBrush currentBrush(*wxLIGHT_GREY_BRUSH);
|
||||
wxBrush pcBrush(*wxGREEN_BRUSH);
|
||||
wxBrush mcBrush(*wxBLUE_BRUSH);
|
||||
wxBrush bgBrush(bgColor);
|
||||
wxBrush nullBrush(bgColor);
|
||||
nullBrush.SetStyle(wxBRUSHSTYLE_TRANSPARENT);
|
||||
int col_width = rc.width - m_left_col_width;
|
||||
int num_rows = (rc.height / rowHeight) / 2 + 2;
|
||||
const wxColour navy_color = wxTheColourDatabase->Find("NAVY");
|
||||
|
||||
dc.SetPen(nullPen);
|
||||
dc.SetBrush(bgBrush);
|
||||
dc.DrawRectangle(0, 0, 16, rc.height);
|
||||
dc.DrawRectangle(0, 0, rc.width, 5 + 8);
|
||||
const int pen_width = FromDIP(1);
|
||||
wxPen focus_pen(*wxBLACK, pen_width);
|
||||
wxPen selection_pen(*wxLIGHT_GREY, pen_width);
|
||||
wxBrush pc_brush(*wxGREEN_BRUSH);
|
||||
wxBrush mc_brush(*wxBLUE_BRUSH);
|
||||
wxBrush bg_brush(*wxWHITE_BRUSH);
|
||||
|
||||
// TODO - clean up this freaking mess!!!!!
|
||||
for (int row = -numRows; row <= numRows; row++)
|
||||
for (int row = -num_rows; row <= num_rows; ++row)
|
||||
{
|
||||
unsigned int address = curAddress + row * align;
|
||||
u32 address = curAddress + row * align;
|
||||
|
||||
int rowY1 = rc.height / 2 + rowHeight * row - rowHeight / 2;
|
||||
int rowY2 = rc.height / 2 + rowHeight * row + rowHeight / 2;
|
||||
int row_y = rc.height / 2 + rowHeight * row - rowHeight / 2;
|
||||
int row_x = row_start_x;
|
||||
|
||||
auto draw_text = [&](const wxString& s, int offset_chars = 0, int min_length = 0) -> void {
|
||||
dc.DrawText(s, row_x + font_width * offset_chars, row_y);
|
||||
row_x += font_width * (std::max(static_cast<int>(s.size()), min_length) + offset_chars);
|
||||
};
|
||||
|
||||
wxString temp = wxString::Format("%08x", address);
|
||||
u32 col = debugger->GetColor(address);
|
||||
wxBrush rowBrush(wxColour(col >> 16, col >> 8, col));
|
||||
dc.SetBrush(nullBrush);
|
||||
dc.SetPen(nullPen);
|
||||
dc.DrawRectangle(0, rowY1, 16, rowY2);
|
||||
dc.SetBrush(bg_brush);
|
||||
dc.SetPen(*wxTRANSPARENT_PEN);
|
||||
dc.DrawRectangle(0, row_y, m_left_col_width, rowHeight);
|
||||
|
||||
if (selecting && (address == selection))
|
||||
dc.SetPen(selPen);
|
||||
dc.SetPen(selection_pen);
|
||||
else
|
||||
dc.SetPen(row == 0 ? currentPen : nullPen);
|
||||
dc.SetPen(row == 0 ? focus_pen : *wxTRANSPARENT_PEN);
|
||||
|
||||
if (address == debugger->GetPC())
|
||||
dc.SetBrush(pcBrush);
|
||||
dc.SetBrush(pc_brush);
|
||||
else
|
||||
dc.SetBrush(rowBrush);
|
||||
|
||||
dc.DrawRectangle(16, rowY1, width, rowY2 - 1);
|
||||
dc.SetBrush(currentBrush);
|
||||
dc.SetTextForeground("#600000"); // Dark red
|
||||
dc.DrawText(temp, 17, rowY1);
|
||||
dc.DrawRectangle(m_left_col_width, row_y, col_width, rowHeight);
|
||||
dc.SetTextForeground(wxColour(0x60, 0x00, 0x00)); // Dark red
|
||||
draw_text(temp);
|
||||
|
||||
if (viewAsType != VIEWAS_HEX)
|
||||
if (!IsHexMode())
|
||||
{
|
||||
char mem[256];
|
||||
debugger->GetRawMemoryString(memory, address, mem, 256);
|
||||
dc.SetTextForeground(wxTheColourDatabase->Find("NAVY"));
|
||||
dc.DrawText(StrToWxStr(mem), 17 + fontSize * (8), rowY1);
|
||||
dc.SetTextForeground(*wxBLACK);
|
||||
dc.SetTextForeground(navy_color);
|
||||
draw_text(StrToWxStr(mem), 2);
|
||||
}
|
||||
dc.SetTextForeground(*wxBLACK);
|
||||
|
||||
// NOTE: We can trigger a segfault inside HostIsRAMAddress (nullptr) during shutdown
|
||||
// because we still get paint events even though the core is being deleted so we
|
||||
// need to make sure the Memory still exists.
|
||||
// FIXME: This isn't relevant to the DSP Memory View
|
||||
if (!debugger->IsAlive() || !Memory::IsInitialized() || !PowerPC::HostIsRAMAddress(address))
|
||||
continue;
|
||||
|
||||
std::string dis;
|
||||
// FIXME: This doesn't work with the DSP Debugger
|
||||
u32 mem_data = debugger->ReadExtraMemory(memory, address);
|
||||
|
||||
if (m_data_type == MemoryDataType::FloatingPoint)
|
||||
{
|
||||
float& flt = reinterpret_cast<float&>(mem_data);
|
||||
dis = StringFromFormat("f: %f", flt);
|
||||
}
|
||||
else if (m_data_type == MemoryDataType::ASCII)
|
||||
{
|
||||
dis.reserve(4);
|
||||
for (unsigned int i = 0; i < 4; ++i)
|
||||
{
|
||||
u8 byte = static_cast<u8>(mem_data >> (24 - i * 8));
|
||||
if (std::isprint(byte))
|
||||
dis += static_cast<char>(byte);
|
||||
else
|
||||
dis += ' ';
|
||||
}
|
||||
|
||||
Symbol* sym = g_symbolDB.GetSymbolFromAddr(mem_data);
|
||||
if (sym)
|
||||
{
|
||||
dis += StringFromFormat(" # -> %s", sym->name.c_str());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
dis.reserve(48);
|
||||
for (unsigned int i = 0; i < align; i += sizeof(u32))
|
||||
{
|
||||
if (!PowerPC::HostIsRAMAddress(address + i))
|
||||
break;
|
||||
u32 word = debugger->ReadExtraMemory(memory, address + i);
|
||||
switch (m_data_type)
|
||||
{
|
||||
case MemoryDataType::U8:
|
||||
default:
|
||||
dis += StringFromFormat(" %02X %02X %02X %02X", (word >> 24) & 0xFF, (word >> 16) & 0xFF,
|
||||
(word >> 8) & 0xFF, word & 0xFF);
|
||||
break;
|
||||
case MemoryDataType::U16:
|
||||
dis += StringFromFormat(" %04X %04X", (word >> 16) & 0xFFFF, word & 0xFFFF);
|
||||
break;
|
||||
case MemoryDataType::U32:
|
||||
dis += StringFromFormat(" %08X", word);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (debugger->IsAlive())
|
||||
// Pad to a minimum of 48 characters for full fixed point float width
|
||||
draw_text(StrToWxStr(dis), 2, 48);
|
||||
|
||||
dc.SetTextForeground(*wxBLUE);
|
||||
|
||||
std::string desc = debugger->GetDescription(address);
|
||||
if (!desc.empty())
|
||||
draw_text(StrToWxStr(desc), 2);
|
||||
|
||||
// Show blue memory check dot
|
||||
if (debugger->IsMemCheck(address))
|
||||
{
|
||||
if (!PowerPC::HostIsRAMAddress(address))
|
||||
continue;
|
||||
|
||||
std::string dis;
|
||||
u32 mem_data = debugger->ReadExtraMemory(memory, address);
|
||||
|
||||
if (viewAsType == VIEWAS_FP)
|
||||
{
|
||||
float flt = *(float*)(&mem_data);
|
||||
dis = StringFromFormat("f: %f", flt);
|
||||
}
|
||||
else if (viewAsType == VIEWAS_ASCII)
|
||||
{
|
||||
u32 a[4] = {(mem_data & 0xff000000) >> 24, (mem_data & 0xff0000) >> 16,
|
||||
(mem_data & 0xff00) >> 8, (mem_data & 0xff)};
|
||||
|
||||
for (auto& word : a)
|
||||
{
|
||||
if (word == '\0')
|
||||
word = ' ';
|
||||
}
|
||||
|
||||
Symbol* sym = g_symbolDB.GetSymbolFromAddr(mem_data);
|
||||
if (sym == nullptr)
|
||||
dis = StringFromFormat("%c%c%c%c", a[0], a[1], a[2], a[3]);
|
||||
else
|
||||
dis = StringFromFormat("# -> %s", sym->name.c_str());
|
||||
}
|
||||
else if (viewAsType == VIEWAS_HEX)
|
||||
{
|
||||
u32 mema[8] = {debugger->ReadExtraMemory(memory, address),
|
||||
debugger->ReadExtraMemory(memory, address + 4),
|
||||
debugger->ReadExtraMemory(memory, address + 8),
|
||||
debugger->ReadExtraMemory(memory, address + 12),
|
||||
debugger->ReadExtraMemory(memory, address + 16),
|
||||
debugger->ReadExtraMemory(memory, address + 20),
|
||||
debugger->ReadExtraMemory(memory, address + 24),
|
||||
debugger->ReadExtraMemory(memory, address + 28)};
|
||||
|
||||
for (auto& word : mema)
|
||||
{
|
||||
switch (dataType)
|
||||
{
|
||||
case MemoryDataType::U8:
|
||||
dis += StringFromFormat(" %02X %02X %02X %02X", ((word & 0xff000000) >> 24) & 0xFF,
|
||||
((word & 0xff0000) >> 16) & 0xFF, ((word & 0xff00) >> 8) & 0xFF,
|
||||
word & 0xff);
|
||||
break;
|
||||
case MemoryDataType::U16:
|
||||
dis += StringFromFormat(" %02X%02X %02X%02X", ((word & 0xff000000) >> 24) & 0xFF,
|
||||
((word & 0xff0000) >> 16) & 0xFF, ((word & 0xff00) >> 8) & 0xFF,
|
||||
word & 0xff);
|
||||
break;
|
||||
case MemoryDataType::U32:
|
||||
dis += StringFromFormat(" %02X%02X%02X%02X", ((word & 0xff000000) >> 24) & 0xFF,
|
||||
((word & 0xff0000) >> 16) & 0xFF, ((word & 0xff00) >> 8) & 0xFF,
|
||||
word & 0xff);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
dis = "INVALID VIEWAS TYPE";
|
||||
}
|
||||
|
||||
if (viewAsType != VIEWAS_HEX)
|
||||
dc.DrawText(StrToWxStr(dis), textPlacement + fontSize * (8 + 8), rowY1);
|
||||
else
|
||||
dc.DrawText(StrToWxStr(dis), textPlacement, rowY1);
|
||||
|
||||
dc.SetTextForeground(*wxBLUE);
|
||||
|
||||
std::string desc = debugger->GetDescription(address);
|
||||
if (!desc.empty())
|
||||
dc.DrawText(StrToWxStr(desc), 17 + fontSize * ((8 + 8 + 8 + 30) * 2), rowY1);
|
||||
|
||||
// Show blue memory check dot
|
||||
if (debugger->IsMemCheck(address))
|
||||
{
|
||||
dc.SetBrush(mcBrush);
|
||||
dc.DrawRectangle(8, rowY1 + 1, 11, 11);
|
||||
}
|
||||
dc.SetPen(*wxTRANSPARENT_PEN);
|
||||
dc.SetBrush(mc_brush);
|
||||
dc.DrawEllipse(mchk_x, row_y + mchk_offset_y, mchk_size.GetWidth(), mchk_size.GetHeight());
|
||||
}
|
||||
}
|
||||
|
||||
dc.SetPen(currentPen);
|
||||
}
|
||||
|
||||
void CMemoryView::OnResize(wxSizeEvent& event)
|
||||
|
Reference in New Issue
Block a user