| 1 | #cxx . . $ `<file>/src/BreakpointDialog.cpp`/include "BreakpointDialog.h"cxx . . $ `<file>/src/BreakpointDialog.h`/ |
| 2 | #include "DebugSession.h"cxx . . $ `<file>/src/DebugSession.h`/ |
| 3 | #include "Convert.h"cxx . . $ `<file>/src/Convert.h`/ |
| 4 | #include <QStandardItemModel> |
| 5 | #include <memory> |
| 6 | |
| 7 | BreakpointDialogcxx . . $ BreakpointDialog#::BreakpointDialogcxx . . $ BreakpointDialog#BreakpointDialog(a86688e3edaebbf8).(const MemoryLayoutcxx . . $ MemoryLayout#& ml, DebugSessioncxx . . $ DebugSession#* session, QWidgetcxx . . $ QWidget#* parent) |
| 8 | : QDialogcxx . . $ QDialog#QDialog(872e7b0c281abd8d).(parent), memLayoutcxx . . $ BreakpointDialog#memLayout.(ml), currentSymbolcxx . . $ BreakpointDialog#currentSymbol.(nullptr) |
| 9 | { |
| 10 | setupUicxx . . $ Ui_BreakpointDialog#setupUi(d194de0c0f68c28b).(this); |
| 11 | |
| 12 | debugSessioncxx . . $ BreakpointDialog#debugSession. = session; |
| 13 | if (session) { |
| 14 | // create address completer |
| 15 | jumpCompletercxx . . $ BreakpointDialog#jumpCompleter. =cxx . . $ std/unique_ptr#`operator=`(1b63e42eaa758a73). stdcxx . . $ std/::make_uniquecxx . . $ std/make_unique(5cd499e8540a10bb).<QCompletercxx . . $ QCompleter#>(session->symbolTablecxx . . $ DebugSession#symbolTable(2a4b6678dec31d42).().labelListcxx . . $ SymbolTable#labelList(cfa6acfd8fe17c4a).(), this); |
| 16 | allCompletercxx . . $ BreakpointDialog#allCompleter. =cxx . . $ std/unique_ptr#`operator=`(1b63e42eaa758a73). stdcxx . . $ std/::make_uniquecxx . . $ std/make_unique(5cd499e8540a10bb).<QCompletercxx . . $ QCompleter#>(session->symbolTablecxx . . $ DebugSession#symbolTable(2a4b6678dec31d42).().labelListcxx . . $ SymbolTable#labelList(cfa6acfd8fe17c4a).(true), this); |
| 17 | jumpCompletercxx . . $ BreakpointDialog#jumpCompleter.->cxx . . $ std/unique_ptr#`operator->`(ea7391e9eeeaf20e).setCaseSensitivitycxx . . $ QCompleter#setCaseSensitivity(dbd87adfa24451df).(Qtcxx . . $ Qt/::CaseInsensitivecxx . . $ Qt/CaseInsensitive.); |
| 18 | allCompletercxx . . $ BreakpointDialog#allCompleter.->cxx . . $ std/unique_ptr#`operator->`(ea7391e9eeeaf20e).setCaseSensitivitycxx . . $ QCompleter#setCaseSensitivity(dbd87adfa24451df).(Qtcxx . . $ Qt/::CaseInsensitivecxx . . $ Qt/CaseInsensitive.); |
| 19 | connectcxx . . $ QObject#connect(835f87066c895669).(jumpCompletercxx . . $ BreakpointDialog#jumpCompleter..getcxx . . $ std/unique_ptr#get(ea7391e9eeeaf20e).(), qOverloadcxx . . $ qOverload.<const QStringcxx . . $ QString#&>(cxx . . $ QNonConstOverload#`operator()`(a8f97e06674de5d1).&QCompletercxx . . $ QCompleter#::activatedcxx . . $ QCompleter#activated(3520e46b33348bf6).), this, &BreakpointDialogcxx . . $ BreakpointDialog#::addressChangedcxx . . $ BreakpointDialog#addressChanged(3520e46b33348bf6).); |
| 20 | connectcxx . . $ QObject#connect(835f87066c895669).(allCompletercxx . . $ BreakpointDialog#allCompleter..getcxx . . $ std/unique_ptr#get(ea7391e9eeeaf20e).(), qOverloadcxx . . $ qOverload.<const QStringcxx . . $ QString#&>(cxx . . $ QNonConstOverload#`operator()`(a8f97e06674de5d1).&QCompletercxx . . $ QCompleter#::activatedcxx . . $ QCompleter#activated(3520e46b33348bf6).), this, &BreakpointDialogcxx . . $ BreakpointDialog#::addressChangedcxx . . $ BreakpointDialog#addressChanged(3520e46b33348bf6).); |
| 21 | } |
| 22 | |
| 23 | connectcxx . . $ QObject#connect(835f87066c895669).(edtAddresscxx . . $ Ui_BreakpointDialog#edtAddress., &QLineEditcxx . . $ QLineEdit#::textEditedcxx . . $ QLineEdit#textEdited(3520e46b33348bf6)., this, &BreakpointDialogcxx . . $ BreakpointDialog#::addressChangedcxx . . $ BreakpointDialog#addressChanged(3520e46b33348bf6).); |
| 24 | connectcxx . . $ QObject#connect(835f87066c895669).(edtAddressRangecxx . . $ Ui_BreakpointDialog#edtAddressRange., &QLineEditcxx . . $ QLineEdit#::textEditedcxx . . $ QLineEdit#textEdited(3520e46b33348bf6)., this, &BreakpointDialogcxx . . $ BreakpointDialog#::addressChangedcxx . . $ BreakpointDialog#addressChanged(3520e46b33348bf6).); |
| 25 | connectcxx . . $ QObject#connect(835f87066c895669).(cmbxTypecxx . . $ Ui_BreakpointDialog#cmbxType., qOverloadcxx . . $ qOverload.<int>(cxx . . $ QNonConstOverload#`operator()`(a8f97e06674de5d1).&QComboBoxcxx . . $ QComboBox#::activatedcxx . . $ QComboBox#activated(d4f767463ce0a6b3).), this, &BreakpointDialogcxx . . $ BreakpointDialog#::typeChangedcxx . . $ BreakpointDialog#typeChanged(d4f767463ce0a6b3).); |
| 26 | connectcxx . . $ QObject#connect(835f87066c895669).(cmbxSlotcxx . . $ Ui_BreakpointDialog#cmbxSlot., qOverloadcxx . . $ qOverload.<int>(cxx . . $ QNonConstOverload#`operator()`(a8f97e06674de5d1).&QComboBoxcxx . . $ QComboBox#::activatedcxx . . $ QComboBox#activated(d4f767463ce0a6b3).), this, &BreakpointDialogcxx . . $ BreakpointDialog#::slotChangedcxx . . $ BreakpointDialog#slotChanged(d4f767463ce0a6b3).); |
| 27 | connectcxx . . $ QObject#connect(835f87066c895669).(cmbxSubslotcxx . . $ Ui_BreakpointDialog#cmbxSubslot., qOverloadcxx . . $ qOverload.<int>(cxx . . $ QNonConstOverload#`operator()`(a8f97e06674de5d1).&QComboBoxcxx . . $ QComboBox#::activatedcxx . . $ QComboBox#activated(d4f767463ce0a6b3).), this, &BreakpointDialogcxx . . $ BreakpointDialog#::subslotChangedcxx . . $ BreakpointDialog#subslotChanged(d4f767463ce0a6b3).); |
| 28 | connectcxx . . $ QObject#connect(835f87066c895669).(cbConditioncxx . . $ Ui_BreakpointDialog#cbCondition., &QCheckBoxcxx . . $ QCheckBox#::stateChangedcxx . . $ QCheckBox#stateChanged(d4f767463ce0a6b3)., this, &BreakpointDialogcxx . . $ BreakpointDialog#::hasConditioncxx . . $ BreakpointDialog#hasCondition(d4f767463ce0a6b3).); |
| 29 | |
| 30 | typeChangedcxx . . $ BreakpointDialog#typeChanged(d4f767463ce0a6b3).(0); |
| 31 | slotChangedcxx . . $ BreakpointDialog#slotChanged(d4f767463ce0a6b3).(0); |
| 32 | idxSlotcxx . . $ BreakpointDialog#idxSlot. = idxSubSlotcxx . . $ BreakpointDialog#idxSubSlot. = 0; |
| 33 | hasConditioncxx . . $ BreakpointDialog#hasCondition(d4f767463ce0a6b3).(0); |
| 34 | } |
| 35 | |
| 36 | Breakpointcxx . . $ Breakpoint#::Typecxx . . $ Breakpoint#Type# BreakpointDialogcxx . . $ BreakpointDialog#::typecxx . . $ BreakpointDialog#type(78dcede8f25d61ad).() const |
| 37 | { |
| 38 | return Breakpointcxx . . $ Breakpoint#::Typecxx . . $ Breakpoint#Type#(cmbxTypecxx . . $ Ui_BreakpointDialog#cmbxType.->currentIndexcxx . . $ QComboBox#currentIndex(455f465bc33b4cdf).()); |
| 39 | } |
| 40 | |
| 41 | stdcxx . . $ std/::optionalcxx . . $ std/optional#<uint16_tcxx . . $ uint16_t#> BreakpointDialogcxx . . $ BreakpointDialog#::parseInputcxx . . $ BreakpointDialog#parseInput(7d41e7e4d6feb23b).(const QLineEditcxx . . $ QLineEdit#& ed, Symbolcxx . . $ Symbol#** symbol) const { |
| 42 | if (auto value = stringToValuecxx . . $ stringToValue(e8c2a6ba39be27fd).<uint16_tcxx . . $ uint16_t#>(ed.textcxx . . $ QLineEdit#text(6ef7b6c27b00b43d).())) { |
| 43 | return value; |
| 44 | } |
| 45 | |
| 46 | // convert symbol to value |
| 47 | if (debugSessioncxx . . $ BreakpointDialog#debugSession.) { |
| 48 | if (Symbolcxx . . $ Symbol#* s = debugSessioncxx . . $ BreakpointDialog#debugSession.->symbolTablecxx . . $ DebugSession#symbolTable(2a4b6678dec31d42).().getAddressSymbolcxx . . $ SymbolTable#getAddressSymbol(3ca1c26422e5e6a6).(ed.textcxx . . $ QLineEdit#text(6ef7b6c27b00b43d).())) { |
| 49 | if (symbol) *symbol = s; |
| 50 | return scxx . . $ std/optional#optional(e3f0d6382bd52f24).->valuecxx . . $ Symbol#value(455f465bc33b4cdf).(); |
| 51 | } |
| 52 | } |
| 53 | |
| 54 | return {cxx . . $ std/optional#optional(ced63f7c635d850d).}; |
| 55 | } |
| 56 | |
| 57 | stdcxx . . $ std/::optionalcxx . . $ std/optional#<AddressRangecxx . . $ AddressRange#> BreakpointDialogcxx . . $ BreakpointDialog#::addressRangecxx . . $ BreakpointDialog#addressRange(9caab23dda57eb62).(Symbolcxx . . $ Symbol#** symbol) const |
| 58 | { |
| 59 | if (auto address = parseInputcxx . . $ BreakpointDialog#parseInput(7d41e7e4d6feb23b).(*edtAddresscxx . . $ Ui_BreakpointDialog#edtAddress., symbol)) { |
| 60 | if (edtAddressRangecxx . . $ Ui_BreakpointDialog#edtAddressRange.->textcxx . . $ QLineEdit#text(6ef7b6c27b00b43d).().isEmptycxx . . $ QString#isEmpty(50ce9a9e25b4a850).()) { |
| 61 | return AddressRangecxx . . $ std/optional#optional(e3f0d6382bd52f24).{*cxx . . $ std/optional#`operator*`(47e1a15210ec6306).address}; |
| 62 | } else if (auto endAddress = parseInputcxx . . $ BreakpointDialog#parseInput(7d41e7e4d6feb23b).(*edtAddressRangecxx . . $ Ui_BreakpointDialog#edtAddressRange.)) { |
| 63 | if (*cxx . . $ std/optional#`operator*`(47e1a15210ec6306).address <= *cxx . . $ std/optional#`operator*`(47e1a15210ec6306).endAddress) { |
| 64 | return AddressRangecxx . . $ std/optional#optional(e3f0d6382bd52f24).{*cxx . . $ std/optional#`operator*`(47e1a15210ec6306).address, make_ifcxx . . $ make_if(e25f002ff5d2f3ed).(*cxx . . $ std/optional#`operator*`(47e1a15210ec6306).address != *cxx . . $ std/optional#`operator*`(47e1a15210ec6306).endAddress, *cxx . . $ std/optional#`operator*`(47e1a15210ec6306).endAddress)}; |
| 65 | } |
| 66 | } |
| 67 | } |
| 68 | return {cxx . . $ std/optional#optional(ced63f7c635d850d).}; |
| 69 | } |
| 70 | |
| 71 | Slotcxx . . $ Slot# BreakpointDialogcxx . . $ BreakpointDialog#::slotcxx . . $ BreakpointDialog#slot(79e0e3b12be0d869).() const |
| 72 | { |
| 73 | auto slot = make_positive_optionalcxx . . $ make_positive_optional(42be48c011d89853).<uint8_tcxx . . $ uint8_t#>(cmbxSlotcxx . . $ Ui_BreakpointDialog#cmbxSlot.->currentIndexcxx . . $ QComboBox#currentIndex(455f465bc33b4cdf).() - 1); |
| 74 | auto subslot = make_positive_optionalcxx . . $ make_positive_optional(42be48c011d89853).<uint8_tcxx . . $ uint8_t#>(cmbxSubslotcxx . . $ Ui_BreakpointDialog#cmbxSubslot.->currentIndexcxx . . $ QComboBox#currentIndex(455f465bc33b4cdf).() - 1); |
| 75 | return Slotcxx . . $ Slot#{slot, subslot}; |
| 76 | } |
| 77 | |
| 78 | stdcxx . . $ std/::optionalcxx . . $ std/optional#<uint8_tcxx . . $ uint8_t#> BreakpointDialogcxx . . $ BreakpointDialog#::segmentcxx . . $ BreakpointDialog#segment(4868b16b0cebf4ff).() const |
| 79 | { |
| 80 | return make_positive_optionalcxx . . $ make_positive_optional(42be48c011d89853).<uint8_tcxx . . $ uint8_t#>(cmbxSegmentcxx . . $ Ui_BreakpointDialog#cmbxSegment.->currentIndexcxx . . $ QComboBox#currentIndex(455f465bc33b4cdf).() - 1); |
| 81 | } |
| 82 | |
| 83 | QStringcxx . . $ QString# BreakpointDialogcxx . . $ BreakpointDialog#::conditioncxx . . $ BreakpointDialog#condition(6ef7b6c27b00b43d).() const |
| 84 | { |
| 85 | return (cbConditioncxx . . $ Ui_BreakpointDialog#cbCondition.->checkStatecxx . . $ QCheckBox#checkState(94511a6609c7e4a7).() == Qtcxx . . $ Qt/::Checkedcxx . . $ Qt/Checked.) ? txtConditioncxx . . $ Ui_BreakpointDialog#txtCondition.->toPlainTextcxx . . $ QTextEdit#toPlainText(6ef7b6c27b00b43d).() : ""cxx . . $ QString#QString(85c52e162fed56f9).; |
| 86 | } |
| 87 | |
| 88 | void BreakpointDialogcxx . . $ BreakpointDialog#::setDatacxx . . $ BreakpointDialog#setData(b5198bcf8d3b4f65).(Breakpointcxx . . $ Breakpoint#::Typecxx . . $ Breakpoint#Type# type, stdcxx . . $ std/::optionalcxx . . $ std/optional#<AddressRangecxx . . $ AddressRange#> range, Slotcxx . . $ Slot# slot, |
| 89 | stdcxx . . $ std/::optionalcxx . . $ std/optional#<uint8_tcxx . . $ uint8_t#> segment, QStringcxx . . $ QString# condition) |
| 90 | { |
| 91 | // set type |
| 92 | cmbxTypecxx . . $ Ui_BreakpointDialog#cmbxType.->setCurrentIndexcxx . . $ QComboBox#setCurrentIndex(d4f767463ce0a6b3).(int(type)); |
| 93 | typeChangedcxx . . $ BreakpointDialog#typeChanged(d4f767463ce0a6b3).(cmbxTypecxx . . $ Ui_BreakpointDialog#cmbxType.->currentIndexcxx . . $ QComboBox#currentIndex(455f465bc33b4cdf).()); |
| 94 | |
| 95 | // set address |
| 96 | edtAddresscxx . . $ Ui_BreakpointDialog#edtAddress.->setTextcxx . . $ QLineEdit#setText(3520e46b33348bf6).(range ? hexValuecxx . . $ hexValue(f4fd9db251ca774b).(range->cxx . . $ std/optional#`operator->`(258ee1c9e0a18a5c).startcxx . . $ AddressRange#start.): ""cxx . . $ QString#QString(85c52e162fed56f9).); |
| 97 | if (range) { |
| 98 | addressChangedcxx . . $ BreakpointDialog#addressChanged(3520e46b33348bf6).(edtAddresscxx . . $ Ui_BreakpointDialog#edtAddress.->textcxx . . $ QLineEdit#text(6ef7b6c27b00b43d).()); |
| 99 | } |
| 100 | |
| 101 | // set end address |
| 102 | if (edtAddressRangecxx . . $ Ui_BreakpointDialog#edtAddressRange.->isEnabledcxx . . $ QWidget#isEnabled(50ce9a9e25b4a850).()) { |
| 103 | edtAddressRangecxx . . $ Ui_BreakpointDialog#edtAddressRange.->setTextcxx . . $ QLineEdit#setText(3520e46b33348bf6).(range && range->cxx . . $ std/optional#`operator->`(258ee1c9e0a18a5c).endcxx . . $ AddressRange#end. ? hexValuecxx . . $ hexValue(f4fd9db251ca774b).(*cxx . . $ std/optional#`operator*`(47e1a15210ec6306).range->cxx . . $ std/optional#`operator->`(258ee1c9e0a18a5c).endcxx . . $ AddressRange#end.) : ""cxx . . $ QString#QString(85c52e162fed56f9).); |
| 104 | addressChangedcxx . . $ BreakpointDialog#addressChanged(3520e46b33348bf6).(edtAddressRangecxx . . $ Ui_BreakpointDialog#edtAddressRange.->textcxx . . $ QLineEdit#text(6ef7b6c27b00b43d).()); |
| 105 | } |
| 106 | |
| 107 | // set primary slot |
| 108 | if (cmbxSlotcxx . . $ Ui_BreakpointDialog#cmbxSlot.->isEnabledcxx . . $ QWidget#isEnabled(50ce9a9e25b4a850).()) { |
| 109 | cmbxSlotcxx . . $ Ui_BreakpointDialog#cmbxSlot.->setCurrentIndexcxx . . $ QComboBox#setCurrentIndex(d4f767463ce0a6b3).(slot.pscxx . . $ Slot#ps. ? *cxx . . $ std/optional#`operator*`(47e1a15210ec6306).slot.pscxx . . $ Slot#ps. + 1 : -1); |
| 110 | slotChangedcxx . . $ BreakpointDialog#slotChanged(d4f767463ce0a6b3).(cmbxSlotcxx . . $ Ui_BreakpointDialog#cmbxSlot.->currentIndexcxx . . $ QComboBox#currentIndex(455f465bc33b4cdf).()); |
| 111 | } |
| 112 | |
| 113 | // set secondary slot |
| 114 | if (cmbxSubslotcxx . . $ Ui_BreakpointDialog#cmbxSubslot.->isEnabledcxx . . $ QWidget#isEnabled(50ce9a9e25b4a850).()) { |
| 115 | cmbxSubslotcxx . . $ Ui_BreakpointDialog#cmbxSubslot.->setCurrentIndexcxx . . $ QComboBox#setCurrentIndex(d4f767463ce0a6b3).(slot.sscxx . . $ Slot#ss. ? *cxx . . $ std/optional#`operator*`(47e1a15210ec6306).slot.sscxx . . $ Slot#ss. + 1 : -1); |
| 116 | subslotChangedcxx . . $ BreakpointDialog#subslotChanged(d4f767463ce0a6b3).(cmbxSubslotcxx . . $ Ui_BreakpointDialog#cmbxSubslot.->currentIndexcxx . . $ QComboBox#currentIndex(455f465bc33b4cdf).()); |
| 117 | } |
| 118 | |
| 119 | // set segment |
| 120 | if (cmbxSegmentcxx . . $ Ui_BreakpointDialog#cmbxSegment.->isEnabledcxx . . $ QWidget#isEnabled(50ce9a9e25b4a850).()) { |
| 121 | cmbxSegmentcxx . . $ Ui_BreakpointDialog#cmbxSegment.->setCurrentIndexcxx . . $ QComboBox#setCurrentIndex(d4f767463ce0a6b3).(segment ? *cxx . . $ std/optional#`operator*`(47e1a15210ec6306).segment + 1 : -1); |
| 122 | } |
| 123 | |
| 124 | // set condition |
| 125 | condition =cxx . . $ QString#`operator=`(4f35bf974e7f8568). condition.trimmedcxx . . $ QString#trimmed(dca2c5857e9adf82).(); |
| 126 | if (cbConditioncxx . . $ Ui_BreakpointDialog#cbCondition.->isCheckedcxx . . $ QAbstractButton#isChecked(50ce9a9e25b4a850).() == condition.isEmptycxx . . $ QString#isEmpty(50ce9a9e25b4a850).()) |
| 127 | cbConditioncxx . . $ Ui_BreakpointDialog#cbCondition.->setCheckedcxx . . $ QAbstractButton#setChecked(b45ddcbc8423892c).(!condition.isEmptycxx . . $ QString#isEmpty(50ce9a9e25b4a850).()); |
| 128 | txtConditioncxx . . $ Ui_BreakpointDialog#txtCondition.->setTextcxx . . $ QTextEdit#setText(3520e46b33348bf6).(condition); |
| 129 | } |
| 130 | |
| 131 | void BreakpointDialogcxx . . $ BreakpointDialog#::disableSlotscxx . . $ BreakpointDialog#disableSlots(49f6e7a06ebc5aa8).() |
| 132 | { |
| 133 | cmbxSlotcxx . . $ Ui_BreakpointDialog#cmbxSlot.->setCurrentIndexcxx . . $ QComboBox#setCurrentIndex(d4f767463ce0a6b3).(0); |
| 134 | cmbxSlotcxx . . $ Ui_BreakpointDialog#cmbxSlot.->setEnabledcxx . . $ QWidget#setEnabled(b45ddcbc8423892c).(false); |
| 135 | } |
| 136 | |
| 137 | void BreakpointDialogcxx . . $ BreakpointDialog#::enableSlotscxx . . $ BreakpointDialog#enableSlots(49f6e7a06ebc5aa8).() |
| 138 | { |
| 139 | auto* model = qobject_castcxx . . $ qobject_cast(c988cfc0ca08742e).<QStandardItemModelcxx . . $ QStandardItemModel#*>(cmbxSlotcxx . . $ Ui_BreakpointDialog#cmbxSlot.->modelcxx . . $ QComboBox#model(c9c1e11e7bd96493).()); |
| 140 | cmbxSlotcxx . . $ Ui_BreakpointDialog#cmbxSlot.->setEnabledcxx . . $ QWidget#setEnabled(b45ddcbc8423892c).(true); |
| 141 | |
| 142 | if (currentSymbolcxx . . $ BreakpointDialog#currentSymbol.) { |
| 143 | // enable allowed slots |
| 144 | int s = currentSymbolcxx . . $ BreakpointDialog#currentSymbol.->validSlotscxx . . $ Symbol#validSlots(72085aa11f4b6e09).(); |
| 145 | int num = 0; |
| 146 | int last = 0; |
| 147 | |
| 148 | for (int i = 4; i >= 0; i--) { |
| 149 | QModelIndexcxx . . $ QModelIndex# index = model->indexcxx . . $ QStandardItemModel#index(37dbccf64c4e392).(i, 0, cmbxSlotcxx . . $ Ui_BreakpointDialog#cmbxSlot.->rootModelIndexcxx . . $ QComboBox#rootModelIndex(a394cbc57608ce34).()); |
| 150 | if (i) { |
| 151 | bool ena = (s & (15 << (4 * (i - 1)))) != 0; |
| 152 | model->itemFromIndexcxx . . $ QStandardItemModel#itemFromIndex(46003b720fc1f171).(index)->setEnabledcxx . . $ QStandardItem#setEnabled(b45ddcbc8423892c).(ena); |
| 153 | if (ena) { |
| 154 | num++; |
| 155 | last = i; |
| 156 | } |
| 157 | } else { |
| 158 | model->itemFromIndexcxx . . $ QStandardItemModel#itemFromIndex(46003b720fc1f171).(index)->setEnabledcxx . . $ QStandardItem#setEnabled(b45ddcbc8423892c).(num == 4); |
| 159 | if (num == 4) last = 0; |
| 160 | } |
| 161 | } |
| 162 | cmbxSlotcxx . . $ Ui_BreakpointDialog#cmbxSlot.->setCurrentIndexcxx . . $ QComboBox#setCurrentIndex(d4f767463ce0a6b3).(last); |
| 163 | } else { |
| 164 | // enable everything |
| 165 | for (int i = 0; i < 5; i++) { |
| 166 | QModelIndexcxx . . $ QModelIndex# index = model->indexcxx . . $ QStandardItemModel#index(37dbccf64c4e392).(i, 0, cmbxSlotcxx . . $ Ui_BreakpointDialog#cmbxSlot.->rootModelIndexcxx . . $ QComboBox#rootModelIndex(a394cbc57608ce34).()); |
| 167 | model->itemFromIndexcxx . . $ QStandardItemModel#itemFromIndex(46003b720fc1f171).(index)->setEnabledcxx . . $ QStandardItem#setEnabled(b45ddcbc8423892c).(true); |
| 168 | } |
| 169 | cmbxSlotcxx . . $ Ui_BreakpointDialog#cmbxSlot.->setCurrentIndexcxx . . $ QComboBox#setCurrentIndex(d4f767463ce0a6b3).(idxSlotcxx . . $ BreakpointDialog#idxSlot.); |
| 170 | } |
| 171 | } |
| 172 | |
| 173 | void BreakpointDialogcxx . . $ BreakpointDialog#::addressChangedcxx . . $ BreakpointDialog#addressChanged(3520e46b33348bf6).(const QStringcxx . . $ QString#& /*text*/) |
| 174 | { |
| 175 | // adjust controls for (in)correct values |
| 176 | auto range = addressRangecxx . . $ BreakpointDialog#addressRange(9caab23dda57eb62).(¤tSymbolcxx . . $ BreakpointDialog#currentSymbol.); |
| 177 | QPalettecxx . . $ QPalette# palcxx . . $ QPalette#QPalette(49f6e7a06ebc5aa8).; |
| 178 | |
| 179 | if (!range) { |
| 180 | // set line edit text to red for invalid values TODO: make configurable |
| 181 | pal.setColorcxx . . $ QPalette#setColor(5c3218fcc49a2895).(QPalettecxx . . $ QPalette#::Normalcxx . . $ QPalette#Normal., QPalettecxx . . $ QPalette#::Textcxx . . $ QPalette#Text., Qtcxx . . $ QColor#QColor(408ec4d5924bfb00).::redcxx . . $ Qt/red.); |
| 182 | disableSlotscxx . . $ BreakpointDialog#disableSlots(49f6e7a06ebc5aa8).(); |
| 183 | } else { |
| 184 | enableSlotscxx . . $ BreakpointDialog#enableSlots(49f6e7a06ebc5aa8).(); |
| 185 | slotChangedcxx . . $ BreakpointDialog#slotChanged(d4f767463ce0a6b3).(cmbxSlotcxx . . $ Ui_BreakpointDialog#cmbxSlot.->currentIndexcxx . . $ QComboBox#currentIndex(455f465bc33b4cdf).()); |
| 186 | } |
| 187 | |
| 188 | edtAddresscxx . . $ Ui_BreakpointDialog#edtAddress.->setPalettecxx . . $ QWidget#setPalette(f826ed73d5553cd5).(pal); |
| 189 | edtAddressRangecxx . . $ Ui_BreakpointDialog#edtAddressRange.->setPalettecxx . . $ QWidget#setPalette(f826ed73d5553cd5).(pal); |
| 190 | okButtoncxx . . $ Ui_BreakpointDialog#okButton.->setEnabledcxx . . $ QWidget#setEnabled(b45ddcbc8423892c).(range.has_valuecxx . . $ std/optional#has_value(3482b152b9333168).()); |
| 191 | } |
| 192 | |
| 193 | void BreakpointDialogcxx . . $ BreakpointDialog#::typeChangedcxx . . $ BreakpointDialog#typeChanged(d4f767463ce0a6b3).(int s) |
| 194 | { |
| 195 | switch(s) { |
| 196 | case 1: |
| 197 | case 2: |
| 198 | lblAddresscxx . . $ Ui_BreakpointDialog#lblAddress.->setTextcxx . . $ QLabel#setText(3520e46b33348bf6).(trcxx . . $ BreakpointDialog#tr(75d9f1c324b4579d).("Add watchpoint at memory address or range:")); |
| 199 | edtAddressRangecxx . . $ Ui_BreakpointDialog#edtAddressRange.->setVisiblecxx . . $ QWidget#setVisible(b45ddcbc8423892c).(true); |
| 200 | edtAddresscxx . . $ Ui_BreakpointDialog#edtAddress.->setCompletercxx . . $ QLineEdit#setCompleter(638321c80ff6aea).(allCompletercxx . . $ BreakpointDialog#allCompleter..getcxx . . $ std/unique_ptr#get(ea7391e9eeeaf20e).()); |
| 201 | edtAddressRangecxx . . $ Ui_BreakpointDialog#edtAddressRange.->setCompletercxx . . $ QLineEdit#setCompleter(638321c80ff6aea).(allCompletercxx . . $ BreakpointDialog#allCompleter..getcxx . . $ std/unique_ptr#get(ea7391e9eeeaf20e).()); |
| 202 | break; |
| 203 | case 3: |
| 204 | case 4: |
| 205 | lblAddresscxx . . $ Ui_BreakpointDialog#lblAddress.->setTextcxx . . $ QLabel#setText(3520e46b33348bf6).(trcxx . . $ BreakpointDialog#tr(75d9f1c324b4579d).("Add watchpoint on IO port or range:")); |
| 206 | edtAddressRangecxx . . $ Ui_BreakpointDialog#edtAddressRange.->setVisiblecxx . . $ QWidget#setVisible(b45ddcbc8423892c).(true); |
| 207 | edtAddresscxx . . $ Ui_BreakpointDialog#edtAddress.->setCompletercxx . . $ QLineEdit#setCompleter(638321c80ff6aea).(nullptr); |
| 208 | edtAddressRangecxx . . $ Ui_BreakpointDialog#edtAddressRange.->setCompletercxx . . $ QLineEdit#setCompleter(638321c80ff6aea).(nullptr); |
| 209 | break; |
| 210 | default: |
| 211 | lblAddresscxx . . $ Ui_BreakpointDialog#lblAddress.->setTextcxx . . $ QLabel#setText(3520e46b33348bf6).(trcxx . . $ BreakpointDialog#tr(75d9f1c324b4579d).("Add breakpoint at address:")); |
| 212 | edtAddressRangecxx . . $ Ui_BreakpointDialog#edtAddressRange.->setVisiblecxx . . $ QWidget#setVisible(b45ddcbc8423892c).(false); |
| 213 | edtAddresscxx . . $ Ui_BreakpointDialog#edtAddress.->setCompletercxx . . $ QLineEdit#setCompleter(638321c80ff6aea).(jumpCompletercxx . . $ BreakpointDialog#jumpCompleter..getcxx . . $ std/unique_ptr#get(ea7391e9eeeaf20e).()); |
| 214 | } |
| 215 | |
| 216 | switch(s) { |
| 217 | case 1: |
| 218 | case 2: |
| 219 | lblInSlotcxx . . $ Ui_BreakpointDialog#lblInSlot.->setTextcxx . . $ QLabel#setText(3520e46b33348bf6).(trcxx . . $ BreakpointDialog#tr(75d9f1c324b4579d).("With address in")); |
| 220 | break; |
| 221 | default: |
| 222 | lblInSlotcxx . . $ Ui_BreakpointDialog#lblInSlot.->setTextcxx . . $ QLabel#setText(3520e46b33348bf6).(trcxx . . $ BreakpointDialog#tr(75d9f1c324b4579d).("With PC in")); |
| 223 | } |
| 224 | |
| 225 | if (s == 5) { |
| 226 | lblAddresscxx . . $ Ui_BreakpointDialog#lblAddress.->setEnabledcxx . . $ QWidget#setEnabled(b45ddcbc8423892c).(false); |
| 227 | edtAddresscxx . . $ Ui_BreakpointDialog#edtAddress.->setEnabledcxx . . $ QWidget#setEnabled(b45ddcbc8423892c).(false); |
| 228 | lblSlotcxx . . $ Ui_BreakpointDialog#lblSlot.->setEnabledcxx . . $ QWidget#setEnabled(b45ddcbc8423892c).(false); |
| 229 | lblSubslotcxx . . $ Ui_BreakpointDialog#lblSubslot.->setEnabledcxx . . $ QWidget#setEnabled(b45ddcbc8423892c).(false); |
| 230 | lblSegmentcxx . . $ Ui_BreakpointDialog#lblSegment.->setEnabledcxx . . $ QWidget#setEnabled(b45ddcbc8423892c).(false); |
| 231 | cmbxSlotcxx . . $ Ui_BreakpointDialog#cmbxSlot.->setEnabledcxx . . $ QWidget#setEnabled(b45ddcbc8423892c).(false); |
| 232 | cmbxSubslotcxx . . $ Ui_BreakpointDialog#cmbxSubslot.->setEnabledcxx . . $ QWidget#setEnabled(b45ddcbc8423892c).(false); |
| 233 | cmbxSegmentcxx . . $ Ui_BreakpointDialog#cmbxSegment.->setEnabledcxx . . $ QWidget#setEnabled(b45ddcbc8423892c).(false); |
| 234 | cbConditioncxx . . $ Ui_BreakpointDialog#cbCondition.->setCheckStatecxx . . $ QCheckBox#setCheckState(537692883700039).(Qtcxx . . $ Qt/::Checkedcxx . . $ Qt/Checked.); |
| 235 | cbConditioncxx . . $ Ui_BreakpointDialog#cbCondition.->setEnabledcxx . . $ QWidget#setEnabled(b45ddcbc8423892c).(false); |
| 236 | } else { |
| 237 | lblAddresscxx . . $ Ui_BreakpointDialog#lblAddress.->setEnabledcxx . . $ QWidget#setEnabled(b45ddcbc8423892c).(true); |
| 238 | edtAddresscxx . . $ Ui_BreakpointDialog#edtAddress.->setEnabledcxx . . $ QWidget#setEnabled(b45ddcbc8423892c).(true); |
| 239 | lblSlotcxx . . $ Ui_BreakpointDialog#lblSlot.->setEnabledcxx . . $ QWidget#setEnabled(b45ddcbc8423892c).(true); |
| 240 | lblSubslotcxx . . $ Ui_BreakpointDialog#lblSubslot.->setEnabledcxx . . $ QWidget#setEnabled(b45ddcbc8423892c).(true); |
| 241 | lblSegmentcxx . . $ Ui_BreakpointDialog#lblSegment.->setEnabledcxx . . $ QWidget#setEnabled(b45ddcbc8423892c).(true); |
| 242 | addressChangedcxx . . $ BreakpointDialog#addressChanged(3520e46b33348bf6).(edtAddresscxx . . $ Ui_BreakpointDialog#edtAddress.->textcxx . . $ QLineEdit#text(6ef7b6c27b00b43d).()); |
| 243 | cbConditioncxx . . $ Ui_BreakpointDialog#cbCondition.->setEnabledcxx . . $ QWidget#setEnabled(b45ddcbc8423892c).(true); |
| 244 | cbConditioncxx . . $ Ui_BreakpointDialog#cbCondition.->setCheckStatecxx . . $ QCheckBox#setCheckState(537692883700039).(txtConditioncxx . . $ Ui_BreakpointDialog#txtCondition.->toPlainTextcxx . . $ QTextEdit#toPlainText(6ef7b6c27b00b43d).().isEmptycxx . . $ QString#isEmpty(50ce9a9e25b4a850).() ? Qtcxx . . $ Qt/::Uncheckedcxx . . $ Qt/Unchecked. : Qtcxx . . $ Qt/::Checkedcxx . . $ Qt/Checked.); |
| 245 | } |
| 246 | } |
| 247 | |
| 248 | void BreakpointDialogcxx . . $ BreakpointDialog#::slotChangedcxx . . $ BreakpointDialog#slotChanged(d4f767463ce0a6b3).(int s) |
| 249 | { |
| 250 | if (!currentSymbolcxx . . $ BreakpointDialog#currentSymbol.) idxSlotcxx . . $ BreakpointDialog#idxSlot. = s; |
| 251 | if (s && memLayoutcxx . . $ BreakpointDialog#memLayout..isSubslottedcxx . . $ MemoryLayout#isSubslotted.[s - 1]) { |
| 252 | if (currentSymbolcxx . . $ BreakpointDialog#currentSymbol.) { |
| 253 | // enable subslots |
| 254 | int v = (currentSymbolcxx . . $ BreakpointDialog#currentSymbol.->validSlotscxx . . $ Symbol#validSlots(72085aa11f4b6e09).() >> (4 * (s - 1))) & 15; |
| 255 | int num = 0; |
| 256 | int last = 0; |
| 257 | auto* model = qobject_castcxx . . $ qobject_cast(c988cfc0ca08742e).<QStandardItemModelcxx . . $ QStandardItemModel#*>(cmbxSubslotcxx . . $ Ui_BreakpointDialog#cmbxSubslot.->modelcxx . . $ QComboBox#model(c9c1e11e7bd96493).()); |
| 258 | for (int i = 4; i >= 0; i--) { |
| 259 | QModelIndexcxx . . $ QModelIndex# index = model->indexcxx . . $ QStandardItemModel#index(37dbccf64c4e392).(i, 0, cmbxSubslotcxx . . $ Ui_BreakpointDialog#cmbxSubslot.->rootModelIndexcxx . . $ QComboBox#rootModelIndex(a394cbc57608ce34).()); |
| 260 | if (i) { |
| 261 | bool ena = (v & (1 << (i - 1))) != 0; |
| 262 | model->itemFromIndexcxx . . $ QStandardItemModel#itemFromIndex(46003b720fc1f171).(index)->setEnabledcxx . . $ QStandardItem#setEnabled(b45ddcbc8423892c).(ena); |
| 263 | if (ena) { |
| 264 | num++; |
| 265 | last = i; |
| 266 | } |
| 267 | } else { |
| 268 | model->itemFromIndexcxx . . $ QStandardItemModel#itemFromIndex(46003b720fc1f171).(index)->setEnabledcxx . . $ QStandardItem#setEnabled(b45ddcbc8423892c).(num == 4); |
| 269 | if (num == 4) last = 0; |
| 270 | } |
| 271 | } |
| 272 | cmbxSubslotcxx . . $ Ui_BreakpointDialog#cmbxSubslot.->setCurrentIndexcxx . . $ QComboBox#setCurrentIndex(d4f767463ce0a6b3).(last); |
| 273 | } else { |
| 274 | cmbxSubslotcxx . . $ Ui_BreakpointDialog#cmbxSubslot.->setCurrentIndexcxx . . $ QComboBox#setCurrentIndex(d4f767463ce0a6b3).(idxSubSlotcxx . . $ BreakpointDialog#idxSubSlot.); |
| 275 | } |
| 276 | cmbxSubslotcxx . . $ Ui_BreakpointDialog#cmbxSubslot.->setEnabledcxx . . $ QWidget#setEnabled(b45ddcbc8423892c).(true); |
| 277 | } else { |
| 278 | cmbxSubslotcxx . . $ Ui_BreakpointDialog#cmbxSubslot.->setEnabledcxx . . $ QWidget#setEnabled(b45ddcbc8423892c).(false); |
| 279 | cmbxSubslotcxx . . $ Ui_BreakpointDialog#cmbxSubslot.->setCurrentIndexcxx . . $ QComboBox#setCurrentIndex(d4f767463ce0a6b3).(0); |
| 280 | } |
| 281 | subslotChangedcxx . . $ BreakpointDialog#subslotChanged(d4f767463ce0a6b3).(cmbxSubslotcxx . . $ Ui_BreakpointDialog#cmbxSubslot.->currentIndexcxx . . $ QComboBox#currentIndex(455f465bc33b4cdf).()); |
| 282 | } |
| 283 | |
| 284 | void BreakpointDialogcxx . . $ BreakpointDialog#::subslotChangedcxx . . $ BreakpointDialog#subslotChanged(d4f767463ce0a6b3).(int i) |
| 285 | { |
| 286 | if (!currentSymbolcxx . . $ BreakpointDialog#currentSymbol.) idxSubSlotcxx . . $ BreakpointDialog#idxSubSlot. = i; |
| 287 | int oldseg = cmbxSegmentcxx . . $ Ui_BreakpointDialog#cmbxSegment.->currentIndexcxx . . $ QComboBox#currentIndex(455f465bc33b4cdf).() - 1; |
| 288 | cmbxSegmentcxx . . $ Ui_BreakpointDialog#cmbxSegment.->clearcxx . . $ QComboBox#clear(49f6e7a06ebc5aa8).(); |
| 289 | cmbxSegmentcxx . . $ Ui_BreakpointDialog#cmbxSegment.->addItemcxx . . $ QComboBox#addItem(1c60a90c724e6bfb).("any"cxx . . $ QString#QString(85c52e162fed56f9).); |
| 290 | |
| 291 | int ps = cmbxSlotcxx . . $ Ui_BreakpointDialog#cmbxSlot.->currentIndexcxx . . $ QComboBox#currentIndex(455f465bc33b4cdf).() - 1; |
| 292 | int ss = i - 1; |
| 293 | |
| 294 | if (ps >= 0 && !memLayoutcxx . . $ BreakpointDialog#memLayout..isSubslottedcxx . . $ MemoryLayout#isSubslotted.[ps]) ss = 0; |
| 295 | |
| 296 | int mapsize; |
| 297 | if (ps < 0 || ss < 0 || memLayoutcxx . . $ BreakpointDialog#memLayout..mapperSizecxx . . $ MemoryLayout#mapperSize.[ps][ss] == 0) { |
| 298 | auto range = addressRangecxx . . $ BreakpointDialog#addressRange(9caab23dda57eb62).(); |
| 299 | |
| 300 | // no memory mapper, maybe rom mapper? |
| 301 | if (range && memLayoutcxx . . $ BreakpointDialog#memLayout..romBlockcxx . . $ MemoryLayout#romBlock.[((range->cxx . . $ std/optional#`operator->`(258ee1c9e0a18a5c).startcxx . . $ AddressRange#start. & 0xE000) >> 13)] >= 0) { |
| 302 | mapsize = 256; // TODO: determine real size |
| 303 | } else { |
| 304 | cmbxSegmentcxx . . $ Ui_BreakpointDialog#cmbxSegment.->setEnabledcxx . . $ QWidget#setEnabled(b45ddcbc8423892c).(false); |
| 305 | cmbxSegmentcxx . . $ Ui_BreakpointDialog#cmbxSegment.->setCurrentIndexcxx . . $ QComboBox#setCurrentIndex(d4f767463ce0a6b3).(0); |
| 306 | return; |
| 307 | } |
| 308 | } else |
| 309 | mapsize = memLayoutcxx . . $ BreakpointDialog#memLayout..mapperSizecxx . . $ MemoryLayout#mapperSize.[ps][ss]; |
| 310 | |
| 311 | for (int s = 0; s < mapsize; ++s) { |
| 312 | cmbxSegmentcxx . . $ Ui_BreakpointDialog#cmbxSegment.->addItemcxx . . $ QComboBox#addItem(1c60a90c724e6bfb).(QStringcxx . . $ QString#QString(85c52e162fed56f9).("%1").argcxx . . $ QString#arg(64ab2ed17cc11715).(s)); |
| 313 | } |
| 314 | cmbxSegmentcxx . . $ Ui_BreakpointDialog#cmbxSegment.->setEnabledcxx . . $ QWidget#setEnabled(b45ddcbc8423892c).(true); |
| 315 | if (oldseg >= 0 && oldseg < mapsize) { |
| 316 | cmbxSegmentcxx . . $ Ui_BreakpointDialog#cmbxSegment.->setCurrentIndexcxx . . $ QComboBox#setCurrentIndex(d4f767463ce0a6b3).(oldseg + 1); |
| 317 | } |
| 318 | } |
| 319 | |
| 320 | void BreakpointDialogcxx . . $ BreakpointDialog#::hasConditioncxx . . $ BreakpointDialog#hasCondition(d4f767463ce0a6b3).(int state) |
| 321 | { |
| 322 | if (state == Qtcxx . . $ Qt/::Checkedcxx . . $ Qt/Checked.) { |
| 323 | txtConditioncxx . . $ Ui_BreakpointDialog#txtCondition.->setVisiblecxx . . $ QWidget#setVisible(b45ddcbc8423892c).(true); |
| 324 | layoutcxx . . $ QWidget#layout(5761b17781c20cfb).()->setSizeConstraintcxx . . $ QLayout#setSizeConstraint(2d278d641bf12a66).(QLayoutcxx . . $ QLayout#::SetDefaultConstraintcxx . . $ QLayout#SetDefaultConstraint.); |
| 325 | resizecxx . . $ QWidget#resize(3e454b8ccf442868).(widthcxx . . $ QWidget#width(455f465bc33b4cdf).(), conditionHeightcxx . . $ BreakpointDialog#conditionHeight.); |
| 326 | } else { |
| 327 | conditionHeightcxx . . $ BreakpointDialog#conditionHeight. = heightcxx . . $ QWidget#height(455f465bc33b4cdf).(); |
| 328 | txtConditioncxx . . $ Ui_BreakpointDialog#txtCondition.->setVisiblecxx . . $ QWidget#setVisible(b45ddcbc8423892c).(false); |
| 329 | resizecxx . . $ QWidget#resize(3e454b8ccf442868).(widthcxx . . $ QWidget#width(455f465bc33b4cdf).(), sizeHintcxx . . $ QDialog#sizeHint(4b3b776e5ee2b367).().heightcxx . . $ QSize#height(ea6fe5115c70a13f).()); |
| 330 | layoutcxx . . $ QWidget#layout(5761b17781c20cfb).()->setSizeConstraintcxx . . $ QLayout#setSizeConstraint(2d278d641bf12a66).(QLayoutcxx . . $ QLayout#::SetMaximumSizecxx . . $ QLayout#SetMaximumSize.); |
| 331 | } |
| 332 | } |