mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-05-02 09:18:36 +00:00
Debugger: Initial implementation of conditional breakpoints
Expression class to store compiled expressions and associated variable list. Co-authored-by: TryTwo <taolas@gmail.com>
This commit is contained in:
parent
9ca1c0f533
commit
7842f9a715
17 changed files with 1240 additions and 36 deletions
|
@ -15,6 +15,7 @@
|
|||
#include "Core/ConfigManager.h"
|
||||
#include "Core/Core.h"
|
||||
#include "Core/PowerPC/BreakPoints.h"
|
||||
#include "Core/PowerPC/Expression.h"
|
||||
#include "Core/PowerPC/PPCSymbolDB.h"
|
||||
#include "Core/PowerPC/PowerPC.h"
|
||||
|
||||
|
@ -86,7 +87,7 @@ void BreakpointWidget::CreateWidgets()
|
|||
m_table = new QTableWidget;
|
||||
m_table->setTabKeyNavigation(false);
|
||||
m_table->setContentsMargins(0, 0, 0, 0);
|
||||
m_table->setColumnCount(5);
|
||||
m_table->setColumnCount(6);
|
||||
m_table->setSelectionMode(QAbstractItemView::SingleSelection);
|
||||
m_table->setSelectionBehavior(QAbstractItemView::SelectRows);
|
||||
m_table->setEditTriggers(QAbstractItemView::NoEditTriggers);
|
||||
|
@ -160,7 +161,7 @@ void BreakpointWidget::Update()
|
|||
m_table->clear();
|
||||
|
||||
m_table->setHorizontalHeaderLabels(
|
||||
{tr("Active"), tr("Type"), tr("Function"), tr("Address"), tr("Flags")});
|
||||
{tr("Active"), tr("Type"), tr("Function"), tr("Address"), tr("Flags"), tr("Condition")});
|
||||
|
||||
int i = 0;
|
||||
m_table->setRowCount(i);
|
||||
|
@ -203,6 +204,13 @@ void BreakpointWidget::Update()
|
|||
|
||||
m_table->setItem(i, 4, create_item(flags));
|
||||
|
||||
QString condition;
|
||||
|
||||
if (bp.condition)
|
||||
condition = QString::fromStdString(bp.condition->GetText());
|
||||
|
||||
m_table->setItem(i, 5, create_item(condition));
|
||||
|
||||
i++;
|
||||
}
|
||||
|
||||
|
@ -387,12 +395,15 @@ void BreakpointWidget::OnContextMenu()
|
|||
|
||||
void BreakpointWidget::AddBP(u32 addr)
|
||||
{
|
||||
AddBP(addr, false, true, true);
|
||||
AddBP(addr, false, true, true, {});
|
||||
}
|
||||
|
||||
void BreakpointWidget::AddBP(u32 addr, bool temp, bool break_on_hit, bool log_on_hit)
|
||||
void BreakpointWidget::AddBP(u32 addr, bool temp, bool break_on_hit, bool log_on_hit,
|
||||
const QString& condition)
|
||||
{
|
||||
PowerPC::breakpoints.Add(addr, temp, break_on_hit, log_on_hit);
|
||||
PowerPC::breakpoints.Add(
|
||||
addr, temp, break_on_hit, log_on_hit,
|
||||
!condition.isEmpty() ? Expression::TryParse(condition.toUtf8().constData()) : std::nullopt);
|
||||
|
||||
emit BreakpointsChanged();
|
||||
Update();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue