本文整理汇总了C++中CtrlDisAsmView::setDebugger方法的典型用法代码示例。如果您正苦于以下问题:C++ CtrlDisAsmView::setDebugger方法的具体用法?C++ CtrlDisAsmView::setDebugger怎么用?C++ CtrlDisAsmView::setDebugger使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CtrlDisAsmView
的用法示例。
在下文中一共展示了CtrlDisAsmView::setDebugger方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SLOT
Debugger_Disasm::Debugger_Disasm(DebugInterface *_cpu, MainWindow* mainWindow_, QWidget *parent) :
QDialog(parent),
ui(new Ui::Debugger_Disasm),
cpu(_cpu),
mainWindow(mainWindow_)
{
ui->setupUi(this);
vfpudlg = new Debugger_VFPU(_cpu, mainWindow, this);
ui->DisasmView->setWindowTitle(_cpu->GetName());
QObject::connect(ui->RegListScroll,SIGNAL(actionTriggered(int)), ui->RegList, SLOT(scrollChanged(int)));
QObject::connect(ui->RegList,SIGNAL(GotoDisasm(u32)),this,SLOT(Goto(u32)));
QObject::connect(this, SIGNAL(updateDisplayList_()), this, SLOT(UpdateDisplayListGUI()));
QObject::connect(this, SIGNAL(UpdateBreakpoints_()), this, SLOT(UpdateBreakpointsGUI()));
QObject::connect(this, SIGNAL(UpdateThread_()), this, SLOT(UpdateThreadGUI()));
CtrlDisAsmView *ptr = ui->DisasmView;
ptr->setDebugger(cpu);
ptr->setParentWindow(this);
ptr->gotoAddr(0x00000000);
CtrlRegisterList *rl = ui->RegList;
rl->setParentWindow(this);
rl->setCPU(cpu);
FillFunctions();
}
示例2: Dialog
CDisasm::CDisasm(HINSTANCE _hInstance, HWND _hParent, DebugInterface *_cpu) : Dialog((LPCSTR)IDD_DISASM, _hInstance, _hParent)
{
cpu = _cpu;
SetWindowText(m_hDlg,_cpu->GetName());
#ifdef THEMES
//if (WTL::CTheme::IsThemingSupported())
//EnableThemeDialogTexture(m_hDlg ,ETDT_ENABLETAB);
#endif
SetWindowPos(m_hDlg,0,500,200,0,0,SWP_NOSIZE);
CtrlDisAsmView *ptr = CtrlDisAsmView::getFrom(GetDlgItem(m_hDlg,IDC_DISASMVIEW));
ptr->setDebugger(cpu);
ptr->gotoAddr(0x00000000);
CtrlRegisterList *rl = CtrlRegisterList::getFrom(GetDlgItem(m_hDlg,IDC_REGLIST));
rl->setCPU(cpu);
GetWindowRect(m_hDlg,&minRect);
//symbolMap.FillSymbolListBox(GetDlgItem(m_hDlg, IDC_FUNCTIONLIST),ST_FUNCTION);
symbolMap.FillSymbolComboBox(GetDlgItem(m_hDlg, IDC_FUNCTIONLIST),ST_FUNCTION);
GetWindowRect(GetDlgItem(m_hDlg, IDC_REGLIST),®Rect);
GetWindowRect(GetDlgItem(m_hDlg, IDC_DISASMVIEW),&disRect);
HWND tabs = GetDlgItem(m_hDlg, IDC_LEFTTABS);
TCITEM tcItem;
ZeroMemory (&tcItem,sizeof (tcItem));
tcItem.mask = TCIF_TEXT;
tcItem.dwState = 0;
tcItem.pszText = "Regs";
tcItem.cchTextMax = (int)strlen(tcItem.pszText)+1;
tcItem.iImage = 0;
int result1 = TabCtrl_InsertItem(tabs, TabCtrl_GetItemCount(tabs),&tcItem);
tcItem.pszText = "Funcs";
tcItem.cchTextMax = (int)strlen(tcItem.pszText)+1;
int result2 = TabCtrl_InsertItem(tabs, TabCtrl_GetItemCount(tabs),&tcItem);
ShowWindow(GetDlgItem(m_hDlg, IDC_REGLIST), SW_NORMAL);
ShowWindow(GetDlgItem(m_hDlg, IDC_FUNCTIONLIST), SW_HIDE);
SetTimer(m_hDlg,1,1000,0);
/*
DWORD intAddress[14] =
{0x100, 0x200,0x300,0x400,0x500,0x600,0x700,0x800,0x900,0xc00,0xd00,0xf00,0x1300,0x1700};
char *intName[14] =
{"100 Reset","200 Mcheck", "300 DSI","400 ISI","500 External",
"600 Align","700 Program","800 FPU N/A","900 DEC","C00 SC",
"D00 Trace","F00 Perf","1300 Breakpt","1700 Thermal"};*/
//
// --- activate debug mode ---
//
SetDebugMode(true);
}
示例3: Dialog
CDisasm::CDisasm(HINSTANCE _hInstance, HWND _hParent, DebugInterface *_cpu) : Dialog((LPCSTR)IDD_DISASM, _hInstance, _hParent)
{
cpu = _cpu;
lastTicks = PSP_IsInited() ? CoreTiming::GetTicks() : 0;
keepStatusBarText = false;
hideBottomTabs = false;
SetWindowText(m_hDlg, ConvertUTF8ToWString(_cpu->GetName()).c_str());
#ifdef THEMES
//if (WTL::CTheme::IsThemingSupported())
//EnableThemeDialogTexture(m_hDlg ,ETDT_ENABLETAB);
#endif
RECT windowRect;
GetWindowRect(m_hDlg,&windowRect);
int defaultWidth = windowRect.right-windowRect.left;
int defaultHeight = windowRect.bottom-windowRect.top;
minWidth = defaultWidth - 100;
minHeight = defaultHeight - 200;
int x = g_Config.iDisasmWindowX == -1 ? windowRect.left : g_Config.iDisasmWindowX;
int y = g_Config.iDisasmWindowY == -1 ? windowRect.top : g_Config.iDisasmWindowY;
int w = g_Config.iDisasmWindowW == -1 ? defaultWidth : g_Config.iDisasmWindowW;
int h = g_Config.iDisasmWindowH == -1 ? defaultHeight : g_Config.iDisasmWindowH;
// init status bar
statusBarWnd = CreateWindowEx(0, STATUSCLASSNAME, L"", WS_CHILD | WS_VISIBLE, 0, 0, 0, 0, m_hDlg, (HMENU)IDC_DISASMSTATUSBAR, _hInstance, NULL);
if (g_Config.bDisplayStatusBar == false)
{
ShowWindow(statusBarWnd,SW_HIDE);
}
CtrlDisAsmView *ptr = CtrlDisAsmView::getFrom(GetDlgItem(m_hDlg,IDC_DISASMVIEW));
ptr->setDebugger(cpu);
ptr->gotoAddr(0x00000000);
CtrlRegisterList *rl = CtrlRegisterList::getFrom(GetDlgItem(m_hDlg,IDC_REGLIST));
rl->setCPU(cpu);
leftTabs = new TabControl(GetDlgItem(m_hDlg,IDC_LEFTTABS));
leftTabs->SetIgnoreBottomMargin(true);
leftTabs->AddTab(GetDlgItem(m_hDlg,IDC_REGLIST),L"Regs");
leftTabs->AddTab(GetDlgItem(m_hDlg,IDC_FUNCTIONLIST),L"Funcs");
leftTabs->ShowTab(0);
// subclass the goto edit box
HWND editWnd = GetDlgItem(m_hDlg,IDC_ADDRESS);
DefGotoEditProc = (WNDPROC)GetWindowLongPtr(editWnd,GWLP_WNDPROC);
SetWindowLongPtr(editWnd,GWLP_WNDPROC,(LONG_PTR)GotoEditProc);
// subclass the function list
HWND funcListWnd = GetDlgItem(m_hDlg,IDC_FUNCTIONLIST);
DefFuncListProc = (WNDPROC)GetWindowLongPtr(funcListWnd,GWLP_WNDPROC);
SetWindowLongPtr(funcListWnd,GWLP_WNDPROC,(LONG_PTR)FuncListProc);
// init bottom tabs
bottomTabs = new TabControl(GetDlgItem(m_hDlg,IDC_DEBUG_BOTTOMTABS));
HWND memHandle = GetDlgItem(m_hDlg,IDC_DEBUGMEMVIEW);
CtrlMemView *mem = CtrlMemView::getFrom(memHandle);
mem->setDebugger(_cpu);
bottomTabs->AddTab(memHandle,L"Memory");
breakpointList = new CtrlBreakpointList(GetDlgItem(m_hDlg,IDC_BREAKPOINTLIST),cpu,ptr);
breakpointList->reloadBreakpoints();
bottomTabs->AddTab(breakpointList->GetHandle(),L"Breakpoints");
threadList = new CtrlThreadList(GetDlgItem(m_hDlg,IDC_THREADLIST));
threadList->reloadThreads();
bottomTabs->AddTab(threadList->GetHandle(),L"Threads");
stackTraceView = new CtrlStackTraceView(GetDlgItem(m_hDlg,IDC_STACKFRAMES),cpu,ptr);
stackTraceView->loadStackTrace();
bottomTabs->AddTab(stackTraceView->GetHandle(),L"Stack frames");
moduleList = new CtrlModuleList(GetDlgItem(m_hDlg,IDC_MODULELIST),cpu);
moduleList->loadModules();
bottomTabs->AddTab(moduleList->GetHandle(),L"Modules");
bottomTabs->SetShowTabTitles(g_Config.bShowBottomTabTitles);
bottomTabs->ShowTab(memHandle);
// Actually resize the window to the proper size (after the above setup.)
// do it twice so that the window definitely receives a WM_SIZE message with
// the correct size (the default from the .rc tends to be off)
MoveWindow(m_hDlg,x,y,1,1,FALSE);
MoveWindow(m_hDlg,x,y,w,h,TRUE);
SetDebugMode(true, true);
}
示例4: Dialog
CDisasm::CDisasm(HINSTANCE _hInstance, HWND _hParent, DebugInterface *_cpu) : Dialog((LPCSTR)IDD_DISASM, _hInstance, _hParent)
{
cpu = _cpu;
lastTicks = CoreTiming::GetTicks();
SetWindowText(m_hDlg,_cpu->GetName());
#ifdef THEMES
//if (WTL::CTheme::IsThemingSupported())
//EnableThemeDialogTexture(m_hDlg ,ETDT_ENABLETAB);
#endif
int x = g_Config.iDisasmWindowX == -1 ? 500 : g_Config.iDisasmWindowX;
int y = g_Config.iDisasmWindowY == -1 ? 200 : g_Config.iDisasmWindowY;
int w = g_Config.iDisasmWindowW;
int h = g_Config.iDisasmWindowH;
// Start with the initial size so we have the right minimum size from the rc.
SetWindowPos(m_hDlg, 0, x, y, 0, 0, SWP_NOSIZE);
CtrlDisAsmView *ptr = CtrlDisAsmView::getFrom(GetDlgItem(m_hDlg,IDC_DISASMVIEW));
ptr->setDebugger(cpu);
ptr->gotoAddr(0x00000000);
CtrlRegisterList *rl = CtrlRegisterList::getFrom(GetDlgItem(m_hDlg,IDC_REGLIST));
rl->setCPU(cpu);
GetWindowRect(m_hDlg, &defaultRect);
//symbolMap.FillSymbolListBox(GetDlgItem(m_hDlg, IDC_FUNCTIONLIST),ST_FUNCTION);
symbolMap.FillSymbolComboBox(GetDlgItem(m_hDlg, IDC_FUNCTIONLIST),ST_FUNCTION);
GetWindowRect(GetDlgItem(m_hDlg, IDC_REGLIST), ®Rect);
GetWindowRect(GetDlgItem(m_hDlg, IDC_DISASMVIEW), &disRect);
GetWindowRect(GetDlgItem(m_hDlg, IDC_BREAKPOINTLIST), &breakpointRect);
GetWindowRect(GetDlgItem(m_hDlg, IDC_BREAKPOINTLIST), &defaultBreakpointRect);
HWND tabs = GetDlgItem(m_hDlg, IDC_LEFTTABS);
TCITEM tcItem;
ZeroMemory (&tcItem,sizeof (tcItem));
tcItem.mask = TCIF_TEXT;
tcItem.dwState = 0;
tcItem.pszText = "Regs";
tcItem.cchTextMax = (int)strlen(tcItem.pszText)+1;
tcItem.iImage = 0;
int result1 = TabCtrl_InsertItem(tabs, TabCtrl_GetItemCount(tabs),&tcItem);
tcItem.pszText = "Funcs";
tcItem.cchTextMax = (int)strlen(tcItem.pszText)+1;
int result2 = TabCtrl_InsertItem(tabs, TabCtrl_GetItemCount(tabs),&tcItem);
ShowWindow(GetDlgItem(m_hDlg, IDC_REGLIST), SW_NORMAL);
ShowWindow(GetDlgItem(m_hDlg, IDC_FUNCTIONLIST), SW_HIDE);
SetTimer(m_hDlg,1,1000,0);
// subclass the goto edit box
HWND editWnd = GetDlgItem(m_hDlg,IDC_ADDRESS);
DefGotoEditProc = (WNDPROC)GetWindowLongPtr(editWnd,GWLP_WNDPROC);
SetWindowLongPtr(editWnd,GWLP_WNDPROC,(LONG_PTR)GotoEditProc);
// init memory viewer
CtrlMemView *mem = CtrlMemView::getFrom(GetDlgItem(m_hDlg,IDC_DEBUGMEMVIEW));
mem->setDebugger(_cpu);
breakpointList = new CtrlBreakpointList();
breakpointList->setCpu(cpu);
breakpointList->setDisasm(ptr);
breakpointList->setDialogItem(GetDlgItem(m_hDlg,IDC_BREAKPOINTLIST));
breakpointList->update();
threadList = new CtrlThreadList();
threadList->setDialogItem(GetDlgItem(m_hDlg,IDC_THREADLIST));
threadList->reloadThreads();
// init memory/breakpoint "tab"
ShowWindow(GetDlgItem(m_hDlg, IDC_BREAKPOINTLIST), SW_HIDE);
ShowWindow(GetDlgItem(m_hDlg, IDC_DEBUGMEMVIEW), SW_NORMAL);
ShowWindow(GetDlgItem(m_hDlg, IDC_THREADLIST), SW_HIDE);
// Actually resize the window to the proper size (after the above setup.)
if (w != -1 && h != -1)
{
// this will also call UpdateSize
SetWindowPos(m_hDlg, 0, x, y, w, h, 0);
}
SetDebugMode(true);
}
示例5: wndProc
LRESULT CALLBACK CtrlDisAsmView::wndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
CtrlDisAsmView *ccp = CtrlDisAsmView::getFrom(hwnd);
static bool lmbDown=false,rmbDown=false;
switch(msg)
{
case WM_COMMAND:
/* switch (wParam)
{
case ID_DISASM_GOTOINMEMORYVIEW:
CMemoryDlg::Goto(ccp->selection);
break;
case ID_DISASM_ADDHLE:
break;
case ID_DISASM_TOGGLEBREAKPOINT:
ccp->debugger->toggleBreakpoint(ccp->selection);
ccp->redraw();
break;
case ID_DISASM_COPYINSTRUCTIONDISASM:
CopyTextToClipboard(hwnd, ccp->debugger->disasm(ccp->selection));
break;
case ID_DISASM_COPYINSTRUCTIONHEX:
{
char temp[24];
sprintf(temp,"%08x",ccp->debugger->readMemory(ccp->selection));
CopyTextToClipboard(hwnd,temp);
}
break;
case ID_DISASM_RUNTOHERE:
{
ccp->debugger->setBreakpoint(ccp->selection);
ccp->debugger->runToBreakpoint();
ccp->redraw();
}
break;
}*/
break;
case WM_NCCREATE:
// Allocate a new CustCtrl structure for this window.
ccp = new CtrlDisAsmView(hwnd);
ccp->setDebugger(&di);
// Continue with window creation.
return ccp != NULL;
// Clean up when the window is destroyed.
case WM_NCDESTROY:
delete ccp;
break;
case WM_SETFONT:
break;
case WM_SIZE:
ccp->redraw();
break;
case WM_PAINT:
ccp->onPaint(wParam,lParam);
break;
case WM_VSCROLL:
ccp->onVScroll(wParam,lParam);
break;
case WM_ERASEBKGND:
return FALSE;
case WM_KEYDOWN:
ccp->onKeyDown(wParam,lParam);
break;
case WM_LBUTTONDOWN: SetFocus(hwnd); lmbDown=true; ccp->onMouseDown(wParam,lParam,1); break;
case WM_RBUTTONDOWN: rmbDown=true; ccp->onMouseDown(wParam,lParam,2); break;
case WM_MOUSEMOVE: ccp->onMouseMove(wParam,lParam,(lmbDown?1:0) | (rmbDown?2:0)); break;
case WM_LBUTTONUP: lmbDown=false; ccp->onMouseUp(wParam,lParam,1); break;
case WM_RBUTTONUP: rmbDown=false; ccp->onMouseUp(wParam,lParam,2); break;
case WM_SETFOCUS:
SetFocus(hwnd);
ccp->hasFocus=true;
ccp->redraw();
break;
case WM_KILLFOCUS:
ccp->hasFocus=false;
ccp->redraw();
break;
default:
break;
}
return DefWindowProc(hwnd, msg, wParam, lParam);
}