MCPcopy Create free account
hub / github.com/PCSX2/pcsx2 / loadBreakpointFromFieldList

Method loadBreakpointFromFieldList

pcsx2-qt/Debugger/Breakpoints/BreakpointModel.cpp:561–694  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

559}
560
561void BreakpointModel::loadBreakpointFromFieldList(QStringList fields)
562{
563 std::string error;
564
565 bool ok;
566 if (fields.size() != BreakpointColumns::COLUMN_COUNT)
567 {
568 Console.WriteLn("Debugger Breakpoint Model: Invalid number of columns, skipping");
569 return;
570 }
571
572 const int type = fields[BreakpointColumns::TYPE].toUInt(&ok);
573 if (!ok)
574 {
575 Console.WriteLn("Debugger Breakpoint Model: Failed to parse type '%s', skipping",
576 fields[BreakpointColumns::TYPE].toUtf8().constData());
577 return;
578 }
579
580 // This is how we differentiate between breakpoints and memchecks
581 if (type == MEMCHECK_INVALID)
582 {
583 BreakPoint bp;
584
585 // Address
586 bp.addr = fields[BreakpointColumns::OFFSET].toUInt(&ok, 16);
587 if (!ok)
588 {
589 Console.WriteLn("Debugger Breakpoint Model: Failed to parse address '%s', skipping",
590 fields[BreakpointColumns::OFFSET].toUtf8().constData());
591 return;
592 }
593
594 // Condition
595 if (!fields[BreakpointColumns::CONDITION].isEmpty())
596 {
597 PostfixExpression expr;
598 bp.hasCond = true;
599 bp.cond.debug = &m_cpu;
600
601 if (!m_cpu.initExpression(fields[BreakpointColumns::CONDITION].toUtf8().constData(), expr, error))
602 {
603 Console.WriteLn("Debugger Breakpoint Model: Failed to parse cond '%s', skipping",
604 fields[BreakpointModel::CONDITION].toUtf8().constData());
605 return;
606 }
607 bp.cond.expression = expr;
608 bp.cond.expressionString = fields[BreakpointColumns::CONDITION].toStdString();
609 }
610
611 // Enabled
612 bp.enabled = fields[BreakpointColumns::ENABLED].toUInt(&ok);
613 if (!ok)
614 {
615 Console.WriteLn("Debugger Breakpoint Model: Failed to parse enable flag '%s', skipping",
616 fields[BreakpointColumns::ENABLED].toUtf8().constData());
617 return;
618 }

Callers 2

loadGameSettingsMethod · 0.80
contextPasteCSVMethod · 0.80

Calls 4

initExpressionMethod · 0.80
sizeMethod · 0.45
WriteLnMethod · 0.45
isEmptyMethod · 0.45

Tested by

no test coverage detected