| 1 | #cxx . . $ `<file>/src/GotoDialog.cpp`/include "GotoDialog.h"cxx . . $ `<file>/src/GotoDialog.h`/ |
| 2 | #include "DebugSession.h"cxx . . $ `<file>/src/DebugSession.h`/ |
| 3 | #include "Convert.h"cxx . . $ `<file>/src/Convert.h`/ |
| 4 | #include <QCompleter> |
| 5 | |
| 6 | |
| 7 | GotoDialogcxx . . $ GotoDialog#::GotoDialogcxx . . $ GotoDialog#GotoDialog(a86688e3edaebbf8).(const MemoryLayoutcxx . . $ MemoryLayout#& ml, DebugSessioncxx . . $ DebugSession# *session, QWidgetcxx . . $ QWidget#* parent) |
| 8 | : QDialogcxx . . $ QDialog#QDialog(872e7b0c281abd8d).(parent), memLayoutcxx . . $ GotoDialog#memLayout.(ml), currentSymbolcxx . . $ GotoDialog#currentSymbol.(nullptr) |
| 9 | { |
| 10 | setupUicxx . . $ Ui_GotoDialog#setupUi(d194de0c0f68c28b).(this); |
| 11 | |
| 12 | debugSessioncxx . . $ GotoDialog#debugSession. = session; |
| 13 | if (session) { |
| 14 | // create address completer |
| 15 | auto* completer = new QCompletercxx . . $ QCompleter#QCompleter(f146e190c259bfe8).(session->symbolTablecxx . . $ DebugSession#symbolTable(2a4b6678dec31d42).().labelListcxx . . $ SymbolTable#labelList(cfa6acfd8fe17c4a).(true, &ml), this); |
| 16 | completer->setCaseSensitivitycxx . . $ QCompleter#setCaseSensitivity(dbd87adfa24451df).(Qtcxx . . $ Qt/::CaseInsensitivecxx . . $ Qt/CaseInsensitive.); |
| 17 | edtAddresscxx . . $ Ui_GotoDialog#edtAddress.->setCompletercxx . . $ QLineEdit#setCompleter(638321c80ff6aea).(completer); |
| 18 | connectcxx . . $ QObject#connect(835f87066c895669).(completer, qOverloadcxx . . $ qOverload.<const QStringcxx . . $ QString#&>(cxx . . $ QNonConstOverload#`operator()`(a8f97e06674de5d1).&QCompletercxx . . $ QCompleter#::activatedcxx . . $ QCompleter#activated(3520e46b33348bf6).), this, &GotoDialogcxx . . $ GotoDialog#::addressChangedcxx . . $ GotoDialog#addressChanged(3520e46b33348bf6).); |
| 19 | } |
| 20 | |
| 21 | connectcxx . . $ QObject#connect(835f87066c895669).(edtAddresscxx . . $ Ui_GotoDialog#edtAddress., &QLineEditcxx . . $ QLineEdit#::textEditedcxx . . $ QLineEdit#textEdited(3520e46b33348bf6)., this, &GotoDialogcxx . . $ GotoDialog#::addressChangedcxx . . $ GotoDialog#addressChanged(3520e46b33348bf6).); |
| 22 | } |
| 23 | |
| 24 | stdcxx . . $ std/::optionalcxx . . $ std/optional#<uint16_tcxx . . $ uint16_t#> GotoDialogcxx . . $ GotoDialog#::addresscxx . . $ GotoDialog#address(e9c9eb48743117a8).() |
| 25 | { |
| 26 | return currentSymbolcxx . . $ std/optional#optional(a2a857736dc5363f). ? currentSymbolcxx . . $ std/optional#optional(e3f0d6382bd52f24).->valuecxx . . $ Symbol#value(455f465bc33b4cdf).() |
| 27 | : stringToValuecxx . . $ stringToValue(e8c2a6ba39be27fd).<int>(edtAddresscxx . . $ Ui_GotoDialog#edtAddress.->textcxx . . $ QLineEdit#text(6ef7b6c27b00b43d).()); |
| 28 | } |
| 29 | |
| 30 | void GotoDialogcxx . . $ GotoDialog#::addressChangedcxx . . $ GotoDialog#addressChanged(3520e46b33348bf6).(const QStringcxx . . $ QString#& text) |
| 31 | { |
| 32 | auto addr = stringToValuecxx . . $ stringToValue(e8c2a6ba39be27fd).<uint16_tcxx . . $ uint16_t#>(text); |
| 33 | |
| 34 | if (!text.isEmptycxx . . $ QString#isEmpty(50ce9a9e25b4a850).() && !addr && debugSessioncxx . . $ GotoDialog#debugSession.) { |
| 35 | // try finding a label |
| 36 | currentSymbolcxx . . $ GotoDialog#currentSymbol. = debugSessioncxx . . $ GotoDialog#debugSession.->symbolTablecxx . . $ DebugSession#symbolTable(2a4b6678dec31d42).().getAddressSymbolcxx . . $ SymbolTable#getAddressSymbol(3ca1c26422e5e6a6).(text); |
| 37 | if (!currentSymbolcxx . . $ GotoDialog#currentSymbol.) currentSymbolcxx . . $ GotoDialog#currentSymbol. = debugSessioncxx . . $ GotoDialog#debugSession.->symbolTablecxx . . $ DebugSession#symbolTable(2a4b6678dec31d42).().getAddressSymbolcxx . . $ SymbolTable#getAddressSymbol(3ca1c26422e5e6a6).(text, Qtcxx . . $ Qt/::CaseInsensitivecxx . . $ Qt/CaseInsensitive.); |
| 38 | if (currentSymbolcxx . . $ GotoDialog#currentSymbol.) addr =cxx . . $ std/optional#`operator=`(4ce4dd0ee161fed). currentSymbolcxx . . $ GotoDialog#currentSymbol.->valuecxx . . $ Symbol#value(455f465bc33b4cdf).(); |
| 39 | } |
| 40 | |
| 41 | QPalettecxx . . $ QPalette# palcxx . . $ QPalette#QPalette(49f6e7a06ebc5aa8).; |
| 42 | pal.setColorcxx . . $ QPalette#setColor(4fd5272df43acd68).(QPalettecxx . . $ QPalette#::Textcxx . . $ QPalette#Text., addrcxx . . $ QColor#QColor(408ec4d5924bfb00). ? Qtcxx . . $ Qt/::blackcxx . . $ Qt/black. : Qtcxx . . $ Qt/::redcxx . . $ Qt/red.); |
| 43 | edtAddresscxx . . $ Ui_GotoDialog#edtAddress.->setPalettecxx . . $ QWidget#setPalette(f826ed73d5553cd5).(pal); |
| 44 | } |