From c3213ade257d4a9cd0b3e679c64ae22d02731dcf Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sun, 3 Jun 2018 10:46:17 -0700 Subject: [PATCH] Qt Debugger: Remove disassembly. Being replaced by WebSocket based debugger which is better maintained. --- CMakeLists.txt | 7 - Qt/Debugger/ctrldisasmview.cpp | 422 ---------------------- Qt/Debugger/ctrldisasmview.h | 100 ------ Qt/Debugger/ctrlregisterlist.cpp | 335 ----------------- Qt/Debugger/ctrlregisterlist.h | 77 ---- Qt/Debugger/debugger_disasm.cpp | 594 ------------------------------- Qt/Debugger/debugger_disasm.h | 98 ----- Qt/Debugger/debugger_disasm.ui | 523 --------------------------- Qt/QtHost.h | 5 +- Qt/mainwindow.cpp | 25 +- Qt/mainwindow.h | 4 - Windows/PPSSPP.vcxproj | 41 +-- Windows/PPSSPP.vcxproj.filters | 37 +- 13 files changed, 7 insertions(+), 2261 deletions(-) delete mode 100644 Qt/Debugger/ctrldisasmview.cpp delete mode 100644 Qt/Debugger/ctrldisasmview.h delete mode 100644 Qt/Debugger/ctrlregisterlist.cpp delete mode 100644 Qt/Debugger/ctrlregisterlist.h delete mode 100644 Qt/Debugger/debugger_disasm.cpp delete mode 100644 Qt/Debugger/debugger_disasm.h delete mode 100644 Qt/Debugger/debugger_disasm.ui diff --git a/CMakeLists.txt b/CMakeLists.txt index d67b65f837..48d9ae691a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -757,7 +757,6 @@ elseif(USING_QT_UI) find_package(Qt5 COMPONENTS Multimedia) endif(NOT SDL2_FOUND) set(Qt_UI - Qt/Debugger/debugger_disasm.ui Qt/Debugger/debugger_displaylist.ui Qt/Debugger/debugger_memory.ui Qt/Debugger/debugger_memorytex.ui @@ -771,14 +770,8 @@ elseif(USING_QT_UI) Qt/QtHost.h Qt/mainwindow.cpp Qt/mainwindow.h - Qt/Debugger/ctrldisasmview.cpp - Qt/Debugger/ctrldisasmview.h Qt/Debugger/ctrlmemview.cpp Qt/Debugger/ctrlmemview.h - Qt/Debugger/ctrlregisterlist.cpp - Qt/Debugger/ctrlregisterlist.h - Qt/Debugger/debugger_disasm.cpp - Qt/Debugger/debugger_disasm.h Qt/Debugger/debugger_displaylist.cpp Qt/Debugger/debugger_displaylist.h Qt/Debugger/debugger_memory.cpp diff --git a/Qt/Debugger/ctrldisasmview.cpp b/Qt/Debugger/ctrldisasmview.cpp deleted file mode 100644 index af496e30a8..0000000000 --- a/Qt/Debugger/ctrldisasmview.cpp +++ /dev/null @@ -1,422 +0,0 @@ -#include "ctrldisasmview.h" -#include -#include -#include -#include -#include -#include -#include -#include - -#include "math.h" - -#include "debugger_disasm.h" -#include "Core/Debugger/SymbolMap.h" - -namespace -{ - u32 halfAndHalf(u32 a, u32 b) - { - return ((a>>1)&0x7f7f7f7f) + ((b>>1)&0x7f7f7f7f); - } -} - -CtrlDisAsmView::CtrlDisAsmView(QWidget *parent) : - QWidget(parent) -{ - curAddress=0; - rowHeight=14; - align=2; - selecting=false; - showHex=false; -} - -void CtrlDisAsmView::keyPressEvent(QKeyEvent *e) -{ - int page=(rect().bottom()/rowHeight)/2-1; - - switch (e->key()) - { - case Qt::Key_Down: curAddress += align; break; - case Qt::Key_Up: curAddress -= align; break; - case Qt::Key_PageDown: curAddress += page*align; break; - case Qt::Key_PageUp: curAddress -= page*align; break; - default: QWidget::keyPressEvent(e); break; - } - - update(); -} - -void CtrlDisAsmView::mousePressEvent(QMouseEvent *e) -{ - int x = e->pos().x(); - int y = e->pos().y(); - if (x>16) - { - oldSelection=selection; - selection=yToAddress(y); - bool oldselecting=selecting; - selecting=true; - if (!oldselecting || (selection!=oldSelection)) - redraw(); - } - else - { - debugger->toggleBreakpoint(yToAddress(y)); - parentWindow->Update(); - redraw(); - } -} - -void CtrlDisAsmView::wheelEvent(QWheelEvent* e) -{ - int numDegrees = e->delta() / 8; - int numSteps = numDegrees / 15; - if (e->orientation() == Qt::Vertical) - { - curAddress -= numSteps*align; - update(); - } -} - -void CtrlDisAsmView::redraw() -{ - update(); -} - -void CtrlDisAsmView::contextMenu(const QPoint &pos) -{ - QMenu menu(this); - - QAction *copyAddress = new QAction(tr("Copy &address"), this); - connect(copyAddress, SIGNAL(triggered()), this, SLOT(CopyAddress())); - menu.addAction(copyAddress); - - QAction *copyInstrHex = new QAction(tr("Copy instruction (&hex)"), this); - connect(copyInstrHex, SIGNAL(triggered()), this, SLOT(CopyInstrHex())); - menu.addAction(copyInstrHex); - - QAction *copyInstrDisAsm = new QAction(tr("Copy instruction (&disasm)"), this); - connect(copyInstrDisAsm, SIGNAL(triggered()), this, SLOT(CopyInstrDisAsm())); - menu.addAction(copyInstrDisAsm); - - menu.addSeparator(); - - QAction *runToHere = new QAction(tr("&Run to here"), this); - connect(runToHere, SIGNAL(triggered()), this, SLOT(RunToHere())); - menu.addAction(runToHere); - - QAction *setNextStatement = new QAction(tr("&Set Next Statement"), this); - connect(setNextStatement, SIGNAL(triggered()), this, SLOT(SetNextStatement())); - menu.addAction(setNextStatement); - - QAction *toggleBreakpoint = new QAction(tr("&Toggle breakpoint"), this); - connect(toggleBreakpoint, SIGNAL(triggered()), this, SLOT(ToggleBreakpoint())); - menu.addAction(toggleBreakpoint); - - QAction *followBranch = new QAction(tr("&Follow branch"), this); - connect(followBranch, SIGNAL(triggered()), this, SLOT(FollowBranch())); - menu.addAction(followBranch); - - menu.addSeparator(); - - //QAction *showDynarecResults = new QAction(tr("&Show Dynarec Results"), this); - //connect(showDynarecResults, SIGNAL(triggered()), this, SLOT(ShowDynarecResults())); - //menu.addAction(showDynarecResults); - - QAction *goToMemoryView = new QAction(tr("Go to in &Memory View"), this); - connect(goToMemoryView, SIGNAL(triggered()), this, SLOT(GoToMemoryView())); - menu.addAction(goToMemoryView); - - menu.addSeparator(); - - //QAction *killFunction = new QAction(tr("&Kill function"), this); - //connect(killFunction, SIGNAL(triggered()), this, SLOT(KillFunction())); - //menu.addAction(killFunction); - - QAction *renameFunction = new QAction(tr("&Rename function..."), this); - connect(renameFunction, SIGNAL(triggered()), this, SLOT(RenameFunction())); - menu.addAction(renameFunction); - - - menu.exec( mapToGlobal(pos)); -} - -void CtrlDisAsmView::GoToMemoryView() -{ - parentWindow->ShowMemory(selection); -} - -void CtrlDisAsmView::CopyAddress() -{ - QApplication::clipboard()->setText(QString("%1").arg(selection,8,16,QChar('0'))); -} - -void CtrlDisAsmView::CopyInstrDisAsm() -{ - QApplication::clipboard()->setText(debugger->disasm(selection,align)); -} - -void CtrlDisAsmView::CopyInstrHex() -{ - QApplication::clipboard()->setText(QString("%1").arg(debugger->readMemory(selection),8,16,QChar('0'))); -} - -void CtrlDisAsmView::SetNextStatement() -{ - debugger->setPC(selection); - redraw(); -} - -void CtrlDisAsmView::ToggleBreakpoint() -{ - debugger->toggleBreakpoint(selection); - parentWindow->Update(); - redraw(); -} - -void CtrlDisAsmView::FollowBranch() -{ - const char *temp = debugger->disasm(selection,align);; - const char *mojs=strstr(temp,"->$"); - if (mojs) - { - u32 dest; - sscanf(mojs+3,"%08x",&dest); - if (dest) - { - marker = selection; - gotoAddr(dest); - } - } -} - -void CtrlDisAsmView::RunToHere() -{ - debugger->setBreakpoint(selection); - debugger->runToBreakpoint(); - redraw(); -} - -void CtrlDisAsmView::RenameFunction() -{ - u32 funcBegin = g_symbolMap->GetFunctionStart(curAddress); - if (funcBegin != (u32)-1) - { - QString name = QString::fromStdString(g_symbolMap->GetLabelString(funcBegin)); - bool ok; - QString newname = QInputDialog::getText(this, tr("New function name"), - tr("New function name:"), QLineEdit::Normal, - name, &ok); - if (ok && !newname.isEmpty()) - { - g_symbolMap->SetLabelName(newname.toStdString().c_str(),funcBegin); - redraw(); - parentWindow->NotifyMapLoaded(); - } - } - else - { - QMessageBox::information(this,tr("Warning"),tr("No symbol selected"),QMessageBox::Ok); - } -} - -void CtrlDisAsmView::paintEvent(QPaintEvent *) -{ - QPainter painter(this); - painter.setBrush(Qt::white); - painter.setPen(Qt::white); - painter.drawRect(rect()); - - struct branch - { - int src,dst,srcAddr; - bool conditional; - }; - branch branches[256]; - int numBranches=0; - - int width = rect().width(); - int numRows=(rect().height()/rowHeight); - - QColor bgColor(0xFFFFFFFF); - QPen nullPen(bgColor); - QPen currentPen(QColor(0,0,0)); - QPen selPen(QColor(0xFF808080)); - QPen condPen(QColor(0xFFFF3020)); - - QBrush lbr; - lbr.setColor(bgColor); - QBrush currentBrush(QColor(0xFFFFEfE8)); - QBrush pcBrush(QColor(0xFF70FF70)); - - QFont normalFont("Arial", 10); - QFont boldFont("Arial", 10); - QFont alignedFont("Monospace", 10); - alignedFont.setStyleHint(QFont::Monospace); - boldFont.setBold(true); - painter.setFont(normalFont); - - - QImage breakPoint(":/resources/breakpoint.ico"); - int i; - curAddress&=~(align-1); - - align=(debugger->getInstructionSize(0)); - for (i=0; i<=numRows; i++) - { - unsigned int address=curAddress + (i-(numRows/2))*align; - - int rowY1 = rect().top() + rowHeight*i; - int rowY2 = rect().top() + rowHeight*i + rowHeight - 1; - - lbr.setColor((unsigned int)marker == address ? QColor(0xFFFFEEE0) : QColor(debugger->getColor(address))); - QColor bg = lbr.color(); - painter.setBrush(currentBrush); - painter.setPen(nullPen); - painter.drawRect(0,rowY1,16-1,rowY2-rowY1); - - if (selecting && address == (unsigned int)selection) - painter.setPen(selPen); - else - { - if(i==numRows/2) - painter.setPen(currentPen); - else - painter.setPen(bg); - } - painter.setBrush(QBrush(bg)); - - if (address == debugger->getPC()) - { - painter.setBrush(pcBrush); - } - - painter.drawRect(16,rowY1,width-16-1,rowY2-rowY1); - painter.setBrush(currentBrush); - QPen textPen(QColor(halfAndHalf(bg.rgba(),0))); - painter.setPen(textPen); - painter.setFont(alignedFont); - painter.drawText(17,rowY1-3+rowHeight,QString("%1").arg(address,8,16,QChar('0'))); - painter.setFont(normalFont); - textPen.setColor(QColor(0xFF000000)); - painter.setPen(textPen); - if (debugger->isAlive()) - { - const char *dizz = debugger->disasm(address, align); - char dis[512]; - strcpy(dis, dizz); - char *dis2 = strchr(dis,'\t'); - char desc[256]=""; - if (dis2) - { - *dis2=0; - dis2++; - const char *mojs=strstr(dis2,"->$"); - if (mojs) - { - for (int i=0; i<8; i++) - { - bool found=false; - for (int j=0; j<22; j++) - { - if (mojs[i+3]=="0123456789ABCDEFabcdef"[j]) - found=true; - } - if (!found) - { - mojs=0; - break; - } - } - } - if (mojs) - { - unsigned int offs; - sscanf(mojs+3,"%08x",&offs); - branches[numBranches].src=rowY1 + rowHeight/2; - branches[numBranches].srcAddr=address/align; - branches[numBranches].dst=(int)(rowY1+((s64)offs-(s64)address)*rowHeight/align + rowHeight/2); - branches[numBranches].conditional = (dis[1]!=0); //unconditional 'b' branch - numBranches++; - const char *t = debugger->getDescription(offs).c_str(); - if (memcmp(t,"z_",2)==0) - t+=2; - if (memcmp(t,"zz_",3)==0) - t+=3; - sprintf(desc,"-->%s", t); - textPen.setColor(QColor(0xFF600060)); - painter.setPen(textPen); - } - else - { - textPen.setColor(QColor(0xFF000000)); - painter.setPen(textPen); - } - painter.drawText(149,rowY1-3+rowHeight,QString(dis2)); - } - textPen.setColor(QColor(0xFF007000)); - painter.setPen(textPen); - painter.setFont(boldFont); - painter.drawText(84,rowY1-3+rowHeight,QString(dis)); - painter.setFont(normalFont); - if (desc[0]==0) - { - const char *t = debugger->getDescription(address).c_str(); - if (memcmp(t,"z_",2)==0) - t+=2; - if (memcmp(t,"zz_",3)==0) - t+=3; - strcpy(desc,t); - } - if (memcmp(desc,"-->",3) == 0) - { - textPen.setColor(QColor(0xFF0000FF)); - painter.setPen(textPen); - } - else - { - textPen.setColor(halfAndHalf(halfAndHalf(bg.rgba(),0),bg.rgba())); - painter.setPen(textPen); - } - if (strlen(desc)) - painter.drawText(std::max(280,width/3+190),rowY1-3+rowHeight,QString(desc)); - if (debugger->isBreakpoint(address)) - { - painter.drawImage(2,rowY1+2,breakPoint); - } - } - } - for (i=0; i-200) - { - painter.drawLine(curPos, QPoint(x+2,branches[i].src)); - curPos = QPoint(x+2,branches[i].src); - painter.drawLine(curPos, QPoint(x+2,branches[i].dst)); - curPos = QPoint(x+2,branches[i].dst); - painter.drawLine(curPos, QPoint(x-4,branches[i].dst)); - - curPos = QPoint(x,branches[i].dst-4); - painter.drawLine(curPos, QPoint(x-4,branches[i].dst)); - curPos = QPoint(x-4,branches[i].dst); - painter.drawLine(curPos, QPoint(x+1,branches[i].dst+5)); - } - else - { - painter.drawLine(curPos, QPoint(x+4,branches[i].src)); - } - } -} - -int CtrlDisAsmView::yToAddress(int y) -{ - //int ydiff=y - rect().bottom()/2;//-rowHeight/2; - int ydiff=(int)(floor((float)y / (float)rowHeight)); - ydiff -= (rect().height()/rowHeight)/2; - return curAddress + ydiff *align; -} diff --git a/Qt/Debugger/ctrldisasmview.h b/Qt/Debugger/ctrldisasmview.h deleted file mode 100644 index 8846ad40db..0000000000 --- a/Qt/Debugger/ctrldisasmview.h +++ /dev/null @@ -1,100 +0,0 @@ -#ifndef CTRLDISASMVIEW_H -#define CTRLDISASMVIEW_H - -#include -#include "Core/Debugger/DebugInterface.h" - -class Debugger_Disasm; - -class CtrlDisAsmView : public QWidget -{ - Q_OBJECT -public: - explicit CtrlDisAsmView(QWidget *parent = 0); - - void redraw(); - void setAlign(int l) - { - align=l; - } - - void setParentWindow(Debugger_Disasm* win) - { - parentWindow = win; - } - - void setDebugger(DebugInterface *deb) - { - debugger=deb; - curAddress=debugger->getPC(); - align=debugger->getInstructionSize(0); - } - DebugInterface *getDebugger() - { - return debugger; - } - void gotoAddr(unsigned int addr) - { - curAddress=addr&(~(align-1)); - redraw(); - } - void gotoPC() - { - curAddress=debugger->getPC()&(~(align-1)); - redraw(); - } - unsigned int getSelection() - { - return curAddress; - } - - void setShowMode(bool s) - { - showHex=s; - } - - void toggleBreakpoint() - { - debugger->toggleBreakpoint(curAddress); - redraw(); - } - - void contextMenu(const QPoint& pos); -protected: - void paintEvent(QPaintEvent *); - void mousePressEvent(QMouseEvent *e); - void keyPressEvent(QKeyEvent *); - void wheelEvent(QWheelEvent *e); - -public slots: - void CopyAddress(); - void CopyInstrDisAsm(); - void SetNextStatement(); - void FollowBranch(); - void CopyInstrHex(); - void RunToHere(); - void ToggleBreakpoint(); - void GoToMemoryView(); - void RenameFunction(); - -private: - int yToAddress(int y); - - int curAddress; - int align; - - int rowHeight; - int selection; - int marker; - int oldSelection; - bool selectionChanged; - bool selecting; - bool hasFocus; - bool showHex; - - DebugInterface *debugger; - Debugger_Disasm* parentWindow; - -}; - -#endif // CTRLDISASMVIEW_H diff --git a/Qt/Debugger/ctrlregisterlist.cpp b/Qt/Debugger/ctrlregisterlist.cpp deleted file mode 100644 index 29184ee1ab..0000000000 --- a/Qt/Debugger/ctrlregisterlist.cpp +++ /dev/null @@ -1,335 +0,0 @@ -#include "ctrlregisterlist.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include "debugger_disasm.h" - -CtrlRegisterList::CtrlRegisterList(QWidget *parent) : - QWidget(parent) -{ - rowHeight = 14; - selecting=false; - selection=0; - category=0; - showHex=false; - cpu=0; - lastPC = 0; - lastCat0Values = NULL; - changedCat0Regs = NULL; - curVertOffset = 0; - -} - -CtrlRegisterList::~CtrlRegisterList() -{ - if (lastCat0Values != NULL) - delete [] lastCat0Values; - if (changedCat0Regs != NULL) - delete [] changedCat0Regs; -} - -void CtrlRegisterList::redraw() -{ - update(); -} - -void CtrlRegisterList::scrollChanged(int action) -{ - QScrollBar *bar = findChild("RegListScroll"); - switch(action) - { - case QScrollBar::SliderSingleStepAdd: - curVertOffset++; - break; - case QScrollBar::SliderSingleStepSub: - curVertOffset--; - break; - case QScrollBar::SliderPageStepAdd: - curVertOffset+= 4; - break; - case QScrollBar::SliderPageStepSub: - curVertOffset-= 4; - break; - case QScrollBar::SliderMove: - curVertOffset = bar->sliderPosition(); - break; - default: - break; - } - redraw(); -} - - -void CtrlRegisterList::keyPressEvent(QKeyEvent *e) -{ - switch (e->key()) - { - case Qt::Key_Down: selection += 1; break; - case Qt::Key_Up: selection -= 1; break; - case Qt::Key_PageDown: selection += 4; break; - case Qt::Key_PageUp: selection -= 4; break; - default: QWidget::keyPressEvent(e); break; - } - - int maxRowsDisplay =rect().bottom()/rowHeight - 1; - curVertOffset = std::min(std::max(curVertOffset, selection-maxRowsDisplay),selection); - update(); -} - -void CtrlRegisterList::mousePressEvent(QMouseEvent *e) -{ - int x = e->pos().x(); - int y = e->pos().y(); - if (x>16) - { - oldSelection=selection; - - if (y>rowHeight) - { - selection=yToIndex(y); - bool oldselecting=selecting; - selecting=true; - if (!oldselecting || (selection!=oldSelection)) - redraw(); - } - else - { - int lastCat = category; - category = (x*cpu->GetNumCategories())/(rect().width()); - if (category<0) category=0; - if (category>=cpu->GetNumCategories()) - category=cpu->GetNumCategories()-1; - if (category!=lastCat) - { - curVertOffset = 0; - redraw(); - } - } - } - else - { - redraw(); - } -} - -void CtrlRegisterList::wheelEvent(QWheelEvent* e) -{ - int numDegrees = e->delta() / 8; - int numSteps = numDegrees / 15; - if (e->orientation() == Qt::Vertical) - { - curVertOffset -= numSteps; - update(); - } -} - - -void CtrlRegisterList::paintEvent(QPaintEvent *) -{ - - int numRowsTotal = cpu->GetNumRegsInCategory(category); - int maxRowsDisplay =rect().bottom()/rowHeight - 1; - - selection = std::min(std::max(selection,0),numRowsTotal); - curVertOffset = std::max(std::min(curVertOffset,numRowsTotal - maxRowsDisplay),0); - - QScrollBar *bar = findChild("RegListScroll"); - if(bar) - { - bar->setMinimum(0); - bar->setMaximum(numRowsTotal - maxRowsDisplay); - bar->setPageStep(1); - bar->setValue(curVertOffset); - } - - - QPainter painter(this); - painter.setBrush(Qt::white); - painter.setPen(Qt::white); - painter.drawRect(rect()); - - if (!cpu) - return; - - QFont normalFont = QFont("Arial", 10); - painter.setFont(normalFont); - - int width = rect().width(); - - QColor bgColor(0xffffff); - QPen nullPen(bgColor); - QPen currentPen(QColor(0xFF000000)); - QPen selPen(0x808080); - QPen textPen; - - QBrush lbr; - lbr.setColor(bgColor); - QBrush nullBrush(bgColor); - QBrush currentBrush(0xFFEfE8); - QBrush pcBrush(0x70FF70); - - int nc = cpu->GetNumCategories(); - for (int i=0; iGetCategoryName(i); - painter.setPen(currentPen); - painter.drawText(width*i/nc+1,-3+rowHeight,name); - } - - int numRows=rect().bottom()/rowHeight; - - for (int i=curVertOffset; iGetPC()) - { - for (int i = 0, n = cpu->GetNumRegsInCategory(0); i < n; ++i) - { - u32 v = cpu->GetRegValue(0, i); - changedCat0Regs[i] = v != lastCat0Values[i]; - lastCat0Values[i] = v; - } - lastPC = cpu->GetPC(); - } - - painter.setBrush(currentBrush); - if (iGetNumRegsInCategory(category)) - { - QString regName = cpu->GetRegName(category,i); - textPen.setColor(0x600000); - painter.setPen(textPen); - painter.drawText(17,rowY1-3+rowHeight,regName); - textPen.setColor(0xFF000000); - painter.setPen(textPen); - - char temp[256]; - cpu->PrintRegValue(category,i,temp); - if (category == 0 && changedCat0Regs[i]) - { - textPen.setColor(0x0000FF); - painter.setPen(textPen); - } - else - { - textPen.setColor(0x004000); - painter.setPen(textPen); - } - painter.drawText(77,rowY1-3+rowHeight,temp); - } - } -} - -int CtrlRegisterList::yToIndex(int y) -{ - int n = (y/rowHeight) - 1 + curVertOffset; - if (n<0) n=0; - return n; -} - -void CtrlRegisterList::contextMenu(const QPoint &pos) -{ - QMenu menu(this); - - QAction *gotoMemory = new QAction(tr("Go to in &memory view"), this); - connect(gotoMemory, SIGNAL(triggered()), this, SLOT(GotoMemory())); - menu.addAction(gotoMemory); - - QAction *gotoDisAsm = new QAction(tr("Go to in &disasm"), this); - connect(gotoDisAsm, SIGNAL(triggered()), this, SLOT(GotoDisAsm())); - menu.addAction(gotoDisAsm); - - menu.addSeparator(); - - QAction *copyValue = new QAction(tr("&Copy value"), this); - connect(copyValue, SIGNAL(triggered()), this, SLOT(CopyValue())); - menu.addAction(copyValue); - - QAction *change = new QAction(tr("C&hange..."), this); - connect(change, SIGNAL(triggered()), this, SLOT(Change())); - menu.addAction(change); - - menu.exec( mapToGlobal(pos)); -} - -void CtrlRegisterList::GotoMemory() -{ - int cat = category; - int reg = selection; - if (selection >= cpu->GetNumRegsInCategory(cat)) - return; - - u32 val = cpu->GetRegValue(cat,reg); - - parentWindow->ShowMemory(val); -} - -void CtrlRegisterList::GotoDisAsm() -{ - int cat = category; - int reg = selection; - if (selection >= cpu->GetNumRegsInCategory(cat)) - return; - - u32 val = cpu->GetRegValue(cat,reg); - - emit GotoDisasm(val); -} - -void CtrlRegisterList::CopyValue() -{ - int cat = category; - int reg = selection; - if (selection >= cpu->GetNumRegsInCategory(cat)) - return; - - u32 val = cpu->GetRegValue(cat,reg); - - QApplication::clipboard()->setText(QString("%1").arg(val,8,16,QChar('0'))); -} - -void CtrlRegisterList::Change() -{ - int cat = category; - int reg = selection; - if (selection >= cpu->GetNumRegsInCategory(cat)) - return; - - u32 val = cpu->GetRegValue(cat,reg); - - bool ok; - QString text = QInputDialog::getText(this, tr("Set new value"), - tr("Set new value:"), QLineEdit::Normal, - QString::number(val), &ok); - if (ok && !text.isEmpty()) - { - cpu->SetRegValue(cat,reg,text.toInt()); - redraw(); - } -} diff --git a/Qt/Debugger/ctrlregisterlist.h b/Qt/Debugger/ctrlregisterlist.h deleted file mode 100644 index ca3c498d9a..0000000000 --- a/Qt/Debugger/ctrlregisterlist.h +++ /dev/null @@ -1,77 +0,0 @@ -#ifndef CTRLREGISTERLIST_H -#define CTRLREGISTERLIST_H - -#include -#include "Core/Debugger/DebugInterface.h" - -class Debugger_Disasm; -class CtrlRegisterList : public QWidget -{ - Q_OBJECT -public: - explicit CtrlRegisterList(QWidget *parent = 0); - - - void setParentWindow(Debugger_Disasm* win) - { - parentWindow = win; - } - - void setCPU(DebugInterface *deb) - { - cpu = deb; - - int regs = cpu->GetNumRegsInCategory(0); - lastCat0Values = new u32[regs]; - changedCat0Regs = new bool[regs]; - memset(lastCat0Values, 0, regs * sizeof(u32)); - memset(changedCat0Regs, 0, regs * sizeof(bool)); - } - DebugInterface *getCPU() - { - return cpu; - } - ~CtrlRegisterList(); - void contextMenu(const QPoint &pos); -protected: - void paintEvent(QPaintEvent *); - void keyPressEvent(QKeyEvent *e); - void mousePressEvent(QMouseEvent *e); - void wheelEvent(QWheelEvent *e); -signals: - void GotoDisasm(u32); - -public slots: - void redraw(); - void scrollChanged(int); - - void GotoDisAsm(); - void CopyValue(); - void Change(); - void GotoMemory(); - -private: - int yToIndex(int y); - - int rowHeight; - int selection; - int marker; - int category; - - int oldSelection; - - bool selectionChanged; - bool selecting; - bool hasFocus; - bool showHex; - DebugInterface *cpu; - int curVertOffset; - - u32 lastPC; - u32 *lastCat0Values; - bool *changedCat0Regs; - - Debugger_Disasm* parentWindow; -}; - -#endif // CTRLREGISTERLIST_H diff --git a/Qt/Debugger/debugger_disasm.cpp b/Qt/Debugger/debugger_disasm.cpp deleted file mode 100644 index dfdf2c5699..0000000000 --- a/Qt/Debugger/debugger_disasm.cpp +++ /dev/null @@ -1,594 +0,0 @@ -#include -#include - -#include - -#include "debugger_disasm.h" -#include "ui_debugger_disasm.h" -#include "Core/Debugger/DebugInterface.h" -#include "Core/Debugger/SymbolMap.h" -#include "ctrldisasmview.h" -#include "Core/Debugger/Breakpoints.h" -#include "Core/HLE/HLE.h" -#include "Core/CoreTiming.h" -#include "mainwindow.h" -#include "ctrlregisterlist.h" -#include "base/stringutil.h" -#include "Core/Debugger/SymbolMap.h" -#include "GPU/GPUState.h" -#include "GPU/GPUInterface.h" -#include "GPU/GeDisasm.h" -#include "GPU/Common/GPUDebugInterface.h" -#include "Core/Host.h" - -Debugger_Disasm::Debugger_Disasm(DebugInterface *_cpu, MainWindow* mainWindow_, QWidget *parent) : - QDialog(parent), - ui(new Ui::Debugger_Disasm), - cpu(_cpu), - mainWindow(mainWindow_) -{ - ui->setupUi(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(UpdateCallstack_()), this, SLOT(UpdateCallstackGUI())); - 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(); - -} - -Debugger_Disasm::~Debugger_Disasm() -{ - delete ui; -} - -void Debugger_Disasm::Update() -{ - ui->RegList->redraw(); - mainWindow->updateMenus(); - UpdateDialog(); -} - -void Debugger_Disasm::Go() -{ - SetDebugMode(false); - Core_EnableStepping(false); - mainWindow->updateMenus(); -} - -void Debugger_Disasm::Step() -{ - Core_DoSingleStep(); - _dbg_update_(); -} - -void Debugger_Disasm::StepOver() -{ - SetDebugMode(false); - CBreakPoints::AddBreakPoint(cpu->GetPC()+cpu->getInstructionSize(0),true); - _dbg_update_(); - Core_EnableStepping(false); - mainWindow->updateMenus(); -} - -void Debugger_Disasm::StepHLE() -{ - hleDebugBreak(); - SetDebugMode(false); - _dbg_update_(); - Core_EnableStepping(false); - mainWindow->updateMenus(); -} - -void Debugger_Disasm::UpdateDialog() -{ - if(!isVisible()) - return; - ui->DisasmView->setAlign(cpu->getInstructionSize(0)); - ui->DisasmView->redraw(); - ui->RegList->redraw(); - UpdateBreakpoints(); - UpdateThread(); - UpdateDisplayList(); - UpdateCallstack(); - - char tempTicks[24]; - sprintf(tempTicks, "%lld", CoreTiming::GetTicks()); - ui->debugCount->setText(QString("Ctr : ") + tempTicks); - - if(mainWindow->GetDialogMemory()) - mainWindow->GetDialogMemory()->Update(); - -} - -void Debugger_Disasm::Stop() -{ - SetDebugMode(true); - Core_EnableStepping(true); - _dbg_update_(); - mainWindow->updateMenus(); - UpdateDialog(); -} - -void Debugger_Disasm::Skip() -{ - CtrlDisAsmView *ptr = ui->DisasmView; - - cpu->SetPC(cpu->GetPC() + cpu->getInstructionSize(0)); - ptr->gotoPC(); - UpdateDialog(); -} - -void Debugger_Disasm::GotoPC() -{ - CtrlDisAsmView *ptr = ui->DisasmView; - - ptr->gotoPC(); - UpdateDialog(); -} - -void Debugger_Disasm::GotoLR() -{ - CtrlDisAsmView *ptr = ui->DisasmView; - - ptr->gotoAddr(cpu->GetLR()); -} - -void Debugger_Disasm::SetDebugMode(bool _bDebug) -{ - if (_bDebug) - { - ui->Go->setEnabled(true); - ui->StepInto->setEnabled(true); - ui->StepOver->setEnabled(false); // Crash, so disable for now - ui->NextHLE->setEnabled(true); - ui->Stop->setEnabled(false); - ui->Skip->setEnabled(true); - CtrlDisAsmView *ptr = ui->DisasmView; - ptr->gotoPC(); - UpdateDialog(); - } - else - { - ui->Go->setEnabled(false); - ui->StepInto->setEnabled(false); - ui->StepOver->setEnabled(false); - ui->NextHLE->setEnabled(false); - ui->Stop->setEnabled(true); - ui->Skip->setEnabled(false); - CtrlRegisterList *reglist = ui->RegList; - reglist->redraw(); - } -} - -void Debugger_Disasm::Goto(u32 addr) -{ - CtrlDisAsmView *ptr = ui->DisasmView; - ptr->gotoAddr(addr); - ptr->redraw(); -} - -void Debugger_Disasm::on_GotoPc_clicked() -{ - GotoPC(); -} - -void Debugger_Disasm::on_Go_clicked() -{ - Go(); -} - -void Debugger_Disasm::on_Stop_clicked() -{ - Stop(); -} - -void Debugger_Disasm::on_StepInto_clicked() -{ - Step(); -} - -void Debugger_Disasm::on_StepOver_clicked() -{ - StepOver(); -} - -void Debugger_Disasm::on_Skip_clicked() -{ - Skip(); -} - -void Debugger_Disasm::on_NextHLE_clicked() -{ - StepHLE(); -} - -void Debugger_Disasm::on_GotoLr_clicked() -{ - GotoLR(); -} - -void Debugger_Disasm::on_GotoInt_currentIndexChanged(int index) -{ - CtrlDisAsmView *ptr = ui->DisasmView; - u32 addr = ui->GotoInt->itemData(index,Qt::UserRole).toInt(); - if (addr != 0xFFFFFFFF) - ptr->gotoAddr(addr); -} - -void Debugger_Disasm::on_Address_textChanged(const QString &arg1) -{ - CtrlDisAsmView *ptr = ui->DisasmView; - ptr->gotoAddr(parseHex(ui->Address->text().toStdString().c_str())); - UpdateDialog(); -} - -void Debugger_Disasm::on_DisasmView_customContextMenuRequested(const QPoint &pos) -{ - ui->DisasmView->contextMenu(pos); -} - -void Debugger_Disasm::NotifyMapLoaded() -{ - FillFunctions(); - CtrlDisAsmView *ptr = ui->DisasmView; - ptr->redraw(); -} - -void Debugger_Disasm::on_RegList_customContextMenuRequested(const QPoint &pos) -{ - ui->RegList->contextMenu(pos); -} - -void Debugger_Disasm::ShowMemory(u32 addr) -{ - mainWindow->ShowMemory(addr); -} - -void Debugger_Disasm::on_FuncList_itemClicked(QListWidgetItem *item) -{ - u32 addr = item->data(Qt::UserRole).toInt(); - - ui->DisasmView->gotoAddr(addr); -} - -void Debugger_Disasm::FillFunctions() -{ - QListWidgetItem* item = new QListWidgetItem(); - item->setText("(0x02000000)"); - item->setData(Qt::UserRole, 0x02000000); - ui->FuncList->addItem(item); - - std::vector symbols = g_symbolMap->GetAllSymbols(ST_FUNCTION); - for(int i = 0; i < (int)symbols.size(); i++) - { - QListWidgetItem* item = new QListWidgetItem(); - item->setText(QString("%1 (%2)").arg(QString::fromStdString(symbols[i].name)).arg(symbols[i].size)); - item->setData(Qt::UserRole, symbols[i].address); - ui->FuncList->addItem(item); - } -} - -void Debugger_Disasm::UpdateCallstack() -{ - emit UpdateCallstack_(); -} - -void Debugger_Disasm::UpdateCallstackGUI() -{ - - auto threads = GetThreadsInfo(); - - u32 entry = 0, stackTop = 0; - for (size_t i = 0; i < threads.size(); i++) - { - if (threads[i].isCurrent) - { - entry = threads[i].entrypoint; - stackTop = threads[i].initialStack; - break; - } - } - if (entry != 0) { - stackTraceModel = MIPSStackWalk::Walk( - cpu->GetPC(), - cpu->GetRegValue(0,MIPS_REG_RA), - cpu->GetRegValue(0,MIPS_REG_SP), - entry, - stackTop); - } else { - stackTraceModel.clear(); - } - - ui->callStack->clear(); - - QTreeWidgetItem* item; - for(auto it=stackTraceModel.begin();it!=stackTraceModel.end();it++) - { - item = new QTreeWidgetItem(); - item->setText(0,QString("%1").arg(it->pc,8,16,QChar('0')).prepend("0x")); - item->setData(0,Qt::UserRole,it->pc); - item->setText(1,QString("%1").arg(it->entry,8,16,QChar('0')).prepend("0x")); - item->setData(1,Qt::UserRole,it->entry); - item->setText(2,QString("%1").arg(it->sp,8,16,QChar('0')).prepend("0x")); - item->setText(3,QString("%1").arg(it->stackSize,8,16,QChar('0')).prepend("0x")); - ui->callStack->addTopLevelItem(item); - } -} - -void Debugger_Disasm::UpdateBreakpoints() -{ - emit UpdateBreakpoints_(); -} - -void Debugger_Disasm::UpdateBreakpointsGUI() -{ - u32 curBpAddr = 0; - QTreeWidgetItem* curItem = ui->breakpointsList->currentItem(); - if(curItem) - curBpAddr = ui->breakpointsList->currentItem()->data(0,Qt::UserRole).toInt(); - - ui->breakpointsList->clear(); - - auto breakpoints = CBreakPoints::GetBreakpoints(); - for(size_t i = 0; i < breakpoints.size(); i++) - { - u32 addr_ = breakpoints[i].addr; - if(!CBreakPoints::IsTempBreakPoint(addr_)) - { - QTreeWidgetItem* item = new QTreeWidgetItem(); - item->setText(0,QString("%1").arg(addr_,8,16,QChar('0'))); - item->setData(0,Qt::UserRole,addr_); - ui->breakpointsList->addTopLevelItem(item); - if(curBpAddr == addr_) - ui->breakpointsList->setCurrentItem(item); - } - } -} - -void Debugger_Disasm::on_breakpointsList_itemClicked(QTreeWidgetItem *item, int column) -{ - ui->DisasmView->gotoAddr(item->data(column,Qt::UserRole).toInt()); -} - -void Debugger_Disasm::on_breakpointsList_customContextMenuRequested(const QPoint &pos) -{ - QTreeWidgetItem* item = ui->breakpointsList->itemAt(pos); - if(item) - { - breakpointAddr = item->data(0,Qt::UserRole).toInt(); - - QMenu menu(this); - - QAction *removeBP = new QAction(tr("Remove breakpoint"), this); - connect(removeBP, SIGNAL(triggered()), this, SLOT(RemoveBreakpoint())); - menu.addAction(removeBP); - - menu.exec( ui->breakpointsList->mapToGlobal(pos)); - } -} - -void Debugger_Disasm::RemoveBreakpoint() -{ - CBreakPoints::RemoveBreakPoint(breakpointAddr); - Update(); -} - -void Debugger_Disasm::on_clearAllBP_clicked() -{ - CBreakPoints::ClearAllBreakPoints(); - Update(); -} - -void Debugger_Disasm::UpdateThread() -{ - emit UpdateThread_(); -} - -void Debugger_Disasm::UpdateThreadGUI() -{ - ui->threadList->clear(); - - std::vector threads = GetThreadsInfo(); - - for(size_t i = 0; i < threads.size(); i++) - { - QTreeWidgetItem* item = new QTreeWidgetItem(); - item->setText(0,QString::number(threads[i].id)); - item->setData(0,Qt::UserRole,threads[i].id); - item->setText(1,threads[i].name); - QString status = ""; - if(threads[i].status & THREADSTATUS_RUNNING) status += "Running "; - if(threads[i].status & THREADSTATUS_WAIT) status += "Wait "; - if(threads[i].status & THREADSTATUS_READY) status += "Ready "; - if(threads[i].status & THREADSTATUS_SUSPEND) status += "Suspend "; - if(threads[i].status & THREADSTATUS_DORMANT) status += "Dormant "; - if(threads[i].status & THREADSTATUS_DEAD) status += "Dead "; - item->setText(2,status); - item->setText(3,QString("%1").arg(threads[i].curPC,8,16,QChar('0'))); - item->setData(3,Qt::UserRole,threads[i].curPC); - item->setText(4,QString("%1").arg(threads[i].entrypoint,8,16,QChar('0'))); - item->setData(4,Qt::UserRole,threads[i].entrypoint); - - if(threads[i].isCurrent) - { - for(int j = 0; j < 5; j++) - item->setTextColor(j,Qt::green); - } - - ui->threadList->addTopLevelItem(item); - } - for(int i = 0; i < ui->threadList->columnCount(); i++) - ui->threadList->resizeColumnToContents(i); -} - -void Debugger_Disasm::on_threadList_itemClicked(QTreeWidgetItem *item, int column) -{ - ui->DisasmView->gotoAddr(item->data(3,Qt::UserRole).toInt()); -} - -void Debugger_Disasm::on_threadList_customContextMenuRequested(const QPoint &pos) -{ - QTreeWidgetItem* item = ui->threadList->itemAt(pos); - if(item) - { - threadRowSelected = item; - - QMenu menu(this); - - QAction *gotoEntryPoint = new QAction(tr("Go to entry point"), this); - connect(gotoEntryPoint, SIGNAL(triggered()), this, SLOT(GotoThreadEntryPoint())); - menu.addAction(gotoEntryPoint); - - QMenu* changeStatus = menu.addMenu(tr("Change status")); - - QAction *statusRunning = new QAction(tr("Running"), this); - connect(statusRunning, SIGNAL(triggered()), this, SLOT(SetThreadStatusRun())); - changeStatus->addAction(statusRunning); - - QAction *statusWait = new QAction(tr("Wait"), this); - connect(statusWait, SIGNAL(triggered()), this, SLOT(SetThreadStatusWait())); - changeStatus->addAction(statusWait); - - QAction *statusSuspend = new QAction(tr("Suspend"), this); - connect(statusSuspend, SIGNAL(triggered()), this, SLOT(SetThreadStatusSuspend())); - changeStatus->addAction(statusSuspend); - - menu.exec( ui->threadList->mapToGlobal(pos)); - } -} - -void Debugger_Disasm::GotoThreadEntryPoint() -{ - ui->DisasmView->gotoAddr(threadRowSelected->data(4,Qt::UserRole).toInt()); - Update(); -} - -void Debugger_Disasm::SetThreadStatus(ThreadStatus status) -{ - __KernelChangeThreadState(threadRowSelected->data(0,Qt::UserRole).toInt(), status); - - UpdateThread(); -} - -void Debugger_Disasm::SetThreadStatusRun() -{ - SetThreadStatus(THREADSTATUS_RUNNING); -} - -void Debugger_Disasm::SetThreadStatusWait() -{ - SetThreadStatus(THREADSTATUS_WAIT); -} - -void Debugger_Disasm::SetThreadStatusSuspend() -{ - SetThreadStatus(THREADSTATUS_SUSPEND); -} - -void Debugger_Disasm::UpdateDisplayList() -{ - emit UpdateDisplayList_(); -} - -void Debugger_Disasm::UpdateDisplayListGUI() -{ - u32 curDlId = 0; - QTreeWidgetItem* curItem = ui->displayList->currentItem(); - if(curItem) - curDlId = ui->displayList->currentItem()->data(0,Qt::UserRole).toInt(); - - ui->displayList->clear(); - - const std::list& dlQueue = gpu->GetDisplayLists(); - - DisplayList dlist; - DisplayList* dl = &dlist; - if(gpuDebug->GetCurrentDisplayList(dlist)) - { - QTreeWidgetItem* item = new QTreeWidgetItem(); - item->setText(0,QString::number(dl->id)); - item->setData(0, Qt::UserRole, dl->id); - switch(dl->state) - { - case PSP_GE_DL_STATE_NONE: item->setText(1,"None"); break; - case PSP_GE_DL_STATE_QUEUED: item->setText(1,"Queued"); break; - case PSP_GE_DL_STATE_RUNNING: item->setText(1,"Running"); break; - case PSP_GE_DL_STATE_COMPLETED: item->setText(1,"Completed"); break; - case PSP_GE_DL_STATE_PAUSED: item->setText(1,"Paused"); break; - default: break; - } - item->setText(2,QString("%1").arg(dl->startpc,8,16,QChar('0'))); - item->setData(2, Qt::UserRole, dl->startpc); - item->setText(3,QString("%1").arg(dl->pc,8,16,QChar('0'))); - item->setData(3, Qt::UserRole, dl->pc); - ui->displayList->addTopLevelItem(item); - if(curDlId == (u32)dl->id) - { - ui->displayList->setCurrentItem(item); - displayListRowSelected = item; - } - } - - for(auto listIdIt = dlQueue.begin(); listIdIt != dlQueue.end(); ++listIdIt) - { - DisplayList *it = gpu->getList(*listIdIt); - if(dl && it->id == dl->id) - continue; - QTreeWidgetItem* item = new QTreeWidgetItem(); - item->setText(0,QString::number(it->id)); - item->setData(0, Qt::UserRole, it->id); - switch(it->state) - { - case PSP_GE_DL_STATE_NONE: item->setText(1,"None"); break; - case PSP_GE_DL_STATE_QUEUED: item->setText(1,"Queued"); break; - case PSP_GE_DL_STATE_RUNNING: item->setText(1,"Running"); break; - case PSP_GE_DL_STATE_COMPLETED: item->setText(1,"Completed"); break; - case PSP_GE_DL_STATE_PAUSED: item->setText(1,"Paused"); break; - default: break; - } - item->setText(2,QString("%1").arg(it->startpc,8,16,QChar('0'))); - item->setData(2, Qt::UserRole, it->startpc); - item->setText(3,QString("%1").arg(it->pc,8,16,QChar('0'))); - item->setData(3, Qt::UserRole, it->pc); - ui->displayList->addTopLevelItem(item); - if(curDlId == (u32)it->id) - { - ui->displayList->setCurrentItem(item); - displayListRowSelected = item; - } - } - for(int i = 0; i < ui->displayList->columnCount(); i++) - ui->displayList->resizeColumnToContents(i); -} - -void Debugger_Disasm::on_displayList_customContextMenuRequested(const QPoint &pos) -{ - QTreeWidgetItem* item = ui->displayList->itemAt(pos); - if(item) - { - displayListRowSelected = item; - - /*QMenu menu(this); - - QAction *showCode = new QAction(tr("Show code"), this); - connect(showCode, SIGNAL(triggered()), this, SLOT(ShowDLCode())); - menu.addAction(showCode);*/ - - //menu.exec( ui->displayList->mapToGlobal(pos)); - } -} diff --git a/Qt/Debugger/debugger_disasm.h b/Qt/Debugger/debugger_disasm.h deleted file mode 100644 index d2fa1d0a54..0000000000 --- a/Qt/Debugger/debugger_disasm.h +++ /dev/null @@ -1,98 +0,0 @@ -#ifndef DEBUGGER_DISASM_H -#define DEBUGGER_DISASM_H - -#include "Core/MIPS/MIPSStackWalk.h" -#include "Core/HLE/sceKernelThread.h" -#include "Core/Debugger/DebugInterface.h" -#include -#include -#include -#include - -class MainWindow; -namespace Ui { -class Debugger_Disasm; -} - -class Debugger_Disasm : public QDialog -{ - Q_OBJECT - -public: - explicit Debugger_Disasm(DebugInterface *_cpu, MainWindow* mainWindow_, QWidget *parent = 0); - ~Debugger_Disasm(); - void SetDebugMode(bool _bDebug); - - void Go(); - void Step(); - void StepOver(); - void StepHLE(); - void Stop(); - void Skip(); - void GotoPC(); - void GotoLR(); - void UpdateDialog(); - void NotifyMapLoaded(); - void Update(); - void ShowMemory(u32 addr); - void FillFunctions(); - void UpdateCallstack(); - void UpdateBreakpoints(); - void UpdateThread(); - void UpdateDisplayList(); - -signals: - void UpdateCallstack_(); - void UpdateDisplayList_(); - void UpdateBreakpoints_(); - void UpdateThread_(); - -public slots: - void Goto(u32 addr); - void RemoveBreakpoint(); - void GotoThreadEntryPoint(); - -private slots: - void UpdateCallstackGUI(); - void UpdateDisplayListGUI(); - void UpdateBreakpointsGUI(); - void UpdateThreadGUI(); - - void on_GotoPc_clicked(); - void on_Go_clicked(); - void on_Stop_clicked(); - void on_StepInto_clicked(); - void on_StepOver_clicked(); - void on_Skip_clicked(); - void on_NextHLE_clicked(); - void on_GotoLr_clicked(); - void on_GotoInt_currentIndexChanged(int index); - void on_Address_textChanged(const QString &arg1); - void on_DisasmView_customContextMenuRequested(const QPoint &pos); - - void on_RegList_customContextMenuRequested(const QPoint &pos); - void on_FuncList_itemClicked(QListWidgetItem *item); - void on_breakpointsList_itemClicked(QTreeWidgetItem *item, int column); - void on_breakpointsList_customContextMenuRequested(const QPoint &pos); - void on_clearAllBP_clicked(); - void on_threadList_itemClicked(QTreeWidgetItem *item, int column); - void on_threadList_customContextMenuRequested(const QPoint &pos); - - void SetThreadStatusRun(); - void SetThreadStatusWait(); - void SetThreadStatusSuspend(); - void on_displayList_customContextMenuRequested(const QPoint &pos); - -private: - void SetThreadStatus(ThreadStatus status); - - Ui::Debugger_Disasm *ui; - DebugInterface* cpu; - MainWindow* mainWindow; - u32 breakpointAddr; - QTreeWidgetItem* threadRowSelected; - QTreeWidgetItem* displayListRowSelected; - std::vector stackTraceModel; -}; - -#endif // DEBUGGER_DISASM_H diff --git a/Qt/Debugger/debugger_disasm.ui b/Qt/Debugger/debugger_disasm.ui deleted file mode 100644 index 89f5783e78..0000000000 --- a/Qt/Debugger/debugger_disasm.ui +++ /dev/null @@ -1,523 +0,0 @@ - - - Debugger_Disasm - - - - 0 - 0 - 837 - 492 - - - - Qt::ClickFocus - - - Disassembler - - - - - - Qt::Horizontal - - - - - - - Ctr: - - - - - - - - 0 - 0 - - - - &Go to - - - - 0 - - - 4 - - - 4 - - - 0 - - - 0 - - - - - - - - QLayout::SetDefaultConstraint - - - - - - 0 - 0 - - - - &PC - - - - - - - - 0 - 0 - - - - &LR - - - - - - - - 0 - 0 - - - - - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - 0 - - - - - 0 - 0 - - - - Regs - - - - - - - 0 - 0 - - - - Qt::ClickFocus - - - Qt::CustomContextMenu - - - - 0 - - - 0 - - - - - Qt::Horizontal - - - - 120 - 20 - - - - - - - - Qt::Vertical - - - - - - - - - - - Funcs - - - - - - - - - - - - - - - - - - - - 0 - 0 - - - - &Go - - - - - - - - 0 - 0 - - - - Stop - - - - - - - - 0 - 0 - - - - Step &Into - - - - - - - false - - - - 0 - 0 - - - - Step &Over - - - - - - - - 0 - 0 - - - - S&kip - - - - - - - - 0 - 0 - - - - Next &HLE - - - - - - - - - - 0 - 0 - - - - Qt::ClickFocus - - - Qt::CustomContextMenu - - - - - - - 0 - - - - Breakpoints - - - - - - Qt::CustomContextMenu - - - false - - - false - - - 30 - - - - Address - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Clear All - - - - - - - - - - Callstack - - - - - - 4 - - - - Address - - - - - Entry Point - - - - - SP - - - - - length - - - - - - - - - Display Lists - - - - - - Qt::Horizontal - - - - Qt::CustomContextMenu - - - false - - - false - - - false - - - 30 - - - - Id - - - - - Status - - - - - Start Address - - - - - Current Address - - - - - - - - - - Threads - - - - - - Qt::CustomContextMenu - - - false - - - false - - - false - - - 50 - - - - Id - - - - - Name - - - - - Status - - - - - Current PC - - - - - Entry point - - - - - - - - - - - - - - - - - CtrlDisAsmView - QWidget -
ctrldisasmview.h
- 1 -
- - CtrlRegisterList - QWidget -
ctrlregisterlist.h
- 1 -
-
- - -
diff --git a/Qt/QtHost.h b/Qt/QtHost.h index 2df6155bb0..5a0f201b10 100644 --- a/Qt/QtHost.h +++ b/Qt/QtHost.h @@ -41,15 +41,12 @@ public: mainWindow->GetDialogMemory()->Update(); } virtual void UpdateDisassembly() override { - if(mainWindow->GetDialogDisasm()) - mainWindow->GetDialogDisasm()->Update(); + mainWindow->updateMenus(); if(mainWindow->GetDialogDisplaylist()) mainWindow->GetDialogDisplaylist()->Update(); } virtual void SetDebugMode(bool mode) override { - if(mainWindow->GetDialogDisasm()) - mainWindow->GetDialogDisasm()->SetDebugMode(mode); } virtual bool InitGraphics(std::string *error_message, GraphicsContext **ctx) override { return true; } diff --git a/Qt/mainwindow.cpp b/Qt/mainwindow.cpp index 116b7f084a..e5c1ee978f 100644 --- a/Qt/mainwindow.cpp +++ b/Qt/mainwindow.cpp @@ -21,7 +21,6 @@ MainWindow::MainWindow(QWidget *parent, bool fullscreen) : currentLanguage("en"), nextState(CORE_POWERDOWN), lastUIState(UISTATE_MENU), - dialogDisasm(0), memoryWindow(0), memoryTexWindow(0), displaylistWindow(0) @@ -145,10 +144,6 @@ void MainWindow::updateMenus() void MainWindow::bootDone() { - dialogDisasm = new Debugger_Disasm(currentDebugMIPS, this, this); - if(g_Config.bShowDebuggerOnLoad) - dialogDisasm->show(); - if(g_Config.bFullScreen != isFullScreen()) fullscrAct(); @@ -177,11 +172,8 @@ void MainWindow::openAct() void MainWindow::closeAct() { - if(dialogDisasm) - dialogDisasm->Stop(); + updateMenus(); - if(dialogDisasm && dialogDisasm->isVisible()) - dialogDisasm->close(); if(memoryWindow && memoryWindow->isVisible()) memoryWindow->close(); if(memoryTexWindow && memoryTexWindow->isVisible()) @@ -266,11 +258,8 @@ void MainWindow::pauseAct() void MainWindow::resetAct() { - if(dialogDisasm) - dialogDisasm->Stop(); + updateMenus(); - if(dialogDisasm) - dialogDisasm->close(); if(memoryWindow) memoryWindow->close(); if(memoryTexWindow) @@ -333,12 +322,6 @@ void MainWindow::dumpNextAct() gpu->DumpNextFrame(); } -void MainWindow::disasmAct() -{ - if(dialogDisasm) - dialogDisasm->show(); -} - void MainWindow::dpyListAct() { if(displaylistWindow) @@ -537,8 +520,6 @@ void MainWindow::createMenus() debugMenu->add(new MenuAction(this, SLOT(takeScreen()), QT_TR_NOOP("Take Screenshot"), Qt::Key_F12)) ->addDisableState(UISTATE_MENU); debugMenu->addSeparator(); - debugMenu->add(new MenuAction(this, SLOT(disasmAct()), QT_TR_NOOP("Disassembly"), Qt::CTRL + Qt::Key_D)) - ->addDisableState(UISTATE_MENU); //commented out until someone bothers to maintain it //debugMenu->add(new MenuAction(this, SLOT(dpyListAct()), QT_TR_NOOP("Display List..."))) // ->addDisableState(UISTATE_MENU); @@ -671,8 +652,6 @@ void MainWindow::createMenus() void MainWindow::notifyMapsLoaded() { - if (dialogDisasm) - dialogDisasm->NotifyMapLoaded(); if (memoryWindow) memoryWindow->NotifyMapLoaded(); } diff --git a/Qt/mainwindow.h b/Qt/mainwindow.h index ba2d3ff7dc..4f702bfc87 100644 --- a/Qt/mainwindow.h +++ b/Qt/mainwindow.h @@ -12,7 +12,6 @@ #include "Core/Core.h" #include "Core/Config.h" #include "Core/System.h" -#include "Debugger/debugger_disasm.h" #include "Debugger/debugger_memory.h" #include "Debugger/debugger_memorytex.h" #include "Debugger/debugger_displaylist.h" @@ -37,7 +36,6 @@ public: explicit MainWindow(QWidget *parent = 0, bool fullscreen=false); ~MainWindow() { }; - Debugger_Disasm* GetDialogDisasm() { return dialogDisasm; } Debugger_Memory* GetDialogMemory() { return memoryWindow; } Debugger_MemoryTex* GetDialogMemoryTex() { return memoryTexWindow; } Debugger_DisplayList* GetDialogDisplaylist() { return displaylistWindow; } @@ -97,7 +95,6 @@ private slots: void resetTableAct(); void dumpNextAct(); void takeScreen() { g_TakeScreenshot = true; } - void disasmAct(); void dpyListAct(); void consoleAct(); void memviewAct(); @@ -167,7 +164,6 @@ private: CoreState nextState; GlobalUIState lastUIState; - Debugger_Disasm *dialogDisasm; Debugger_Memory *memoryWindow; Debugger_MemoryTex *memoryTexWindow; Debugger_DisplayList *displaylistWindow; diff --git a/Windows/PPSSPP.vcxproj b/Windows/PPSSPP.vcxproj index 9e95c6a1b8..1020d0b76b 100644 --- a/Windows/PPSSPP.vcxproj +++ b/Windows/PPSSPP.vcxproj @@ -1,4 +1,4 @@ - + @@ -341,36 +341,12 @@ - - true - true - true - true - true true true true - - true - true - true - true - - - true - true - true - true - - - true - true - true - true - true true @@ -389,12 +365,6 @@ true true - - true - true - true - true - true true @@ -494,15 +464,10 @@ - - - - - @@ -562,11 +527,9 @@ - - @@ -627,4 +590,4 @@ - \ No newline at end of file + diff --git a/Windows/PPSSPP.vcxproj.filters b/Windows/PPSSPP.vcxproj.filters index 8cce6b63ec..9e263f79d9 100644 --- a/Windows/PPSSPP.vcxproj.filters +++ b/Windows/PPSSPP.vcxproj.filters @@ -1,4 +1,4 @@ - + @@ -161,9 +161,6 @@ Other Platforms\Qt - - Other Platforms\Qt\Debugger - Other Platforms\Qt\Debugger @@ -173,21 +170,9 @@ Other Platforms\Qt\Debugger - - Other Platforms\Qt\Debugger - - - Other Platforms\Qt\Debugger - Other Platforms\Qt\Debugger - - Other Platforms\Qt\Debugger - - - Other Platforms\Qt\Debugger - Windows\System @@ -341,9 +326,6 @@ Other Platforms\Qt\Debugger - - Other Platforms\Qt\Debugger - Other Platforms\Qt\Debugger @@ -353,18 +335,9 @@ Other Platforms\Qt\Debugger - - Other Platforms\Qt\Debugger - - - Other Platforms\Qt\Debugger - Other Platforms\Qt\Debugger - - Other Platforms\Qt\Debugger - Windows\System @@ -468,9 +441,6 @@ Other Platforms\Qt - - Other Platforms\Qt\Debugger - Other Platforms\Qt\Debugger @@ -480,9 +450,6 @@ Other Platforms\Qt\Debugger - - Other Platforms\Qt\Debugger - @@ -494,4 +461,4 @@ Resource Files - \ No newline at end of file +