| 1 | #cxx . . $ `<file>/src/SymbolTable.cpp`/include "SymbolTable.h"cxx . . $ `<file>/src/SymbolTable.h`/ |
| 2 | #include "Settings.h"cxx . . $ `<file>/src/Settings.h`/ |
| 3 | #include "DebuggerData.h"cxx . . $ `<file>/src/DebuggerData.h`/ |
| 4 | #include <QFile> |
| 5 | #include <QTextStream> |
| 6 | #include <QStringList> |
| 7 | #include <QRegExp> |
| 8 | #include <QFileInfo> |
| 9 | #include <QXmlStreamReader> |
| 10 | #include <QXmlStreamWriter> |
| 11 | #include <QMap> |
| 12 | #include <algorithm> |
| 13 | #include <cassert> |
| 14 | #include <memory> |
| 15 | #include <optional> |
| 16 | |
| 17 | // class SymbolTable |
| 18 | |
| 19 | SymbolTablecxx . . $ SymbolTable#::SymbolTablecxx . . $ SymbolTable#SymbolTable(49f6e7a06ebc5aa8).() |
| 20 | { |
| 21 | connectcxx . . $ QObject#connect(835f87066c895669).(&fileWatchercxx . . $ SymbolTable#fileWatcher., &QFileSystemWatchercxx . . $ QFileSystemWatcher#::fileChangedcxx . . $ QFileSystemWatcher#fileChanged(528016a8eccd01b8)., |
| 22 | this, &SymbolTablecxx . . $ SymbolTable#::fileChangedcxx . . $ SymbolTable#fileChanged(3520e46b33348bf6).); |
| 23 | } |
| 24 | |
| 25 | Symbolcxx . . $ Symbol#* SymbolTablecxx . . $ SymbolTable#::addcxx . . $ SymbolTable#add(c241dcc49dd75ec1).(stdcxx . . $ std/::unique_ptrcxx . . $ std/unique_ptr#<Symbolcxx . . $ Symbol#> symbol) |
| 26 | { |
| 27 | auto* p = symbol.getcxx . . $ std/unique_ptr#get(ea7391e9eeeaf20e).(); |
| 28 | symbolscxx . . $ SymbolTable#symbols..push_backcxx . . $ std/vector#push_back(fe7a8a4d1eddb70).(stdcxx . . $ std/::movecxx . . $ std/move(e35c19a1ba7baa26).(symbol)); |
| 29 | p->tablecxx . . $ Symbol#table. = this; |
| 30 | mapSymbolcxx . . $ SymbolTable#mapSymbol(e1770879d1475328).(p); |
| 31 | return p; |
| 32 | } |
| 33 | |
| 34 | stdcxx . . $ std/::unique_ptrcxx . . $ std/unique_ptr#<Symbolcxx . . $ Symbol#> SymbolTablecxx . . $ SymbolTable#::removeAtcxx . . $ SymbolTable#removeAt(50138e977a8c09a7).(size_t index) |
| 35 | { |
| 36 | assertcxx . . $ `/usr/include/assert.h:102:11`!(index < symbols.size()); |
| 37 | auto symbol = stdcxx . . $ std/unique_ptr#unique_ptr(d6762fce684538e4).::movecxx . . $ std/move(e35c19a1ba7baa26).(symbolscxx . . $ SymbolTable#symbols.[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).index]); |
| 38 | symbolscxx . . $ SymbolTable#symbols..erasecxx . . $ std/vector#erase(351407f384f345bc).(symbolscxx . . $ __gnu_cxx/__normal_iterator#__normal_iterator(459a7e7b9fbe7640)..begincxx . . $ std/vector#begin(55a6de06420d4903).() +cxx . . $ __gnu_cxx/__normal_iterator#operator+(192bf940fa7bb3b2). index); // TODO optimize: swap with back(), then pop_back() |
| 39 | unmapSymbolcxx . . $ SymbolTable#unmapSymbol(e1770879d1475328).(symbol.getcxx . . $ std/unique_ptr#get(ea7391e9eeeaf20e).()); |
| 40 | return symbolcxx . . $ std/unique_ptr#unique_ptr(d6762fce684538e4).; |
| 41 | } |
| 42 | |
| 43 | stdcxx . . $ std/::unique_ptrcxx . . $ std/unique_ptr#<Symbolcxx . . $ Symbol#> SymbolTablecxx . . $ SymbolTable#::removecxx . . $ SymbolTable#remove(de12313ba27c44a5).(Symbolcxx . . $ Symbol#* symbol) |
| 44 | { |
| 45 | auto it = stdcxx . . $ std/::find_ifcxx . . $ std/find_if(f0a0a4f94ee5cb00).(symbolscxx . . $ SymbolTable#symbols..begincxx . . $ std/vector#begin(55a6de06420d4903).(), symbolscxx . . $ SymbolTable#symbols..endcxx . . $ std/vector#end(55a6de06420d4903).(), |
| 46 | [&](auto& e) { return e.get() ==cxx . . $ `operator==`(c658459fbfebdd4a). symbol; }); |
| 47 | if (it ==cxx . . $ __gnu_cxx/`operator==`(30ee64f2df4eef8b). symbolscxx . . $ SymbolTable#symbols..endcxx . . $ std/vector#end(55a6de06420d4903).()) return {cxx . . $ std/unique_ptr#unique_ptr(ced63f7c635d850d).}; |
| 48 | |
| 49 | return removeAtcxx . . $ SymbolTable#removeAt(50138e977a8c09a7).(stdcxx . . $ std/::distancecxx . . $ std/distance(4883b9d540cf40e9).(symbolscxx . . $ SymbolTable#symbols..begincxx . . $ std/vector#begin(55a6de06420d4903).(), it)); |
| 50 | } |
| 51 | |
| 52 | void SymbolTablecxx . . $ SymbolTable#::clearcxx . . $ SymbolTable#clear(49f6e7a06ebc5aa8).() |
| 53 | { |
| 54 | addressSymbolscxx . . $ SymbolTable#addressSymbols..clearcxx . . $ QMap#clear(49f6e7a06ebc5aa8).(); |
| 55 | valueSymbolscxx . . $ SymbolTable#valueSymbols..clearcxx . . $ QHash#clear(49f6e7a06ebc5aa8).(); |
| 56 | symbolscxx . . $ SymbolTable#symbols..clearcxx . . $ std/vector#clear(ced63f7c635d850d).(); |
| 57 | } |
| 58 | |
| 59 | int SymbolTablecxx . . $ SymbolTable#::sizecxx . . $ SymbolTable#size(455f465bc33b4cdf).() const |
| 60 | { |
| 61 | return symbolscxx . . $ SymbolTable#symbols..sizecxx . . $ std/vector#size(c9b1e749b64d5edc).(); |
| 62 | } |
| 63 | |
| 64 | void SymbolTablecxx . . $ SymbolTable#::mapSymbolcxx . . $ SymbolTable#mapSymbol(e1770879d1475328).(Symbolcxx . . $ Symbol#* symbol) |
| 65 | { |
| 66 | if (symbol->typecxx . . $ Symbol#type(4ac61bd11a1ab7d9).() != Symbolcxx . . $ Symbol#::VALUEcxx . . $ Symbol#VALUE.) { |
| 67 | addressSymbolscxx . . $ SymbolTable#addressSymbols..insertcxx . . $ QMultiMap#insert(9bf047f9fc4d1418).(symbol->valuecxx . . $ Symbol#value(455f465bc33b4cdf).(), symbol); |
| 68 | } |
| 69 | if (symbol->typecxx . . $ Symbol#type(4ac61bd11a1ab7d9).() != Symbolcxx . . $ Symbol#::JUMPLABELcxx . . $ Symbol#JUMPLABEL.) { |
| 70 | valueSymbolscxx . . $ SymbolTable#valueSymbols..insertcxx . . $ QMultiHash#insert(5109cbe2e8d37d61).(symbol->valuecxx . . $ Symbol#value(455f465bc33b4cdf).(), symbol); |
| 71 | } |
| 72 | } |
| 73 | |
| 74 | void SymbolTablecxx . . $ SymbolTable#::unmapSymbolcxx . . $ SymbolTable#unmapSymbol(e1770879d1475328).(Symbolcxx . . $ Symbol#* symbol) |
| 75 | { |
| 76 | QMutableMapIteratorcxx . . $ QMutableMapIterator#<int, Symbolcxx . . $ Symbol#*> icxx . . $ QMutableMapIterator#QMutableMapIterator(881fa6995fc49359).(addressSymbolscxx . . $ SymbolTable#addressSymbols.); |
| 77 | while (i.hasNextcxx . . $ QMutableMapIterator#hasNext(50ce9a9e25b4a850).()) { |
| 78 | i.nextcxx . . $ QMutableMapIterator#next(18bea9d7d3fabb8c).(); |
| 79 | if (i.valuecxx . . $ QMutableMapIterator#value(bef0f7a998e0139b).() == symbol) i.removecxx . . $ QMutableMapIterator#remove(49f6e7a06ebc5aa8).(); |
| 80 | } |
| 81 | QMutableHashIteratorcxx . . $ QMutableHashIterator#<int, Symbolcxx . . $ Symbol#*> jcxx . . $ QMutableHashIterator#QMutableHashIterator(741506ea78829a07).(valueSymbolscxx . . $ SymbolTable#valueSymbols.); |
| 82 | while (j.hasNextcxx . . $ QMutableHashIterator#hasNext(50ce9a9e25b4a850).()) { |
| 83 | j.nextcxx . . $ QMutableHashIterator#next(dec9d5a4887d188d).(); |
| 84 | if (j.valuecxx . . $ QMutableHashIterator#value(bef0f7a998e0139b).() == symbol) j.removecxx . . $ QMutableHashIterator#remove(49f6e7a06ebc5aa8).(); |
| 85 | } |
| 86 | } |
| 87 | |
| 88 | void SymbolTablecxx . . $ SymbolTable#::symbolTypeChangedcxx . . $ SymbolTable#symbolTypeChanged(e1770879d1475328).(Symbolcxx . . $ Symbol#* symbol) |
| 89 | { |
| 90 | unmapSymbolcxx . . $ SymbolTable#unmapSymbol(e1770879d1475328).(symbol); |
| 91 | mapSymbolcxx . . $ SymbolTable#mapSymbol(e1770879d1475328).(symbol); |
| 92 | } |
| 93 | |
| 94 | void SymbolTablecxx . . $ SymbolTable#::symbolValueChangedcxx . . $ SymbolTable#symbolValueChanged(e1770879d1475328).(Symbolcxx . . $ Symbol#* symbol) |
| 95 | { |
| 96 | unmapSymbolcxx . . $ SymbolTable#unmapSymbol(e1770879d1475328).(symbol); |
| 97 | mapSymbolcxx . . $ SymbolTable#mapSymbol(e1770879d1475328).(symbol); |
| 98 | } |
| 99 | |
| 100 | Symbolcxx . . $ Symbol#* SymbolTablecxx . . $ SymbolTable#::findFirstAddressSymbolcxx . . $ SymbolTable#findFirstAddressSymbol(6425489d2f72da67).(int addr, MemoryLayoutcxx . . $ MemoryLayout#* ml) |
| 101 | { |
| 102 | for (currentAddresscxx . . $ SymbolTable#currentAddress. =cxx . . $ QMap#iterator#`operator=`(d5f17f153d4e0569). addressSymbolscxx . . $ SymbolTable#addressSymbols..begincxx . . $ QMap#begin(2d49d7eeb2586d1c).(); |
| 103 | currentAddresscxx . . $ SymbolTable#currentAddress. !=cxx . . $ QMap#iterator#`operator!=`(8a5a4c9a0d42c534). addressSymbolscxx . . $ SymbolTable#addressSymbols..endcxx . . $ QMap#end(2d49d7eeb2586d1c).(); ++cxx . . $ QMap#iterator#operator++(a0bd0c31b18c8d80).currentAddresscxx . . $ SymbolTable#currentAddress.) { |
| 104 | if ((*cxx . . $ QMap#iterator#`operator*`(51f62fb05f27f6a2).currentAddresscxx . . $ SymbolTable#currentAddress.)->valuecxx . . $ Symbol#value(455f465bc33b4cdf).() >= addr) { |
| 105 | if ((*cxx . . $ QMap#iterator#`operator*`(51f62fb05f27f6a2).currentAddresscxx . . $ SymbolTable#currentAddress.)->isSlotValidcxx . . $ Symbol#isSlotValid(6c1b4f50bcd5f0fa).(ml)) { |
| 106 | return *cxx . . $ QMap#iterator#`operator*`(51f62fb05f27f6a2).currentAddresscxx . . $ SymbolTable#currentAddress.; |
| 107 | } |
| 108 | } |
| 109 | } |
| 110 | return nullptr; |
| 111 | } |
| 112 | |
| 113 | Symbolcxx . . $ Symbol#* SymbolTablecxx . . $ SymbolTable#::getCurrentAddressSymbolcxx . . $ SymbolTable#getCurrentAddressSymbol(5476d8503598437c).() |
| 114 | { |
| 115 | return currentAddresscxx . . $ SymbolTable#currentAddress. !=cxx . . $ QMap#iterator#`operator!=`(8a5a4c9a0d42c534). addressSymbolscxx . . $ SymbolTable#addressSymbols..endcxx . . $ QMap#end(2d49d7eeb2586d1c).() ? *cxx . . $ QMap#iterator#`operator*`(51f62fb05f27f6a2).currentAddresscxx . . $ SymbolTable#currentAddress. : nullptr; |
| 116 | } |
| 117 | |
| 118 | Symbolcxx . . $ Symbol#* SymbolTablecxx . . $ SymbolTable#::findNextAddressSymbolcxx . . $ SymbolTable#findNextAddressSymbol(fd05edddcc119593).(MemoryLayoutcxx . . $ MemoryLayout#* ml) |
| 119 | { |
| 120 | for (++cxx . . $ QMap#iterator#operator++(a0bd0c31b18c8d80).currentAddresscxx . . $ SymbolTable#currentAddress.; currentAddresscxx . . $ SymbolTable#currentAddress. !=cxx . . $ QMap#iterator#`operator!=`(8a5a4c9a0d42c534). addressSymbolscxx . . $ SymbolTable#addressSymbols..endcxx . . $ QMap#end(2d49d7eeb2586d1c).(); |
| 121 | ++cxx . . $ QMap#iterator#operator++(a0bd0c31b18c8d80).currentAddresscxx . . $ SymbolTable#currentAddress.) { |
| 122 | if ((*cxx . . $ QMap#iterator#`operator*`(51f62fb05f27f6a2).currentAddresscxx . . $ SymbolTable#currentAddress.)->isSlotValidcxx . . $ Symbol#isSlotValid(6c1b4f50bcd5f0fa).(ml)) { |
| 123 | return *cxx . . $ QMap#iterator#`operator*`(51f62fb05f27f6a2).currentAddresscxx . . $ SymbolTable#currentAddress.; |
| 124 | } |
| 125 | } |
| 126 | return nullptr; |
| 127 | } |
| 128 | |
| 129 | Symbolcxx . . $ Symbol#* SymbolTablecxx . . $ SymbolTable#::getValueSymbolcxx . . $ SymbolTable#getValueSymbol(e2ed6cd7c93c4d8e).(int val, Symbolcxx . . $ Symbol#::Registercxx . . $ Symbol#Register# reg, MemoryLayoutcxx . . $ MemoryLayout#* ml) |
| 130 | { |
| 131 | for (auto it = valueSymbolscxx . . $ SymbolTable#valueSymbols..findcxx . . $ QHash#find(1cadc8f6e24105ba).(val); it !=cxx . . $ QHash#iterator#`operator!=`(d41b528a217b928). valueSymbolscxx . . $ SymbolTable#valueSymbols..endcxx . . $ QHash#end(7fee0616348ed702).() && it.keycxx . . $ QHash#iterator#key(ea465e50d690edfe).() == val; ++cxx . . $ QHash#iterator#operator++(61354937c9e9ad6b).it) { |
| 132 | if ((it.valuecxx . . $ QHash#iterator#value(51f62fb05f27f6a2).()->validRegisterscxx . . $ Symbol#validRegisters(455f465bc33b4cdf).() & reg) && |
| 133 | it.valuecxx . . $ QHash#iterator#value(51f62fb05f27f6a2).()->isSlotValidcxx . . $ Symbol#isSlotValid(6c1b4f50bcd5f0fa).(ml)) { |
| 134 | return it.valuecxx . . $ QHash#iterator#value(51f62fb05f27f6a2).(); |
| 135 | } |
| 136 | } |
| 137 | return nullptr; |
| 138 | } |
| 139 | |
| 140 | Symbolcxx . . $ Symbol#* SymbolTablecxx . . $ SymbolTable#::getAddressSymbolcxx . . $ SymbolTable#getAddressSymbol(6425489d2f72da67).(int addr, MemoryLayoutcxx . . $ MemoryLayout#* ml) |
| 141 | { |
| 142 | for (auto it = addressSymbolscxx . . $ SymbolTable#addressSymbols..findcxx . . $ QMap#find(9e2276816f28e801).(addr); it !=cxx . . $ QMap#iterator#`operator!=`(8a5a4c9a0d42c534). addressSymbolscxx . . $ SymbolTable#addressSymbols..endcxx . . $ QMap#end(2d49d7eeb2586d1c).() && it.keycxx . . $ QMap#iterator#key(ea465e50d690edfe).() == addr; ++cxx . . $ QMap#iterator#operator++(a0bd0c31b18c8d80).it) { |
| 143 | if (it.valuecxx . . $ QMap#iterator#value(51f62fb05f27f6a2).()->isSlotValidcxx . . $ Symbol#isSlotValid(6c1b4f50bcd5f0fa).(ml)) { |
| 144 | return it.valuecxx . . $ QMap#iterator#value(51f62fb05f27f6a2).(); |
| 145 | } |
| 146 | } |
| 147 | return nullptr; |
| 148 | } |
| 149 | |
| 150 | Symbolcxx . . $ Symbol#* SymbolTablecxx . . $ SymbolTable#::getAddressSymbolcxx . . $ SymbolTable#getAddressSymbol(3ca1c26422e5e6a6).(const QStringcxx . . $ QString#& label, bool case_sensitive) |
| 151 | { |
| 152 | for (auto it = addressSymbolscxx . . $ SymbolTable#addressSymbols..begincxx . . $ QMap#begin(2d49d7eeb2586d1c).(); it !=cxx . . $ QMap#iterator#`operator!=`(8a5a4c9a0d42c534). addressSymbolscxx . . $ SymbolTable#addressSymbols..endcxx . . $ QMap#end(2d49d7eeb2586d1c).(); ++cxx . . $ QMap#iterator#operator++(a0bd0c31b18c8d80).it) { |
| 153 | if (it.valuecxx . . $ QMap#iterator#value(51f62fb05f27f6a2).()->textcxx . . $ Symbol#text(a2fb7a6ce195d51).().comparecxx . . $ QString#compare(c6f75f9b1a93e019).(label, Qtcxx . . $ Qt/::CaseSensitivecxx . . $ Qt/CaseSensitive.)==0) |
| 154 | return it.valuecxx . . $ QMap#iterator#value(51f62fb05f27f6a2).(); |
| 155 | if (!case_sensitive && it.valuecxx . . $ QMap#iterator#value(51f62fb05f27f6a2).()->textcxx . . $ Symbol#text(a2fb7a6ce195d51).().comparecxx . . $ QString#compare(c6f75f9b1a93e019).(label, Qtcxx . . $ Qt/::CaseInsensitivecxx . . $ Qt/CaseInsensitive.)==0) |
| 156 | return it.valuecxx . . $ QMap#iterator#value(51f62fb05f27f6a2).(); |
| 157 | } |
| 158 | return nullptr; |
| 159 | } |
| 160 | |
| 161 | QStringListcxx . . $ QStringList# SymbolTablecxx . . $ SymbolTable#::labelListcxx . . $ SymbolTable#labelList(cfa6acfd8fe17c4a).(bool include_vars, const MemoryLayoutcxx . . $ MemoryLayout#* ml) const |
| 162 | { |
| 163 | QStringListcxx . . $ QStringList# labelscxx . . $ QStringList#QStringList(ced63f7c635d850d).; |
| 164 | for (auto it = addressSymbolscxx . . $ SymbolTable#addressSymbols..begincxx . . $ QMap#begin(81a977e5fd18ea74).(); it !=cxx . . $ QMap#const_iterator#`operator!=`(afb29c289d8ce2db). addressSymbolscxx . . $ SymbolTable#addressSymbols..endcxx . . $ QMap#end(81a977e5fd18ea74).(); ++cxx . . $ QMap#const_iterator#operator++(535153adf4c12c2).it) { |
| 165 | if (it.valuecxx . . $ QMap#const_iterator#value(bdbd05d619d62250).()->typecxx . . $ Symbol#type(4ac61bd11a1ab7d9).() == Symbolcxx . . $ Symbol#::JUMPLABELcxx . . $ Symbol#JUMPLABEL. || (include_vars && it.valuecxx . . $ QMap#const_iterator#value(bdbd05d619d62250).()->typecxx . . $ Symbol#type(4ac61bd11a1ab7d9).() == Symbolcxx . . $ Symbol#::VARIABLELABELcxx . . $ Symbol#VARIABLELABEL.)) { |
| 166 | if (ml == nullptr || it.valuecxx . . $ QMap#const_iterator#value(bdbd05d619d62250).()->isSlotValidcxx . . $ Symbol#isSlotValid(6c1b4f50bcd5f0fa).(ml)) { |
| 167 | labels <<cxx . . $ QStringList#`operator<<`(85116071a693d053). it.valuecxx . . $ QMap#const_iterator#value(bdbd05d619d62250).()->textcxx . . $ Symbol#text(a2fb7a6ce195d51).(); |
| 168 | } |
| 169 | } |
| 170 | } |
| 171 | return labels; |
| 172 | } |
| 173 | |
| 174 | int SymbolTablecxx . . $ SymbolTable#::symbolFilesSizecxx . . $ SymbolTable#symbolFilesSize(455f465bc33b4cdf).() const |
| 175 | { |
| 176 | return symbolFilescxx . . $ SymbolTable#symbolFiles..sizecxx . . $ QList#size(ea6fe5115c70a13f).(); |
| 177 | } |
| 178 | |
| 179 | const QStringcxx . . $ QString#& SymbolTablecxx . . $ SymbolTable#::symbolFilecxx . . $ SymbolTable#symbolFile(16cc9d170214b96a).(int index) const |
| 180 | { |
| 181 | return symbolFilescxx . . $ SymbolTable#symbolFiles..atcxx . . $ QList#at(e2681f9bb6b2f357).(index).fileNamecxx . . $ SymbolTable#SymbolFileRecord#fileName.; |
| 182 | } |
| 183 | |
| 184 | const QDateTimecxx . . $ QDateTime#& SymbolTablecxx . . $ SymbolTable#::symbolFileRefreshcxx . . $ SymbolTable#symbolFileRefresh(8d59ec49d27552dc).(int index) const |
| 185 | { |
| 186 | return symbolFilescxx . . $ SymbolTable#symbolFiles..atcxx . . $ QList#at(e2681f9bb6b2f357).(index).refreshTimecxx . . $ SymbolTable#SymbolFileRecord#refreshTime.; |
| 187 | } |
| 188 | |
| 189 | bool SymbolTablecxx . . $ SymbolTable#::readFilecxx . . $ SymbolTable#readFile(a6376190b25aca40).(const QStringcxx . . $ QString#& filename, FileTypecxx . . $ SymbolTable#FileType# type) |
| 190 | { |
| 191 | QStringcxx . . $ QString# fname = filename.toLowercxx . . $ QString#toLower(dca2c5857e9adf82).(); |
| 192 | |
| 193 | if (type == DETECT_FILEcxx . . $ SymbolTable#DETECT_FILE.) { |
| 194 | if (fname.endsWithcxx . . $ QString#endsWith(8cce4688c16f48f3).(".omds"cxx . . $ QString#QString(85c52e162fed56f9).)) { |
| 195 | // OpenMSX Debugger session file |
| 196 | type = OMDS_FILEcxx . . $ SymbolTable#OMDS_FILE.; |
| 197 | } else if (fname.endsWithcxx . . $ QString#endsWith(8cce4688c16f48f3).(".noi"cxx . . $ QString#QString(85c52e162fed56f9).)) { |
| 198 | // NoICE command file |
| 199 | type = NOICE_FILEcxx . . $ SymbolTable#NOICE_FILE.; |
| 200 | } else if (fname.endsWithcxx . . $ QString#endsWith(8cce4688c16f48f3).(".map"cxx . . $ QString#QString(85c52e162fed56f9).)) { |
| 201 | // HiTech link map file |
| 202 | type = LINKMAP_FILEcxx . . $ SymbolTable#LINKMAP_FILE.; |
| 203 | } else if (fname.endsWithcxx . . $ QString#endsWith(8cce4688c16f48f3).(".sym"cxx . . $ QString#QString(85c52e162fed56f9).)) { |
| 204 | // auto detect which sym file |
| 205 | QFilecxx . . $ QFile# filecxx . . $ QFile#QFile(3520e46b33348bf6).(filename); |
| 206 | if (file.opencxx . . $ QFile#open(dca164408be960c8).(QIODevicecxx . . $ QIODevice#::ReadOnlycxx . . $ QIODevice#ReadOnly. |cxx . . $ `operator|`(c9e45f682471e48d). QIODevicecxx . . $ QIODevice#::Textcxx . . $ QIODevice#Text.)) { |
| 207 | QTextStreamcxx . . $ QTextStream# incxx . . $ QTextStream#QTextStream(bebe8f2dee7f9e86).(&file); |
| 208 | QStringcxx . . $ QString# line = in.readLinecxx . . $ QTextStream#readLine(20e0a2766677f583).(); |
| 209 | if (line[cxx . . $ QString#`operator[]`(57436120916eb52c).0] ==cxx . . $ `operator==`(a468b2f18a3afe8). ';'cxx . . $ QChar#QChar(f349c77f591a7878).) { |
| 210 | type = ASMSX_FILEcxx . . $ SymbolTable#ASMSX_FILE.; |
| 211 | } else if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).("; last def. pass"cxx . . $ QString#QString(85c52e162fed56f9).)) { |
| 212 | type = TNIASM0_FILEcxx . . $ SymbolTable#TNIASM0_FILE.; |
| 213 | } else if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).(": %equ "cxx . . $ QString#QString(85c52e162fed56f9).)) { |
| 214 | type = TNIASM1_FILEcxx . . $ SymbolTable#TNIASM1_FILE.; |
| 215 | } else if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).(": equ "cxx . . $ QString#QString(85c52e162fed56f9)., Qtcxx . . $ Qt/::CaseInsensitivecxx . . $ Qt/CaseInsensitive.)) { |
| 216 | type = SJASM_FILEcxx . . $ SymbolTable#SJASM_FILE.; |
| 217 | } else if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).("Sections:"cxx . . $ QString#QString(85c52e162fed56f9)., Qtcxx . . $ Qt/::CaseInsensitivecxx . . $ Qt/CaseInsensitive.)) { |
| 218 | type = VASM_FILEcxx . . $ SymbolTable#VASM_FILE.; |
| 219 | } else { |
| 220 | // this is a blunt conclusion but I |
| 221 | // don't know a way to detect this file |
| 222 | // type |
| 223 | type = HTC_FILEcxx . . $ SymbolTable#HTC_FILE.; |
| 224 | } |
| 225 | } |
| 226 | } else if (fname.endsWithcxx . . $ QString#endsWith(8cce4688c16f48f3).(".symbol"cxx . . $ QString#QString(85c52e162fed56f9).) || fname.endsWithcxx . . $ QString#endsWith(8cce4688c16f48f3).(".publics"cxx . . $ QString#QString(85c52e162fed56f9).) || fname.endsWithcxx . . $ QString#endsWith(8cce4688c16f48f3).(".sys"cxx . . $ QString#QString(85c52e162fed56f9).)) { |
| 227 | /* They are the same type of file. For some reason the Debian |
| 228 | * manpage uses the extension ".sys" |
| 229 | * pasmo doc -> pasmo [options] file.asm file.bin [file.symbol [file.publics] ] |
| 230 | * pasmo manpage in Debian -> pasmo [options] file.asm file.bin [file.sys] |
| 231 | */ |
| 232 | type = PASMO_FILEcxx . . $ SymbolTable#PASMO_FILE.; |
| 233 | } |
| 234 | } |
| 235 | switch (type) { |
| 236 | case OMDS_FILEcxx . . $ SymbolTable#OMDS_FILE.: |
| 237 | return readOMDSFilecxx . . $ SymbolTable#readOMDSFile(e1defb592416720d).(filename); |
| 238 | case TNIASM0_FILEcxx . . $ SymbolTable#TNIASM0_FILE.: |
| 239 | return readTNIASM0Filecxx . . $ SymbolTable#readTNIASM0File(e1defb592416720d).(filename); |
| 240 | case TNIASM1_FILEcxx . . $ SymbolTable#TNIASM1_FILE.: |
| 241 | return readTNIASM1Filecxx . . $ SymbolTable#readTNIASM1File(e1defb592416720d).(filename); |
| 242 | case SJASM_FILEcxx . . $ SymbolTable#SJASM_FILE.: |
| 243 | return readSJASMFilecxx . . $ SymbolTable#readSJASMFile(e1defb592416720d).(filename); |
| 244 | case ASMSX_FILEcxx . . $ SymbolTable#ASMSX_FILE.: |
| 245 | return readASMSXFilecxx . . $ SymbolTable#readASMSXFile(e1defb592416720d).(filename); |
| 246 | case HTC_FILEcxx . . $ SymbolTable#HTC_FILE.: |
| 247 | return readHTCFilecxx . . $ SymbolTable#readHTCFile(e1defb592416720d).(filename); |
| 248 | case LINKMAP_FILEcxx . . $ SymbolTable#LINKMAP_FILE.: |
| 249 | return readLinkMapFilecxx . . $ SymbolTable#readLinkMapFile(e1defb592416720d).(filename); |
| 250 | case NOICE_FILEcxx . . $ SymbolTable#NOICE_FILE.: |
| 251 | return readNoICEFilecxx . . $ SymbolTable#readNoICEFile(e1defb592416720d).(filename); |
| 252 | case PASMO_FILEcxx . . $ SymbolTable#PASMO_FILE.: |
| 253 | return readPASMOFilecxx . . $ SymbolTable#readPASMOFile(e1defb592416720d).(filename); |
| 254 | case VASM_FILEcxx . . $ SymbolTable#VASM_FILE.: |
| 255 | return readVASMFilecxx . . $ SymbolTable#readVASMFile(e1defb592416720d).(filename); |
| 256 | default: |
| 257 | return false; |
| 258 | } |
| 259 | } |
| 260 | |
| 261 | void SymbolTablecxx . . $ SymbolTable#::appendFilecxx . . $ SymbolTable#appendFile(99acc5e4b40ab5b2).(const QStringcxx . . $ QString#& file, FileTypecxx . . $ SymbolTable#FileType# type) |
| 262 | { |
| 263 | SymbolFileRecordcxx . . $ SymbolTable#SymbolFileRecord# rec; |
| 264 | rec.fileNamecxx . . $ SymbolTable#SymbolFileRecord#fileName. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). file; |
| 265 | rec.fileTypecxx . . $ SymbolTable#SymbolFileRecord#fileType. = type; |
| 266 | rec.refreshTimecxx . . $ SymbolTable#SymbolFileRecord#refreshTime. =cxx . . $ QDateTime#`operator=`(6dbf9ff24243cdf2). QDateTimecxx . . $ QDateTime#::currentDateTimecxx . . $ QDateTime#currentDateTime(bf5129c8228c71c0).(); |
| 267 | symbolFilescxx . . $ SymbolTable#symbolFiles..appendcxx . . $ QList#append(77d9f17553126ecb).(rec); |
| 268 | fileWatchercxx . . $ SymbolTable#fileWatcher..addPathcxx . . $ QFileSystemWatcher#addPath(e1defb592416720d).(file); |
| 269 | } |
| 270 | |
| 271 | // Universal value parsing routine. Accepts: |
| 272 | // - 0123h, 1234h, 1234H (hex) |
| 273 | // - 0x1234 (hex) |
| 274 | // - 1234 (dec) |
| 275 | // - 0123 (oct) |
| 276 | // The string may (optionally) end with a '; comment' part (with or without |
| 277 | // whitespace around the ';' character). |
| 278 | static stdcxx . . $ std/::optionalcxx . . $ std/optional#<int> parseValuecxx . . $ parseValue(3906dfdb5904369b).(const QStringcxx . . $ QString#& str) |
| 279 | { |
| 280 | QStringListcxx . . $ QStringList# l = str.splitcxx . . $ QString#split(c8b44a97dcb6200d).(";"cxx . . $ QString#QString(85c52e162fed56f9).); // ignore stuff after ';' |
| 281 | QStringcxx . . $ QString# s = l.atcxx . . $ QList#at(e2681f9bb6b2f357).(0).trimmedcxx . . $ QString#trimmed(dca2c5857e9adf82).(); |
| 282 | bool success; |
| 283 | int result; |
| 284 | if (s.endsWithcxx . . $ QString#endsWith(7cf081d1b6a1defd).('h'cxx . . $ QChar#QChar(f349c77f591a7878)., Qtcxx . . $ Qt/::CaseInsensitivecxx . . $ Qt/CaseInsensitive.)) { |
| 285 | s.chopcxx . . $ QString#chop(d4f767463ce0a6b3).(1); |
| 286 | result = s.toIntcxx . . $ QString#toInt(d7972accae11ee1f).(&success, 16); |
| 287 | } else { |
| 288 | result = s.toIntcxx . . $ QString#toInt(d7972accae11ee1f).(&success, 0); // any base (e.g. 0x..) |
| 289 | } |
| 290 | if (success) return resultcxx . . $ std/optional#optional(e3f0d6382bd52f24).; |
| 291 | return {cxx . . $ std/optional#optional(ced63f7c635d850d).}; |
| 292 | } |
| 293 | |
| 294 | bool SymbolTablecxx . . $ SymbolTable#::readSymbolFilecxx . . $ SymbolTable#readSymbolFile(c18f5917bd38f78a).( |
| 295 | const QStringcxx . . $ QString#& filename, FileTypecxx . . $ SymbolTable#FileType# type, const QStringcxx . . $ QString#& equ) |
| 296 | { |
| 297 | QFilecxx . . $ QFile# filecxx . . $ QFile#QFile(3520e46b33348bf6).(filename); |
| 298 | if (!file.opencxx . . $ QFile#open(dca164408be960c8).(QIODevicecxx . . $ QIODevice#::ReadOnlycxx . . $ QIODevice#ReadOnly. |cxx . . $ `operator|`(c9e45f682471e48d). QIODevicecxx . . $ QIODevice#::Textcxx . . $ QIODevice#Text.)) { |
| 299 | return false; |
| 300 | } |
| 301 | |
| 302 | appendFilecxx . . $ SymbolTable#appendFile(99acc5e4b40ab5b2).(filename, type); |
| 303 | const auto* source = &symbolFilescxx . . $ SymbolTable#symbolFiles..backcxx . . $ QList#back(19b2b6f17af048b).().fileNamecxx . . $ SymbolTable#SymbolFileRecord#fileName.; |
| 304 | |
| 305 | QTextStreamcxx . . $ QTextStream# incxx . . $ QTextStream#QTextStream(bebe8f2dee7f9e86).(&file); |
| 306 | while (!in.atEndcxx . . $ QTextStream#atEnd(50ce9a9e25b4a850).()) { |
| 307 | QStringcxx . . $ QString# line = in.readLinecxx . . $ QTextStream#readLine(20e0a2766677f583).(); |
| 308 | QStringListcxx . . $ QStringList# l = line.splitcxx . . $ QString#split(c8b44a97dcb6200d).(equ, Qtcxx . . $ QFlags#QFlags(93d577a3e9528307).::SplitBehaviorFlagscxx . . $ Qt/SplitBehaviorFlags#::KeepEmptyPartscxx . . $ Qt/KeepEmptyParts., Qtcxx . . $ Qt/::CaseInsensitivecxx . . $ Qt/CaseInsensitive.); |
| 309 | if (l.sizecxx . . $ QList#size(ea6fe5115c70a13f).() != 2) continue; |
| 310 | if (auto value = parseValuecxx . . $ parseValue(3906dfdb5904369b).(l.atcxx . . $ QList#at(e2681f9bb6b2f357).(1))) { |
| 311 | addcxx . . $ SymbolTable#add(c241dcc49dd75ec1).(stdcxx . . $ std/::make_uniquecxx . . $ std/make_unique(5cd499e8540a10bb).<Symbolcxx . . $ Symbol#>(l.atcxx . . $ QList#at(e2681f9bb6b2f357).(0), *cxx . . $ std/optional#`operator*`(47e1a15210ec6306).value, source)); |
| 312 | } |
| 313 | } |
| 314 | return true; |
| 315 | } |
| 316 | bool SymbolTablecxx . . $ SymbolTable#::readOMDSFilecxx . . $ SymbolTable#readOMDSFile(e1defb592416720d).(const QStringcxx . . $ QString#& filename) |
| 317 | { |
| 318 | QFilecxx . . $ QFile# filecxx . . $ QFile#QFile(3520e46b33348bf6).(filename); |
| 319 | if (!file.opencxx . . $ QFile#open(dca164408be960c8).(QFilecxx . . $ QFile#::ReadOnlycxx . . $ QIODevice#ReadOnly. |cxx . . $ `operator|`(c9e45f682471e48d). QFilecxx . . $ QFile#::Textcxx . . $ QIODevice#Text.)) { |
| 320 | return false; |
| 321 | } |
| 322 | |
| 323 | QXmlStreamReadercxx . . $ QXmlStreamReader# sescxx . . $ QXmlStreamReader#QXmlStreamReader(49f6e7a06ebc5aa8).; |
| 324 | ses.setDevicecxx . . $ QXmlStreamReader#setDevice(bebe8f2dee7f9e86).(&file); |
| 325 | loadSymbolscxx . . $ SymbolTable#loadSymbols(e225a1e01f50193c).(ses); |
| 326 | return true; |
| 327 | } |
| 328 | bool SymbolTablecxx . . $ SymbolTable#::readTNIASM0Filecxx . . $ SymbolTable#readTNIASM0File(e1defb592416720d).(const QStringcxx . . $ QString#& filename) |
| 329 | { |
| 330 | return readSymbolFilecxx . . $ SymbolTable#readSymbolFile(c18f5917bd38f78a).(filename, TNIASM0_FILEcxx . . $ SymbolTable#TNIASM0_FILE., ": equ "cxx . . $ QString#QString(85c52e162fed56f9).); |
| 331 | } |
| 332 | bool SymbolTablecxx . . $ SymbolTable#::readTNIASM1Filecxx . . $ SymbolTable#readTNIASM1File(e1defb592416720d).(const QStringcxx . . $ QString#& filename) |
| 333 | { |
| 334 | return readSymbolFilecxx . . $ SymbolTable#readSymbolFile(c18f5917bd38f78a).(filename, TNIASM1_FILEcxx . . $ SymbolTable#TNIASM1_FILE., ": %equ "cxx . . $ QString#QString(85c52e162fed56f9).); |
| 335 | } |
| 336 | bool SymbolTablecxx . . $ SymbolTable#::readSJASMFilecxx . . $ SymbolTable#readSJASMFile(e1defb592416720d).(const QStringcxx . . $ QString#& filename) |
| 337 | { |
| 338 | return readSymbolFilecxx . . $ SymbolTable#readSymbolFile(c18f5917bd38f78a).(filename, SJASM_FILEcxx . . $ SymbolTable#SJASM_FILE., ": equ "cxx . . $ QString#QString(85c52e162fed56f9).); |
| 339 | } |
| 340 | |
| 341 | bool SymbolTablecxx . . $ SymbolTable#::readASMSXFilecxx . . $ SymbolTable#readASMSXFile(e1defb592416720d).(const QStringcxx . . $ QString#& filename) |
| 342 | { |
| 343 | QFilecxx . . $ QFile# filecxx . . $ QFile#QFile(3520e46b33348bf6).(filename); |
| 344 | if (!file.opencxx . . $ QFile#open(dca164408be960c8).(QIODevicecxx . . $ QIODevice#::ReadOnlycxx . . $ QIODevice#ReadOnly. |cxx . . $ `operator|`(c9e45f682471e48d). QIODevicecxx . . $ QIODevice#::Textcxx . . $ QIODevice#Text.)) { |
| 345 | return false; |
| 346 | } |
| 347 | |
| 348 | appendFilecxx . . $ SymbolTable#appendFile(99acc5e4b40ab5b2).(filename, ASMSX_FILEcxx . . $ SymbolTable#ASMSX_FILE.); |
| 349 | const auto* source = &symbolFilescxx . . $ SymbolTable#symbolFiles..backcxx . . $ QList#back(19b2b6f17af048b).().fileNamecxx . . $ SymbolTable#SymbolFileRecord#fileName.; |
| 350 | |
| 351 | QTextStreamcxx . . $ QTextStream# incxx . . $ QTextStream#QTextStream(bebe8f2dee7f9e86).(&file); |
| 352 | int filePart = 0; |
| 353 | while (!in.atEndcxx . . $ QTextStream#atEnd(50ce9a9e25b4a850).()) { |
| 354 | QStringcxx . . $ QString# line = in.readLinecxx . . $ QTextStream#readLine(20e0a2766677f583).(); |
| 355 | if (line[cxx . . $ QString#`operator[]`(57436120916eb52c).0] ==cxx . . $ `operator==`(a468b2f18a3afe8). ';'cxx . . $ QChar#QChar(f349c77f591a7878).) { |
| 356 | if (line.startsWithcxx . . $ QString#startsWith(8cce4688c16f48f3).("; global and local"cxx . . $ QString#QString(85c52e162fed56f9).)) { |
| 357 | filePart = 1; |
| 358 | } else if (line.startsWithcxx . . $ QString#startsWith(8cce4688c16f48f3).("; other"cxx . . $ QString#QString(85c52e162fed56f9).)) { |
| 359 | filePart = 2; |
| 360 | } |
| 361 | } else { |
| 362 | if ((line[cxx . . $ QString#`operator[]`(57436120916eb52c).0] ==cxx . . $ `operator==`(a468b2f18a3afe8). '$'cxx . . $ QChar#QChar(f349c77f591a7878).) || (line[cxx . . $ QString#`operator[]`(57436120916eb52c).4] ==cxx . . $ `operator==`(a468b2f18a3afe8). 'h'cxx . . $ QChar#QChar(f349c77f591a7878).) || |
| 363 | (line[cxx . . $ QString#`operator[]`(57436120916eb52c).5] ==cxx . . $ `operator==`(a468b2f18a3afe8). 'h'cxx . . $ QChar#QChar(f349c77f591a7878).) || (line[cxx . . $ QString#`operator[]`(57436120916eb52c).8] ==cxx . . $ `operator==`(a468b2f18a3afe8). 'h'cxx . . $ QChar#QChar(f349c77f591a7878).)) { |
| 364 | if (filePart == 1) { |
| 365 | QStringListcxx . . $ QStringList# l = line.splitcxx . . $ QString#split(c8b44a97dcb6200d).(" "cxx . . $ QString#QString(85c52e162fed56f9).); |
| 366 | stdcxx . . $ std/::unique_ptrcxx . . $ std/unique_ptr#<Symbolcxx . . $ Symbol#> symcxx . . $ std/unique_ptr#unique_ptr(ced63f7c635d850d).; |
| 367 | if (line[cxx . . $ QString#`operator[]`(57436120916eb52c).0] ==cxx . . $ `operator==`(a468b2f18a3afe8). '$'cxx . . $ QChar#QChar(f349c77f591a7878).) { |
| 368 | addcxx . . $ SymbolTable#add(c241dcc49dd75ec1).(stdcxx . . $ std/::make_uniquecxx . . $ std/make_unique(5cd499e8540a10bb).<Symbolcxx . . $ Symbol#>(l.atcxx . . $ QList#at(e2681f9bb6b2f357).(1).trimmedcxx . . $ QString#trimmed(dca2c5857e9adf82).(), l.atcxx . . $ QList#at(e2681f9bb6b2f357).(0).rightcxx . . $ QString#right(3f3c3d0e9c0eb37f).(4).toIntcxx . . $ QString#toInt(d7972accae11ee1f).(nullptr, 16), source)); |
| 369 | } else if ((line[cxx . . $ QString#`operator[]`(57436120916eb52c).4] ==cxx . . $ `operator==`(a468b2f18a3afe8). 'h'cxx . . $ QChar#QChar(f349c77f591a7878).) || (line[cxx . . $ QString#`operator[]`(57436120916eb52c).5] ==cxx . . $ `operator==`(a468b2f18a3afe8). 'h'cxx . . $ QChar#QChar(f349c77f591a7878).)) { |
| 370 | addcxx . . $ SymbolTable#add(c241dcc49dd75ec1).(stdcxx . . $ std/::make_uniquecxx . . $ std/make_unique(5cd499e8540a10bb).<Symbolcxx . . $ Symbol#>(l.atcxx . . $ QList#at(e2681f9bb6b2f357).(1).trimmedcxx . . $ QString#trimmed(dca2c5857e9adf82).(), l.atcxx . . $ QList#at(e2681f9bb6b2f357).(0).midcxx . . $ QString#mid(44b7563da18aea72).(l.atcxx . . $ QList#at(e2681f9bb6b2f357).(0).indexOfcxx . . $ QString#indexOf(75b556ba78e4903c).('h'cxx . . $ QChar#QChar(f349c77f591a7878).) - 4, 4).toIntcxx . . $ QString#toInt(d7972accae11ee1f).(nullptr, 16), source)); |
| 371 | } else { |
| 372 | QStringListcxx . . $ QStringList# n = l.atcxx . . $ QList#at(e2681f9bb6b2f357).(0).splitcxx . . $ QString#split(c8b44a97dcb6200d).(":"cxx . . $ QString#QString(85c52e162fed56f9).); // n.at(0) = MegaROM page |
| 373 | addcxx . . $ SymbolTable#add(c241dcc49dd75ec1).(stdcxx . . $ std/::make_uniquecxx . . $ std/make_unique(5cd499e8540a10bb).<Symbolcxx . . $ Symbol#>(l.atcxx . . $ QList#at(e2681f9bb6b2f357).(1).trimmedcxx . . $ QString#trimmed(dca2c5857e9adf82).(), n.atcxx . . $ QList#at(e2681f9bb6b2f357).(1).leftcxx . . $ QString#left(3f3c3d0e9c0eb37f).(4).toIntcxx . . $ QString#toInt(d7972accae11ee1f).(nullptr, 16), source)); |
| 374 | } |
| 375 | } else if (filePart == 2) { |
| 376 | // |
| 377 | } |
| 378 | } |
| 379 | } |
| 380 | } |
| 381 | return true; |
| 382 | } |
| 383 | |
| 384 | bool SymbolTablecxx . . $ SymbolTable#::readPASMOFilecxx . . $ SymbolTable#readPASMOFile(e1defb592416720d).(const QStringcxx . . $ QString#& filename) |
| 385 | { |
| 386 | QFilecxx . . $ QFile# filecxx . . $ QFile#QFile(3520e46b33348bf6).(filename); |
| 387 | if (!file.opencxx . . $ QFile#open(dca164408be960c8).(QIODevicecxx . . $ QIODevice#::ReadOnlycxx . . $ QIODevice#ReadOnly. |cxx . . $ `operator|`(c9e45f682471e48d). QIODevicecxx . . $ QIODevice#::Textcxx . . $ QIODevice#Text.)) { |
| 388 | return false; |
| 389 | } |
| 390 | appendFilecxx . . $ SymbolTable#appendFile(99acc5e4b40ab5b2).(filename, PASMO_FILEcxx . . $ SymbolTable#PASMO_FILE.); |
| 391 | const auto* source = &symbolFilescxx . . $ SymbolTable#symbolFiles..backcxx . . $ QList#back(19b2b6f17af048b).().fileNamecxx . . $ SymbolTable#SymbolFileRecord#fileName.; |
| 392 | |
| 393 | QTextStreamcxx . . $ QTextStream# incxx . . $ QTextStream#QTextStream(bebe8f2dee7f9e86).(&file); |
| 394 | while (!in.atEndcxx . . $ QTextStream#atEnd(50ce9a9e25b4a850).()) { |
| 395 | QStringcxx . . $ QString# linecxx . . $ QString#QString(ced63f7c635d850d).; |
| 396 | QStringListcxx . . $ QStringList# lcxx . . $ QStringList#QStringList(ced63f7c635d850d).; |
| 397 | line =cxx . . $ QString#`operator=`(4f35bf974e7f8568). in.readLinecxx . . $ QTextStream#readLine(20e0a2766677f583).(); |
| 398 | l =cxx . . $ QStringList#`operator=`(335bb966c1744308). line.splitcxx . . $ QString#split(1b2294238e90052a).(QRegExpcxx . . $ QRegExp#QRegExp(31e086911ff70bd0).("(\t+)|( +)"cxx . . $ QString#QString(85c52e162fed56f9).)); |
| 399 | if (l.sizecxx . . $ QList#size(ea6fe5115c70a13f).() == 3) { |
| 400 | addcxx . . $ SymbolTable#add(c241dcc49dd75ec1).(stdcxx . . $ std/::make_uniquecxx . . $ std/make_unique(5cd499e8540a10bb).<Symbolcxx . . $ Symbol#>(l.atcxx . . $ QList#at(e2681f9bb6b2f357).(0), l.atcxx . . $ QList#at(e2681f9bb6b2f357).(2).leftcxx . . $ QString#left(3f3c3d0e9c0eb37f).(5).toIntcxx . . $ QString#toInt(d7972accae11ee1f).(nullptr, 16), source)); |
| 401 | } |
| 402 | } |
| 403 | return true; |
| 404 | } |
| 405 | |
| 406 | bool SymbolTablecxx . . $ SymbolTable#::readVASMFilecxx . . $ SymbolTable#readVASMFile(e1defb592416720d).(const QStringcxx . . $ QString#& filename) { |
| 407 | QFilecxx . . $ QFile# filecxx . . $ QFile#QFile(3520e46b33348bf6).(filename); |
| 408 | if (!file.opencxx . . $ QFile#open(dca164408be960c8).(QIODevicecxx . . $ QIODevice#::ReadOnlycxx . . $ QIODevice#ReadOnly. |cxx . . $ `operator|`(c9e45f682471e48d). QIODevicecxx . . $ QIODevice#::Textcxx . . $ QIODevice#Text.)) { |
| 409 | return false; |
| 410 | } |
| 411 | appendFilecxx . . $ SymbolTable#appendFile(99acc5e4b40ab5b2).(filename, VASM_FILEcxx . . $ SymbolTable#VASM_FILE.); |
| 412 | const auto* source = &symbolFilescxx . . $ SymbolTable#symbolFiles..backcxx . . $ QList#back(19b2b6f17af048b).().fileNamecxx . . $ SymbolTable#SymbolFileRecord#fileName.; |
| 413 | |
| 414 | bool skipline = true; |
| 415 | |
| 416 | QTextStreamcxx . . $ QTextStream# incxx . . $ QTextStream#QTextStream(bebe8f2dee7f9e86).(&file); |
| 417 | while (!in.atEndcxx . . $ QTextStream#atEnd(50ce9a9e25b4a850).()) { |
| 418 | QStringcxx . . $ QString# linecxx . . $ QString#QString(ced63f7c635d850d).; |
| 419 | QStringListcxx . . $ QStringList# lcxx . . $ QStringList#QStringList(ced63f7c635d850d).; |
| 420 | line =cxx . . $ QString#`operator=`(4f35bf974e7f8568). in.readLinecxx . . $ QTextStream#readLine(20e0a2766677f583).(); |
| 421 | if (line.startsWithcxx . . $ QString#startsWith(8cce4688c16f48f3).("Symbols by value:"cxx . . $ QString#QString(85c52e162fed56f9).)) |
| 422 | skipline = false; |
| 423 | if (skipline) |
| 424 | continue; |
| 425 | l =cxx . . $ QStringList#`operator=`(335bb966c1744308). line.splitcxx . . $ QString#split(1b2294238e90052a).(QRegExpcxx . . $ QRegExp#QRegExp(31e086911ff70bd0).("(\t+)|( +)"cxx . . $ QString#QString(85c52e162fed56f9).)); |
| 426 | if (l.sizecxx . . $ QList#size(ea6fe5115c70a13f).() == 2) { |
| 427 | addcxx . . $ SymbolTable#add(c241dcc49dd75ec1).(stdcxx . . $ std/::make_uniquecxx . . $ std/make_unique(5cd499e8540a10bb).<Symbolcxx . . $ Symbol#>(l.atcxx . . $ QList#at(e2681f9bb6b2f357).(1), l.atcxx . . $ QList#at(e2681f9bb6b2f357).(0).toIntcxx . . $ QString#toInt(d7972accae11ee1f).(nullptr, 16), source)); |
| 428 | } |
| 429 | } |
| 430 | return true; |
| 431 | } |
| 432 | |
| 433 | bool SymbolTablecxx . . $ SymbolTable#::readHTCFilecxx . . $ SymbolTable#readHTCFile(e1defb592416720d).(const QStringcxx . . $ QString#& filename) |
| 434 | { |
| 435 | QFilecxx . . $ QFile# filecxx . . $ QFile#QFile(3520e46b33348bf6).(filename); |
| 436 | if (!file.opencxx . . $ QFile#open(dca164408be960c8).(QIODevicecxx . . $ QIODevice#::ReadOnlycxx . . $ QIODevice#ReadOnly. |cxx . . $ `operator|`(c9e45f682471e48d). QIODevicecxx . . $ QIODevice#::Textcxx . . $ QIODevice#Text.)) { |
| 437 | return false; |
| 438 | } |
| 439 | |
| 440 | appendFilecxx . . $ SymbolTable#appendFile(99acc5e4b40ab5b2).(filename, HTC_FILEcxx . . $ SymbolTable#HTC_FILE.); |
| 441 | const auto* source = &symbolFilescxx . . $ SymbolTable#symbolFiles..backcxx . . $ QList#back(19b2b6f17af048b).().fileNamecxx . . $ SymbolTable#SymbolFileRecord#fileName.; |
| 442 | |
| 443 | QTextStreamcxx . . $ QTextStream# incxx . . $ QTextStream#QTextStream(bebe8f2dee7f9e86).(&file); |
| 444 | while (!in.atEndcxx . . $ QTextStream#atEnd(50ce9a9e25b4a850).()) { |
| 445 | QStringcxx . . $ QString# line = in.readLinecxx . . $ QTextStream#readLine(20e0a2766677f583).(); |
| 446 | QStringListcxx . . $ QStringList# l = line.splitcxx . . $ QString#split(92030b8bf74e4227).(' 'cxx . . $ QChar#QChar(f349c77f591a7878).); |
| 447 | if (l.sizecxx . . $ QList#size(ea6fe5115c70a13f).() != 3) continue; |
| 448 | if (auto value = parseValuecxx . . $ parseValue(3906dfdb5904369b).("0x" +cxx . . $ operator+(c75c3ae4eb9af1a8). l.atcxx . . $ QList#at(e2681f9bb6b2f357).(1))) { |
| 449 | addcxx . . $ SymbolTable#add(c241dcc49dd75ec1).(stdcxx . . $ std/::make_uniquecxx . . $ std/make_unique(5cd499e8540a10bb).<Symbolcxx . . $ Symbol#>(l.atcxx . . $ QList#at(e2681f9bb6b2f357).(0), *cxx . . $ std/optional#`operator*`(47e1a15210ec6306).value, source)); |
| 450 | } |
| 451 | } |
| 452 | return true; |
| 453 | } |
| 454 | |
| 455 | bool SymbolTablecxx . . $ SymbolTable#::readNoICEFilecxx . . $ SymbolTable#readNoICEFile(e1defb592416720d).(const QStringcxx . . $ QString#& filename) |
| 456 | { |
| 457 | QFilecxx . . $ QFile# filecxx . . $ QFile#QFile(3520e46b33348bf6).(filename); |
| 458 | if (!file.opencxx . . $ QFile#open(dca164408be960c8).(QIODevicecxx . . $ QIODevice#::ReadOnlycxx . . $ QIODevice#ReadOnly. |cxx . . $ `operator|`(c9e45f682471e48d). QIODevicecxx . . $ QIODevice#::Textcxx . . $ QIODevice#Text.)) { |
| 459 | return false; |
| 460 | } |
| 461 | |
| 462 | appendFilecxx . . $ SymbolTable#appendFile(99acc5e4b40ab5b2).(filename, NOICE_FILEcxx . . $ SymbolTable#NOICE_FILE.); |
| 463 | const auto* source = &symbolFilescxx . . $ SymbolTable#symbolFiles..backcxx . . $ QList#back(19b2b6f17af048b).().fileNamecxx . . $ SymbolTable#SymbolFileRecord#fileName.; |
| 464 | |
| 465 | QTextStreamcxx . . $ QTextStream# incxx . . $ QTextStream#QTextStream(bebe8f2dee7f9e86).(&file); |
| 466 | while (!in.atEndcxx . . $ QTextStream#atEnd(50ce9a9e25b4a850).()) { |
| 467 | QStringcxx . . $ QString# line = in.readLinecxx . . $ QTextStream#readLine(20e0a2766677f583).(); |
| 468 | QStringListcxx . . $ QStringList# l = line.splitcxx . . $ QString#split(c8b44a97dcb6200d).(" "cxx . . $ QString#QString(85c52e162fed56f9)., Qtcxx . . $ QFlags#QFlags(93d577a3e9528307).::SplitBehaviorFlagscxx . . $ Qt/SplitBehaviorFlags#::KeepEmptyPartscxx . . $ Qt/KeepEmptyParts., Qtcxx . . $ Qt/::CaseInsensitivecxx . . $ Qt/CaseInsensitive.); |
| 469 | if (l.sizecxx . . $ QList#size(ea6fe5115c70a13f).() != 3) continue; |
| 470 | if (l.atcxx . . $ QList#at(e2681f9bb6b2f357).(0).toLowercxx . . $ QString#toLower(dca2c5857e9adf82).() !=cxx . . $ QString#`operator!=`(7d4bdb1abc417636). "def") continue; |
| 471 | if (auto value = parseValuecxx . . $ parseValue(3906dfdb5904369b).(l.atcxx . . $ QList#at(e2681f9bb6b2f357).(2))) { |
| 472 | addcxx . . $ SymbolTable#add(c241dcc49dd75ec1).(stdcxx . . $ std/::make_uniquecxx . . $ std/make_unique(5cd499e8540a10bb).<Symbolcxx . . $ Symbol#>(l.atcxx . . $ QList#at(e2681f9bb6b2f357).(1), *cxx . . $ std/optional#`operator*`(47e1a15210ec6306).value, source)); |
| 473 | } |
| 474 | } |
| 475 | return true; |
| 476 | } |
| 477 | |
| 478 | bool SymbolTablecxx . . $ SymbolTable#::readLinkMapFilecxx . . $ SymbolTable#readLinkMapFile(e1defb592416720d).(const QStringcxx . . $ QString#& filename) |
| 479 | { |
| 480 | const QStringcxx . . $ QString# magiccxx . . $ QString#QString(85c52e162fed56f9).("Machine type"); |
| 481 | const QStringcxx . . $ QString# tableStartcxx . . $ QString#QString(85c52e162fed56f9).("Symbol Table"); |
| 482 | |
| 483 | QRegExpcxx . . $ QRegExp# rxcxx . . $ QRegExp#QRegExp(31e086911ff70bd0).(" [0-9A-Fa-f]{4} (?![ 0-9])"cxx . . $ QString#QString(85c52e162fed56f9).); |
| 484 | QRegExpcxx . . $ QRegExp# rpcxx . . $ QRegExp#QRegExp(31e086911ff70bd0).("^([^ ]+) +[^ ]* +([0-9A-Fa-f]{4}) $"cxx . . $ QString#QString(85c52e162fed56f9).); |
| 485 | |
| 486 | QFilecxx . . $ QFile# filecxx . . $ QFile#QFile(3520e46b33348bf6).(filename); |
| 487 | if (!file.opencxx . . $ QFile#open(dca164408be960c8).(QIODevicecxx . . $ QIODevice#::ReadOnlycxx . . $ QIODevice#ReadOnly. |cxx . . $ `operator|`(c9e45f682471e48d). QIODevicecxx . . $ QIODevice#::Textcxx . . $ QIODevice#Text.)) { |
| 488 | return false; |
| 489 | } |
| 490 | appendFilecxx . . $ SymbolTable#appendFile(99acc5e4b40ab5b2).(filename, LINKMAP_FILEcxx . . $ SymbolTable#LINKMAP_FILE.); |
| 491 | const auto* source = &symbolFilescxx . . $ SymbolTable#symbolFiles..backcxx . . $ QList#back(19b2b6f17af048b).().fileNamecxx . . $ SymbolTable#SymbolFileRecord#fileName.; |
| 492 | |
| 493 | QTextStreamcxx . . $ QTextStream# incxx . . $ QTextStream#QTextStream(bebe8f2dee7f9e86).(&file); |
| 494 | if (in.atEndcxx . . $ QTextStream#atEnd(50ce9a9e25b4a850).()) return false; |
| 495 | while (true) { |
| 496 | if (in.atEndcxx . . $ QTextStream#atEnd(50ce9a9e25b4a850).()) return false; |
| 497 | if (in.readLinecxx . . $ QTextStream#readLine(20e0a2766677f583).().startsWithcxx . . $ QString#startsWith(8cce4688c16f48f3).(magic)) break; |
| 498 | } |
| 499 | while (true) { |
| 500 | if (in.atEndcxx . . $ QTextStream#atEnd(50ce9a9e25b4a850).()) return false; |
| 501 | if (in.readLinecxx . . $ QTextStream#readLine(20e0a2766677f583).().containscxx . . $ QString#contains(8cce4688c16f48f3).(tableStart)) break; |
| 502 | } |
| 503 | |
| 504 | while (!in.atEndcxx . . $ QTextStream#atEnd(50ce9a9e25b4a850).()) { |
| 505 | QStringcxx . . $ QString# line = in.readLinecxx . . $ QTextStream#readLine(20e0a2766677f583).(); |
| 506 | Q_ASSERTcxx . . $ `<external>/15045578679651060896/qglobal.h:861:13`!(!line.endsWith("\r")); |
| 507 | if (line.isEmptycxx . . $ QString#isEmpty(50ce9a9e25b4a850).()) continue; |
| 508 | |
| 509 | line +=cxx . . $ QString#`operator+=`(d02845eef0c33901). " "; |
| 510 | int len = line.lengthcxx . . $ QString#length(455f465bc33b4cdf).(); |
| 511 | int l; |
| 512 | int pos = 0; |
| 513 | bool ok = false; |
| 514 | // HiTech uses multiple columns of non-fixed width and |
| 515 | // a column for psect may be blank so the address may in |
| 516 | // the first or second match. |
| 517 | for (int tries = 0; (tries < 2) && !ok; ++tries) { |
| 518 | pos = rx.indexIncxx . . $ QRegExp#indexIn(46f502bdfc4aeb33).(line, pos); |
| 519 | l = pos + rx.matchedLengthcxx . . $ QRegExp#matchedLength(455f465bc33b4cdf).(); |
| 520 | if ((l > 0) && (len % l) == 0) { |
| 521 | ok = true; |
| 522 | for (int posn = pos + l; (posn < len) && ok; posn += l) { |
| 523 | ok = (posn == rx.indexIncxx . . $ QRegExp#indexIn(46f502bdfc4aeb33).(line, posn)); |
| 524 | } |
| 525 | } |
| 526 | pos = l - 1; |
| 527 | } |
| 528 | if (!ok) continue; |
| 529 | |
| 530 | for (pos = 0; pos < len; pos += l) { |
| 531 | QStringcxx . . $ QString# part = line.midcxx . . $ QString#mid(44b7563da18aea72).(pos, l); |
| 532 | if (rp.indexIncxx . . $ QRegExp#indexIn(46f502bdfc4aeb33).(part) == 0) { |
| 533 | QStringListcxx . . $ QStringList# l = rp.capturedTextscxx . . $ QRegExp#capturedTexts(669a05bc42dd57cc).(); |
| 534 | addcxx . . $ SymbolTable#add(c241dcc49dd75ec1).(stdcxx . . $ std/::make_uniquecxx . . $ std/make_unique(5cd499e8540a10bb).<Symbolcxx . . $ Symbol#>(l.atcxx . . $ QList#at(e2681f9bb6b2f357).(1), l.lastcxx . . $ QList#last(19b2b6f17af048b).().toIntcxx . . $ QString#toInt(d7972accae11ee1f).(nullptr, 16), source)); |
| 535 | } |
| 536 | } |
| 537 | } |
| 538 | return true; |
| 539 | } |
| 540 | |
| 541 | void SymbolTablecxx . . $ SymbolTable#::fileChangedcxx . . $ SymbolTable#fileChanged(3520e46b33348bf6).(const QStringcxx . . $ QString#& path) |
| 542 | { |
| 543 | emitcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:97:10`! symbolFileChangedcxx . . $ SymbolTable#symbolFileChanged(49f6e7a06ebc5aa8).(); |
| 544 | if (QFilecxx . . $ QFile#::existscxx . . $ QFile#exists(e1defb592416720d).(path)) { |
| 545 | fileWatchercxx . . $ SymbolTable#fileWatcher..addPathcxx . . $ QFileSystemWatcher#addPath(e1defb592416720d).(path); |
| 546 | } |
| 547 | } |
| 548 | |
| 549 | void SymbolTablecxx . . $ SymbolTable#::reloadFilescxx . . $ SymbolTable#reloadFiles(49f6e7a06ebc5aa8).() |
| 550 | { |
| 551 | for (int i = 0; i < symbolFilescxx . . $ SymbolTable#symbolFiles..sizecxx . . $ QList#size(ea6fe5115c70a13f).(); ++i) { |
| 552 | // check if file is newer |
| 553 | QFileInfocxx . . $ QFileInfo# fi = QFileInfocxx . . $ QFileInfo#(symbolFilescxx . . $ SymbolTable#symbolFiles.[cxx . . $ QList#`operator[]`(7a0ef1c7079e8533).i].fileNamecxx . . $ SymbolTable#SymbolFileRecord#fileName.); |
| 554 | if (fi.lastModifiedcxx . . $ QFileInfo#lastModified(4e062b5c490497ac).() <=cxx . . $ QDateTime#`operator<=`(147858620bc979f5). symbolFilescxx . . $ SymbolTable#symbolFiles.[cxx . . $ QList#`operator[]`(7a0ef1c7079e8533).i].refreshTimecxx . . $ SymbolTable#SymbolFileRecord#refreshTime.) continue; |
| 555 | |
| 556 | // file info |
| 557 | QStringcxx . . $ QString# name = symbolFilescxx . . $ QString#QString(132dd6869045752b).[cxx . . $ QList#`operator[]`(7a0ef1c7079e8533).i].fileNamecxx . . $ SymbolTable#SymbolFileRecord#fileName.; |
| 558 | FileTypecxx . . $ SymbolTable#FileType# type = symbolFilescxx . . $ SymbolTable#symbolFiles.[cxx . . $ QList#`operator[]`(7a0ef1c7079e8533).i].fileTypecxx . . $ SymbolTable#SymbolFileRecord#fileType.; |
| 559 | // symbol file is newer |
| 560 | QMapcxx . . $ QMap#<QStringcxx . . $ QString#, Symbolcxx . . $ Symbol#> symCopycxx . . $ QMap#QMap(ced63f7c635d850d).; |
| 561 | // copy all symbols originating from this file |
| 562 | for (const auto& s : symbolscxx . . $ SymbolTable#symbols.) { |
| 563 | if (s->cxx . . $ std/unique_ptr#`operator->`(ea7391e9eeeaf20e).sourcecxx . . $ Symbol#source(88f341a3c13628a).() == &symbolFilescxx . . $ SymbolTable#symbolFiles.[cxx . . $ QList#`operator[]`(7a0ef1c7079e8533).i].fileNamecxx . . $ SymbolTable#SymbolFileRecord#fileName.) { |
| 564 | symCopy.insertcxx . . $ QMap#insert(929a1ed410fe8423).(s->cxx . . $ std/unique_ptr#`operator->`(ea7391e9eeeaf20e).textcxx . . $ Symbol#text(a2fb7a6ce195d51).(), Symbolcxx . . $ Symbol#(*cxx . . $ std/unique_ptr#`operator*`(26c95836c1e8ca05).s)); |
| 565 | } |
| 566 | } |
| 567 | // remove existing file |
| 568 | unloadFilecxx . . $ SymbolTable#unloadFile(37c160c81b6367f7).(name); |
| 569 | // read the new file |
| 570 | readFilecxx . . $ SymbolTable#readFile(a6376190b25aca40).(name, type); |
| 571 | // find old symbols in newly loaded file |
| 572 | QStringcxx . . $ QString#* newFile = &symbolFilescxx . . $ SymbolTable#symbolFiles..backcxx . . $ QList#back(19b2b6f17af048b).().fileNamecxx . . $ SymbolTable#SymbolFileRecord#fileName.; |
| 573 | for (auto& s : symbolscxx . . $ SymbolTable#symbols.) { |
| 574 | if (s->cxx . . $ std/unique_ptr#`operator->`(ea7391e9eeeaf20e).sourcecxx . . $ Symbol#source(88f341a3c13628a).() != newFile) continue; |
| 575 | |
| 576 | // find symbol in old list |
| 577 | auto sit = symCopy.findcxx . . $ QMap#find(9e2276816f28e801).(s->cxx . . $ std/unique_ptr#`operator->`(ea7391e9eeeaf20e).textcxx . . $ Symbol#text(a2fb7a6ce195d51).()); |
| 578 | if (sit ==cxx . . $ QMap#iterator#`operator==`(8a5a4c9a0d42c534). symCopy.endcxx . . $ QMap#end(2d49d7eeb2586d1c).()) continue; |
| 579 | |
| 580 | // symbol existed before, copy settings |
| 581 | s->cxx . . $ std/unique_ptr#`operator->`(ea7391e9eeeaf20e).setValidSlotscxx . . $ Symbol#setValidSlots(ed53e3bbd3fa2f69).(sit->cxx . . $ QMap#iterator#`operator->`(1d1e4aba2bba624b).validSlotscxx . . $ Symbol#validSlots(72085aa11f4b6e09).()); |
| 582 | s->cxx . . $ std/unique_ptr#`operator->`(ea7391e9eeeaf20e).setValidRegisterscxx . . $ Symbol#setValidRegisters(d4f767463ce0a6b3).(sit->cxx . . $ QMap#iterator#`operator->`(1d1e4aba2bba624b).validRegisterscxx . . $ Symbol#validRegisters(455f465bc33b4cdf).()); |
| 583 | s->cxx . . $ std/unique_ptr#`operator->`(ea7391e9eeeaf20e).setTypecxx . . $ Symbol#setType(940f9e37a621fd9).(sit->cxx . . $ QMap#iterator#`operator->`(1d1e4aba2bba624b).typecxx . . $ Symbol#type(4ac61bd11a1ab7d9).()); |
| 584 | s->cxx . . $ std/unique_ptr#`operator->`(ea7391e9eeeaf20e).setStatuscxx . . $ Symbol#setStatus(48246a611bcf1fe4).((sit->cxx . . $ QMap#iterator#`operator->`(1d1e4aba2bba624b).statuscxx . . $ Symbol#status(71980a2ae356e487).() == Symbolcxx . . $ Symbol#::LOSTcxx . . $ Symbol#LOST.) ? Symbolcxx . . $ Symbol#::ACTIVEcxx . . $ Symbol#ACTIVE. : sit->cxx . . $ QMap#iterator#`operator->`(1d1e4aba2bba624b).statuscxx . . $ Symbol#status(71980a2ae356e487).()); |
| 585 | symCopy.erasecxx . . $ QMap#erase(bbdfa0de74344179).(sit); |
| 586 | } |
| 587 | if (Settingscxx . . $ Settings#::getcxx . . $ Settings#get(493e506a9691bc24).().preserveLostSymbolscxx . . $ Settings#preserveLostSymbols(50ce9a9e25b4a850).()) { |
| 588 | // all symbols left in map are lost |
| 589 | for (auto sit = symCopy.begincxx . . $ QMap#begin(2d49d7eeb2586d1c).(); sit !=cxx . . $ QMap#iterator#`operator!=`(8a5a4c9a0d42c534). symCopy.endcxx . . $ QMap#end(2d49d7eeb2586d1c).(); ++cxx . . $ QMap#iterator#operator++(a0bd0c31b18c8d80).sit) { |
| 590 | auto* sym = addcxx . . $ SymbolTable#add(c241dcc49dd75ec1).(stdcxx . . $ std/::make_uniquecxx . . $ std/make_unique(5cd499e8540a10bb).<Symbolcxx . . $ Symbol#>(sit.valuecxx . . $ QMap#iterator#value(51f62fb05f27f6a2).())); |
| 591 | sym->setStatuscxx . . $ Symbol#setStatus(48246a611bcf1fe4).(Symbolcxx . . $ Symbol#::LOSTcxx . . $ Symbol#LOST.); |
| 592 | sym->setSourcecxx . . $ Symbol#setSource(b62801a724e345f3).(newFile); |
| 593 | } |
| 594 | } |
| 595 | } |
| 596 | } |
| 597 | |
| 598 | void SymbolTablecxx . . $ SymbolTable#::unloadFilecxx . . $ SymbolTable#unloadFile(37c160c81b6367f7).(const QStringcxx . . $ QString#& file, bool keepSymbols) |
| 599 | { |
| 600 | int index = -1; |
| 601 | for (int i = 0; i < symbolFilescxx . . $ SymbolTable#symbolFiles..sizecxx . . $ QList#size(ea6fe5115c70a13f).(); ++i) { |
| 602 | if (symbolFilescxx . . $ SymbolTable#symbolFiles.[cxx . . $ QList#`operator[]`(7a0ef1c7079e8533).i].fileNamecxx . . $ SymbolTable#SymbolFileRecord#fileName. ==cxx . . $ `operator==`(5bc2975d2d751687). file) { |
| 603 | index = i; |
| 604 | break; |
| 605 | } |
| 606 | } |
| 607 | if (index >= 0) { |
| 608 | QStringcxx . . $ QString#* name = &symbolFilescxx . . $ SymbolTable#symbolFiles.[cxx . . $ QList#`operator[]`(7a0ef1c7079e8533).index].fileNamecxx . . $ SymbolTable#SymbolFileRecord#fileName.; |
| 609 | |
| 610 | if (!keepSymbols) { |
| 611 | // remove symbols from address map |
| 612 | QMutableMapIteratorcxx . . $ QMutableMapIterator#<int, Symbolcxx . . $ Symbol#*> micxx . . $ QMutableMapIterator#QMutableMapIterator(881fa6995fc49359).(addressSymbolscxx . . $ SymbolTable#addressSymbols.); |
| 613 | while (mi.hasNextcxx . . $ QMutableMapIterator#hasNext(50ce9a9e25b4a850).()) { |
| 614 | mi.nextcxx . . $ QMutableMapIterator#next(18bea9d7d3fabb8c).(); |
| 615 | if (mi.valuecxx . . $ QMutableMapIterator#value(bef0f7a998e0139b).()->sourcecxx . . $ Symbol#source(88f341a3c13628a).() == name) mi.removecxx . . $ QMutableMapIterator#remove(49f6e7a06ebc5aa8).(); |
| 616 | } |
| 617 | // remove symbols from value hash |
| 618 | QMutableHashIteratorcxx . . $ QMutableHashIterator#<int, Symbolcxx . . $ Symbol#*> hicxx . . $ QMutableHashIterator#QMutableHashIterator(741506ea78829a07).(valueSymbolscxx . . $ SymbolTable#valueSymbols.); |
| 619 | while (hi.hasNextcxx . . $ QMutableHashIterator#hasNext(50ce9a9e25b4a850).()) { |
| 620 | hi.nextcxx . . $ QMutableHashIterator#next(dec9d5a4887d188d).(); |
| 621 | if (hi.valuecxx . . $ QMutableHashIterator#value(bef0f7a998e0139b).()->sourcecxx . . $ Symbol#source(88f341a3c13628a).() == name) hi.removecxx . . $ QMutableHashIterator#remove(49f6e7a06ebc5aa8).(); |
| 622 | } |
| 623 | } |
| 624 | // remove symbols from value hash |
| 625 | symbolscxx . . $ SymbolTable#symbols..erasecxx . . $ std/vector#erase(cc2a997b00bceed8).(stdcxx . . $ __gnu_cxx/__normal_iterator#__normal_iterator(459a7e7b9fbe7640).::remove_ifcxx . . $ std/remove_if(f0a0a4f94ee5cb00).(symbolscxx . . $ SymbolTable#symbols..begincxx . . $ std/vector#begin(55a6de06420d4903).(), symbolscxx . . $ SymbolTable#symbols..endcxx . . $ std/vector#end(55a6de06420d4903).(), |
| 626 | [&](auto& sym) { |
| 627 | if (sym->source() !=cxx . . $ `operator!=`(c658459fbfebdd4a). name) { |
| 628 | return false; // keep symbols from different source |
| 629 | } |
| 630 | if (!keepSymbols) { |
| 631 | return true; // remove |
| 632 | } |
| 633 | // keep but clear source |
| 634 | sym->setSource(nullptr); |
| 635 | return false; // keep |
| 636 | }), symbolscxx . . $ __gnu_cxx/__normal_iterator#__normal_iterator(459a7e7b9fbe7640)..endcxx . . $ std/vector#end(55a6de06420d4903).()); |
| 637 | // remove record |
| 638 | fileWatchercxx . . $ SymbolTable#fileWatcher..removePathcxx . . $ QFileSystemWatcher#removePath(e1defb592416720d).(symbolFilescxx . . $ SymbolTable#symbolFiles.[cxx . . $ QList#`operator[]`(7a0ef1c7079e8533).index].fileNamecxx . . $ SymbolTable#SymbolFileRecord#fileName.); |
| 639 | symbolFilescxx . . $ SymbolTable#symbolFiles..removeAtcxx . . $ QList#removeAt(d4f767463ce0a6b3).(index); |
| 640 | } |
| 641 | } |
| 642 | |
| 643 | /* |
| 644 | * Session loading/saving |
| 645 | */ |
| 646 | void SymbolTablecxx . . $ SymbolTable#::saveSymbolscxx . . $ SymbolTable#saveSymbols(b6139443264d70c1).(QXmlStreamWritercxx . . $ QXmlStreamWriter#& xml) |
| 647 | { |
| 648 | // write files |
| 649 | QMapcxx . . $ QMap#<const QStringcxx . . $ QString#*, int> fileIdscxx . . $ QMap#QMap(ced63f7c635d850d).; |
| 650 | for (int i = 0; i < symbolFilescxx . . $ SymbolTable#symbolFiles..sizecxx . . $ QList#size(ea6fe5115c70a13f).(); ++i) { |
| 651 | // add id mapping |
| 652 | fileIds[cxx . . $ QMap#`operator[]`(bbd415b616967878).&symbolFilescxx . . $ SymbolTable#symbolFiles.[cxx . . $ QList#`operator[]`(7a0ef1c7079e8533).i].fileNamecxx . . $ SymbolTable#SymbolFileRecord#fileName.] = i; |
| 653 | // write element |
| 654 | xml.writeStartElementcxx . . $ QXmlStreamWriter#writeStartElement(3520e46b33348bf6).("SymbolFile"cxx . . $ QString#QString(85c52e162fed56f9).); |
| 655 | switch (symbolFilescxx . . $ SymbolTable#symbolFiles.[cxx . . $ QList#`operator[]`(7a0ef1c7079e8533).i].fileTypecxx . . $ SymbolTable#SymbolFileRecord#fileType.) { |
| 656 | case TNIASM0_FILEcxx . . $ SymbolTable#TNIASM0_FILE.: |
| 657 | xml.writeAttributecxx . . $ QXmlStreamWriter#writeAttribute(c1427772cd1877b0).("type"cxx . . $ QString#QString(85c52e162fed56f9).,"tniasm0"cxx . . $ QString#QString(85c52e162fed56f9).); |
| 658 | break; |
| 659 | case TNIASM1_FILEcxx . . $ SymbolTable#TNIASM1_FILE.: |
| 660 | xml.writeAttributecxx . . $ QXmlStreamWriter#writeAttribute(c1427772cd1877b0).("type"cxx . . $ QString#QString(85c52e162fed56f9).,"tniasm1"cxx . . $ QString#QString(85c52e162fed56f9).); |
| 661 | break; |
| 662 | case ASMSX_FILEcxx . . $ SymbolTable#ASMSX_FILE.: |
| 663 | xml.writeAttributecxx . . $ QXmlStreamWriter#writeAttribute(c1427772cd1877b0).("type"cxx . . $ QString#QString(85c52e162fed56f9).,"asmsx"cxx . . $ QString#QString(85c52e162fed56f9).); |
| 664 | break; |
| 665 | case LINKMAP_FILEcxx . . $ SymbolTable#LINKMAP_FILE.: |
| 666 | xml.writeAttributecxx . . $ QXmlStreamWriter#writeAttribute(c1427772cd1877b0).("type"cxx . . $ QString#QString(85c52e162fed56f9).,"linkmap"cxx . . $ QString#QString(85c52e162fed56f9).); |
| 667 | break; |
| 668 | default: |
| 669 | break; |
| 670 | } |
| 671 | xml.writeAttributecxx . . $ QXmlStreamWriter#writeAttribute(c1427772cd1877b0).("refreshTime"cxx . . $ QString#QString(85c52e162fed56f9)., |
| 672 | QStringcxx . . $ QString#::numbercxx . . $ QString#number(da83c6b4fd8c0e98).(symbolFilescxx . . $ SymbolTable#symbolFiles.[cxx . . $ QList#`operator[]`(7a0ef1c7079e8533).i].refreshTimecxx . . $ SymbolTable#SymbolFileRecord#refreshTime..toTime_tcxx . . $ QDateTime#toTime_t(ddd8539a2fcdd4ce).())); |
| 673 | xml.writeCharacterscxx . . $ QXmlStreamWriter#writeCharacters(3520e46b33348bf6).(symbolFilescxx . . $ SymbolTable#symbolFiles.[cxx . . $ QList#`operator[]`(7a0ef1c7079e8533).i].fileNamecxx . . $ SymbolTable#SymbolFileRecord#fileName.); |
| 674 | xml.writeEndElementcxx . . $ QXmlStreamWriter#writeEndElement(49f6e7a06ebc5aa8).(); |
| 675 | } |
| 676 | // write symbols |
| 677 | for (const auto& sym : symbolscxx . . $ SymbolTable#symbols.) { |
| 678 | xml.writeStartElementcxx . . $ QXmlStreamWriter#writeStartElement(3520e46b33348bf6).("Symbol"cxx . . $ QString#QString(85c52e162fed56f9).); |
| 679 | // status |
| 680 | if (sym->cxx . . $ std/unique_ptr#`operator->`(ea7391e9eeeaf20e).statuscxx . . $ Symbol#status(71980a2ae356e487).() == Symbolcxx . . $ Symbol#::HIDDENcxx . . $ Symbol#HIDDEN.) { |
| 681 | xml.writeAttributecxx . . $ QXmlStreamWriter#writeAttribute(c1427772cd1877b0).("status"cxx . . $ QString#QString(85c52e162fed56f9)., "hidden"cxx . . $ QString#QString(85c52e162fed56f9).); |
| 682 | } else if (sym->cxx . . $ std/unique_ptr#`operator->`(ea7391e9eeeaf20e).statuscxx . . $ Symbol#status(71980a2ae356e487).() == Symbolcxx . . $ Symbol#::LOSTcxx . . $ Symbol#LOST.) { |
| 683 | xml.writeAttributecxx . . $ QXmlStreamWriter#writeAttribute(c1427772cd1877b0).("status"cxx . . $ QString#QString(85c52e162fed56f9)., "lost"cxx . . $ QString#QString(85c52e162fed56f9).); |
| 684 | } |
| 685 | // type |
| 686 | if (sym->cxx . . $ std/unique_ptr#`operator->`(ea7391e9eeeaf20e).typecxx . . $ Symbol#type(4ac61bd11a1ab7d9).() == Symbolcxx . . $ Symbol#::JUMPLABELcxx . . $ Symbol#JUMPLABEL.) { |
| 687 | xml.writeTextElementcxx . . $ QXmlStreamWriter#writeTextElement(c1427772cd1877b0).("type"cxx . . $ QString#QString(85c52e162fed56f9)., "jump"cxx . . $ QString#QString(85c52e162fed56f9).); |
| 688 | } else if (sym->cxx . . $ std/unique_ptr#`operator->`(ea7391e9eeeaf20e).typecxx . . $ Symbol#type(4ac61bd11a1ab7d9).() == Symbolcxx . . $ Symbol#::VARIABLELABELcxx . . $ Symbol#VARIABLELABEL.) { |
| 689 | xml.writeTextElementcxx . . $ QXmlStreamWriter#writeTextElement(c1427772cd1877b0).("type"cxx . . $ QString#QString(85c52e162fed56f9)., "variable"cxx . . $ QString#QString(85c52e162fed56f9).); |
| 690 | } else { |
| 691 | xml.writeTextElementcxx . . $ QXmlStreamWriter#writeTextElement(c1427772cd1877b0).("type"cxx . . $ QString#QString(85c52e162fed56f9)., "value"cxx . . $ QString#QString(85c52e162fed56f9).); |
| 692 | } |
| 693 | // text, value, slots and registers |
| 694 | xml.writeTextElementcxx . . $ QXmlStreamWriter#writeTextElement(c1427772cd1877b0).("name"cxx . . $ QString#QString(85c52e162fed56f9)., sym->cxx . . $ std/unique_ptr#`operator->`(ea7391e9eeeaf20e).textcxx . . $ Symbol#text(a2fb7a6ce195d51).()); |
| 695 | xml.writeTextElementcxx . . $ QXmlStreamWriter#writeTextElement(c1427772cd1877b0).("value"cxx . . $ QString#QString(85c52e162fed56f9)., QStringcxx . . $ QString#::numbercxx . . $ QString#number(f4fd9db251ca774b).(sym->cxx . . $ std/unique_ptr#`operator->`(ea7391e9eeeaf20e).valuecxx . . $ Symbol#value(455f465bc33b4cdf).())); |
| 696 | xml.writeTextElementcxx . . $ QXmlStreamWriter#writeTextElement(c1427772cd1877b0).("validSlots"cxx . . $ QString#QString(85c52e162fed56f9)., QStringcxx . . $ QString#::numbercxx . . $ QString#number(f4fd9db251ca774b).(sym->cxx . . $ std/unique_ptr#`operator->`(ea7391e9eeeaf20e).validSlotscxx . . $ Symbol#validSlots(72085aa11f4b6e09).())); |
| 697 | xml.writeTextElementcxx . . $ QXmlStreamWriter#writeTextElement(c1427772cd1877b0).("validRegisters"cxx . . $ QString#QString(85c52e162fed56f9)., QStringcxx . . $ QString#::numbercxx . . $ QString#number(f4fd9db251ca774b).(sym->cxx . . $ std/unique_ptr#`operator->`(ea7391e9eeeaf20e).validRegisterscxx . . $ Symbol#validRegisters(455f465bc33b4cdf).())); |
| 698 | // write source filename |
| 699 | if (sym->cxx . . $ std/unique_ptr#`operator->`(ea7391e9eeeaf20e).sourcecxx . . $ Symbol#source(88f341a3c13628a).()) { |
| 700 | xml.writeTextElementcxx . . $ QXmlStreamWriter#writeTextElement(c1427772cd1877b0).("source"cxx . . $ QString#QString(85c52e162fed56f9)., QStringcxx . . $ QString#::numbercxx . . $ QString#number(f4fd9db251ca774b).(fileIds[cxx . . $ QMap#`operator[]`(bbd415b616967878).sym->cxx . . $ std/unique_ptr#`operator->`(ea7391e9eeeaf20e).sourcecxx . . $ Symbol#source(88f341a3c13628a).()])); |
| 701 | } |
| 702 | // complete |
| 703 | xml.writeEndElementcxx . . $ QXmlStreamWriter#writeEndElement(49f6e7a06ebc5aa8).(); |
| 704 | } |
| 705 | } |
| 706 | |
| 707 | void SymbolTablecxx . . $ SymbolTable#::loadSymbolscxx . . $ SymbolTable#loadSymbols(e225a1e01f50193c).(QXmlStreamReadercxx . . $ QXmlStreamReader#& xml) |
| 708 | { |
| 709 | Symbolcxx . . $ Symbol#* sym = nullptr; |
| 710 | while (!xml.atEndcxx . . $ QXmlStreamReader#atEnd(50ce9a9e25b4a850).()) { |
| 711 | xml.readNextcxx . . $ QXmlStreamReader#readNext(b7ff4e19d2a802cc).(); |
| 712 | // exit if closing of main tag |
| 713 | if (xml.isEndElementcxx . . $ QXmlStreamReader#isEndElement(50ce9a9e25b4a850).() && xml.namecxx . . $ QXmlStreamReader#name(d2d1e01c834b11a).() ==cxx . . $ QStringRef#`operator==`(7d4bdb1abc417636). "Symbols") break; |
| 714 | |
| 715 | // begin tag |
| 716 | if (xml.isStartElementcxx . . $ QXmlStreamReader#isStartElement(50ce9a9e25b4a850).()) { |
| 717 | if (xml.namecxx . . $ QXmlStreamReader#name(d2d1e01c834b11a).() ==cxx . . $ QStringRef#`operator==`(7d4bdb1abc417636). "SymbolFile") { |
| 718 | // read attributes and text |
| 719 | QStringcxx . . $ QString# ftype = xml.attributescxx . . $ QXmlStreamReader#attributes(67475bfd56333fa4).().valuecxx . . $ QXmlStreamAttributes#value(d1818b7318ce2ed4).("type"cxx . . $ QString#QString(85c52e162fed56f9).).toStringcxx . . $ QStringRef#toString(6ef7b6c27b00b43d).().toLowercxx . . $ QString#toLower(30b3b70527b1c61a).(); |
| 720 | QStringcxx . . $ QString# rtime = xml.attributescxx . . $ QXmlStreamReader#attributes(67475bfd56333fa4).().valuecxx . . $ QXmlStreamAttributes#value(d1818b7318ce2ed4).("refreshTime"cxx . . $ QString#QString(85c52e162fed56f9).).toStringcxx . . $ QStringRef#toString(6ef7b6c27b00b43d).(); |
| 721 | QStringcxx . . $ QString# fname = xml.readElementTextcxx . . $ QXmlStreamReader#readElementText(626b7e7cde3661e7).(); |
| 722 | // check type |
| 723 | FileTypecxx . . $ SymbolTable#FileType# type = TNIASM0_FILEcxx . . $ SymbolTable#TNIASM0_FILE.; |
| 724 | if (ftype ==cxx . . $ QString#`operator==`(7d4bdb1abc417636). "tniasm1") { |
| 725 | type = TNIASM1_FILEcxx . . $ SymbolTable#TNIASM1_FILE.; |
| 726 | } else if (ftype ==cxx . . $ QString#`operator==`(7d4bdb1abc417636). "asmsx") { |
| 727 | type = ASMSX_FILEcxx . . $ SymbolTable#ASMSX_FILE.; |
| 728 | } else if (ftype ==cxx . . $ QString#`operator==`(7d4bdb1abc417636). "linkmap") { |
| 729 | type = LINKMAP_FILEcxx . . $ SymbolTable#LINKMAP_FILE.; |
| 730 | } |
| 731 | // append file |
| 732 | appendFilecxx . . $ SymbolTable#appendFile(99acc5e4b40ab5b2).(fname, type); |
| 733 | // change time |
| 734 | symbolFilescxx . . $ SymbolTable#symbolFiles..backcxx . . $ QList#back(19b2b6f17af048b).().refreshTimecxx . . $ SymbolTable#SymbolFileRecord#refreshTime..setTime_tcxx . . $ QDateTime#setTime_t(cb2f890c2fdad230).(rtime.toUIntcxx . . $ QString#toUInt(a0efe6e2edfc86a0).()); |
| 735 | |
| 736 | } else if (xml.namecxx . . $ QXmlStreamReader#name(d2d1e01c834b11a).() ==cxx . . $ QStringRef#`operator==`(7d4bdb1abc417636). "Symbol") { |
| 737 | // add empty symbol |
| 738 | sym = addcxx . . $ SymbolTable#add(c241dcc49dd75ec1).(stdcxx . . $ std/::make_uniquecxx . . $ std/make_unique(5cd499e8540a10bb).<Symbolcxx . . $ Symbol#>("", 0)); |
| 739 | // get status attribute |
| 740 | QStringcxx . . $ QString# stat = xml.attributescxx . . $ QXmlStreamReader#attributes(67475bfd56333fa4).().valuecxx . . $ QXmlStreamAttributes#value(d1818b7318ce2ed4).("status"cxx . . $ QString#QString(85c52e162fed56f9).).toStringcxx . . $ QStringRef#toString(6ef7b6c27b00b43d).().toLowercxx . . $ QString#toLower(30b3b70527b1c61a).(); |
| 741 | if (stat ==cxx . . $ QString#`operator==`(7d4bdb1abc417636). "hidden") { |
| 742 | sym->setStatuscxx . . $ Symbol#setStatus(48246a611bcf1fe4).(Symbolcxx . . $ Symbol#::HIDDENcxx . . $ Symbol#HIDDEN.); |
| 743 | } else if (stat ==cxx . . $ QString#`operator==`(7d4bdb1abc417636). "lost") { |
| 744 | sym->setStatuscxx . . $ Symbol#setStatus(48246a611bcf1fe4).(Symbolcxx . . $ Symbol#::LOSTcxx . . $ Symbol#LOST.); |
| 745 | } |
| 746 | |
| 747 | } else if (sym && xml.namecxx . . $ QXmlStreamReader#name(d2d1e01c834b11a).() ==cxx . . $ QStringRef#`operator==`(7d4bdb1abc417636). "type") { |
| 748 | // read symbol type element |
| 749 | QStringcxx . . $ QString# type = xml.readElementTextcxx . . $ QXmlStreamReader#readElementText(626b7e7cde3661e7).().trimmedcxx . . $ QString#trimmed(30b3b70527b1c61a).().toLowercxx . . $ QString#toLower(30b3b70527b1c61a).(); |
| 750 | if (type ==cxx . . $ QString#`operator==`(7d4bdb1abc417636). "jump") { |
| 751 | sym->setTypecxx . . $ Symbol#setType(940f9e37a621fd9).(Symbolcxx . . $ Symbol#::JUMPLABELcxx . . $ Symbol#JUMPLABEL.); |
| 752 | } else if (type ==cxx . . $ QString#`operator==`(7d4bdb1abc417636). "variable") { |
| 753 | sym->setTypecxx . . $ Symbol#setType(940f9e37a621fd9).(Symbolcxx . . $ Symbol#::VARIABLELABELcxx . . $ Symbol#VARIABLELABEL.); |
| 754 | } else if (type ==cxx . . $ QString#`operator==`(7d4bdb1abc417636). "value") { |
| 755 | sym->setTypecxx . . $ Symbol#setType(940f9e37a621fd9).(Symbolcxx . . $ Symbol#::VALUEcxx . . $ Symbol#VALUE.); |
| 756 | } |
| 757 | |
| 758 | } else if (sym && xml.namecxx . . $ QXmlStreamReader#name(d2d1e01c834b11a).() ==cxx . . $ QStringRef#`operator==`(7d4bdb1abc417636). "name") { |
| 759 | // read symbol name |
| 760 | sym->setTextcxx . . $ Symbol#setText(3520e46b33348bf6).(xml.readElementTextcxx . . $ QXmlStreamReader#readElementText(626b7e7cde3661e7).()); |
| 761 | |
| 762 | } else if (sym && xml.namecxx . . $ QXmlStreamReader#name(d2d1e01c834b11a).() ==cxx . . $ QStringRef#`operator==`(7d4bdb1abc417636). "value") { |
| 763 | // read symbol value |
| 764 | sym->setValuecxx . . $ Symbol#setValue(d4f767463ce0a6b3).(xml.readElementTextcxx . . $ QXmlStreamReader#readElementText(626b7e7cde3661e7).().toIntcxx . . $ QString#toInt(d7972accae11ee1f).()); |
| 765 | |
| 766 | } else if (sym && xml.namecxx . . $ QXmlStreamReader#name(d2d1e01c834b11a).() ==cxx . . $ QStringRef#`operator==`(7d4bdb1abc417636). "validSlots") { |
| 767 | // read numeric valid slot mask |
| 768 | sym->setValidSlotscxx . . $ Symbol#setValidSlots(ed53e3bbd3fa2f69).(xml.readElementTextcxx . . $ QXmlStreamReader#readElementText(626b7e7cde3661e7).().toIntcxx . . $ QString#toInt(d7972accae11ee1f).()); |
| 769 | |
| 770 | } else if (sym && xml.namecxx . . $ QXmlStreamReader#name(d2d1e01c834b11a).() ==cxx . . $ QStringRef#`operator==`(7d4bdb1abc417636). "validRegisters") { |
| 771 | // read numeric valid registers mask |
| 772 | sym->setValidRegisterscxx . . $ Symbol#setValidRegisters(d4f767463ce0a6b3).(xml.readElementTextcxx . . $ QXmlStreamReader#readElementText(626b7e7cde3661e7).().toIntcxx . . $ QString#toInt(d7972accae11ee1f).()); |
| 773 | |
| 774 | } else if (sym && xml.namecxx . . $ QXmlStreamReader#name(d2d1e01c834b11a).() ==cxx . . $ QStringRef#`operator==`(7d4bdb1abc417636). "source") { |
| 775 | // read source file id |
| 776 | int id = xml.readElementTextcxx . . $ QXmlStreamReader#readElementText(626b7e7cde3661e7).().toIntcxx . . $ QString#toInt(d7972accae11ee1f).(); |
| 777 | if (id >= 0 && id < symbolFilescxx . . $ SymbolTable#symbolFiles..sizecxx . . $ QList#size(ea6fe5115c70a13f).()) { |
| 778 | sym->setSourcecxx . . $ Symbol#setSource(b62801a724e345f3).(&symbolFilescxx . . $ SymbolTable#symbolFiles.[cxx . . $ QList#`operator[]`(7a0ef1c7079e8533).id].fileNamecxx . . $ SymbolTable#SymbolFileRecord#fileName.); |
| 779 | } |
| 780 | } |
| 781 | } |
| 782 | } |
| 783 | } |
| 784 | |
| 785 | |
| 786 | // class Symbol |
| 787 | |
| 788 | Symbolcxx . . $ Symbol#::Symbolcxx . . $ Symbol#Symbol(c6501d5eb6bcce0e).(QStringcxx . . $ QString# str, int addr, const QStringcxx . . $ QString#* source) |
| 789 | : symTextcxx . . $ Symbol#symText.(stdcxx . . $ std/::movecxx . . $ std/move(e35c19a1ba7baa26).(str)), symValuecxx . . $ Symbol#symValue.(addr), symSourcecxx . . $ Symbol#symSource.(source) |
| 790 | { |
| 791 | symRegisterscxx . . $ Symbol#symRegisters. = (addr & 0xFF00) ? REG_ALL16cxx . . $ Symbol#REG_ALL16. : REG_ALLcxx . . $ Symbol#REG_ALL.; |
| 792 | } |
| 793 | |
| 794 | Symbolcxx . . $ Symbol#::Symbolcxx . . $ Symbol#Symbol(83ad1a05ba4f922d).(const Symbolcxx . . $ Symbol#& symbol) |
| 795 | { |
| 796 | tablecxx . . $ Symbol#table. = nullptr; |
| 797 | symStatuscxx . . $ Symbol#symStatus. = symbol.symStatuscxx . . $ Symbol#symStatus.; |
| 798 | symTextcxx . . $ Symbol#symText. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). symbol.symTextcxx . . $ Symbol#symText.; |
| 799 | symValuecxx . . $ Symbol#symValue. = symbol.symValuecxx . . $ Symbol#symValue.; |
| 800 | symSlotscxx . . $ Symbol#symSlots. = symbol.symSlotscxx . . $ Symbol#symSlots.; |
| 801 | //symSegments = symbol.symSegments; |
| 802 | symRegisterscxx . . $ Symbol#symRegisters. = symbol.symRegisterscxx . . $ Symbol#symRegisters.; |
| 803 | symSourcecxx . . $ Symbol#symSource. = symbol.symSourcecxx . . $ Symbol#symSource.; |
| 804 | symTypecxx . . $ Symbol#symType. = symbol.symTypecxx . . $ Symbol#symType.; |
| 805 | } |
| 806 | |
| 807 | void Symbolcxx . . $ Symbol#::setValuecxx . . $ Symbol#setValue(d4f767463ce0a6b3).(int addr) |
| 808 | { |
| 809 | if (addr == symValuecxx . . $ Symbol#symValue.) return; |
| 810 | |
| 811 | symValuecxx . . $ Symbol#symValue. = addr; |
| 812 | if (tablecxx . . $ Symbol#table.) tablecxx . . $ Symbol#table.->symbolValueChangedcxx . . $ SymbolTable#symbolValueChanged(e1770879d1475328).(this); |
| 813 | } |
| 814 | |
| 815 | void Symbolcxx . . $ Symbol#::setValidRegisterscxx . . $ Symbol#setValidRegisters(d4f767463ce0a6b3).(int regs) |
| 816 | { |
| 817 | symRegisterscxx . . $ Symbol#symRegisters. = regs; |
| 818 | if (symValuecxx . . $ Symbol#symValue. & 0xFF00) { |
| 819 | symRegisterscxx . . $ Symbol#symRegisters. &= REG_ALL16cxx . . $ Symbol#REG_ALL16.; |
| 820 | } |
| 821 | } |
| 822 | |
| 823 | void Symbolcxx . . $ Symbol#::setTypecxx . . $ Symbol#setType(940f9e37a621fd9).(SymbolTypecxx . . $ Symbol#SymbolType# t) |
| 824 | { |
| 825 | if (symTypecxx . . $ Symbol#symType. == t) return; |
| 826 | |
| 827 | symTypecxx . . $ Symbol#symType. = t; |
| 828 | if (tablecxx . . $ Symbol#table.) tablecxx . . $ Symbol#table.->symbolTypeChangedcxx . . $ SymbolTable#symbolTypeChanged(e1770879d1475328).(this); |
| 829 | } |
| 830 | |
| 831 | bool Symbolcxx . . $ Symbol#::isSlotValidcxx . . $ Symbol#isSlotValid(6c1b4f50bcd5f0fa).(const MemoryLayoutcxx . . $ MemoryLayout#* ml) const |
| 832 | { |
| 833 | if (!ml) return true; |
| 834 | int page = symValuecxx . . $ Symbol#symValue. >> 14; |
| 835 | int ps = ml->primarySlotcxx . . $ MemoryLayout#primarySlot.[page] & 3; |
| 836 | int ss = 0; |
| 837 | if (ml->isSubslottedcxx . . $ MemoryLayout#isSubslotted.[page]) ss = ml->secondarySlotcxx . . $ MemoryLayout#secondarySlot.[page] & 3; |
| 838 | if (symSlotscxx . . $ Symbol#symSlots. & (1 << (4 * ps + ss))) { |
| 839 | return true; |
| 840 | //if (symSegments.empty()) return true; |
| 841 | //for (const auto& seg : symSegments) { |
| 842 | // if (ml->mapperSegment[page] == seg) { |
| 843 | // return true; |
| 844 | // } |
| 845 | //} |
| 846 | } |
| 847 | return false; |
| 848 | } |