X-Git-Url: http://git.hcoop.net/clinton/Virtual-Jaguar-Rx.git/blobdiff_plain/024bfc4643b56158f3307049bf1bc30ba9376398..79a018fa160ead41dc5ea29a3939531f0e4a7e21:/src/debugger/debuggertab.cpp diff --git a/src/debugger/debuggertab.cpp b/src/debugger/debuggertab.cpp index 2a29a40..d6135e8 100644 --- a/src/debugger/debuggertab.cpp +++ b/src/debugger/debuggertab.cpp @@ -7,32 +7,48 @@ // // WHO WHEN WHAT // --- ---------- ------------------------------------------------------------ -// JPM 06/19/2016 Created this file -// JPM 06/19/2016 Soft debugger support +// JPM Sept./2016 Created this file, and added Soft debugger support +// JPM 10/09/2018 Added source file search paths +// #include "debuggertab.h" #include "settings.h" +// DebuggerTab::DebuggerTab(QWidget * parent/*= 0*/): QWidget(parent) { - QLabel * label3 = new QLabel("Disassembly lines:"); - edit3 = new QLineEdit(""); - edit3->setPlaceholderText("Number of disassembly lines"); - QVBoxLayout * layout1 = new QVBoxLayout; + // Number of disassembly lines + QLabel *label3 = new QLabel("Disassembly lines:"); + QVBoxLayout *layout1 = new QVBoxLayout; layout1->addWidget(label3); + QVBoxLayout *layout2 = new QVBoxLayout; + nbrdisasmlines = new QLineEdit(""); + nbrdisasmlines->setPlaceholderText("Number of disassembly lines"); + layout2->addWidget(nbrdisasmlines); - QVBoxLayout * layout2 = new QVBoxLayout; - layout2->addWidget(edit3); + // Sources code paths + QLabel *label4 = new QLabel("Source file search paths:"); + QVBoxLayout *layout5 = new QVBoxLayout; + layout5->addWidget(label4); + QVBoxLayout *layout6 = new QVBoxLayout; + sourcefilesearchpaths = new QLineEdit(""); + sourcefilesearchpaths->setMaxLength(sizeof(vjs.sourcefilesearchPaths)); + sourcefilesearchpaths->setPlaceholderText("Each path must be separate by a ';', search is recursive and based on each path"); + layout6->addWidget(sourcefilesearchpaths); - QHBoxLayout * layout3 = new QHBoxLayout; + QHBoxLayout *layout3 = new QHBoxLayout; layout3->addLayout(layout1); layout3->addLayout(layout2); + QHBoxLayout *layout7 = new QHBoxLayout; + layout7->addLayout(layout5); + layout7->addLayout(layout6); - QVBoxLayout * layout4 = new QVBoxLayout; + QVBoxLayout *layout4 = new QVBoxLayout; layout4->addLayout(layout3); + layout4->addLayout(layout7); - // Checkboxes... + // Checkboxes displayHWlabels = new QCheckBox(tr("Display HW labels")); disasmopcodes = new QCheckBox(tr("Display M68000 opcodes")); displayFullSourceFilename = new QCheckBox(tr("Display source filename")); @@ -48,36 +64,52 @@ DebuggerTab::DebuggerTab(QWidget * parent/*= 0*/): QWidget(parent) } +// DebuggerTab::~DebuggerTab() { } -// Save / Update the settings from the tabs dialog -void DebuggerTab::SetSettings(void) -{ - bool ok; - - //strcpy(vjs.debuggerROMPath, debuggerTab->edit1->text().toUtf8().data()); - //strcpy(vjs.absROMPath, debuggerTab->edit2->text().toUtf8().data()); - vjs.nbrdisasmlines = edit3->text().toUInt(&ok, 10); - //vjs.allowWritesToROM = debuggerTab->writeROM->isChecked(); - vjs.displayHWlabels = displayHWlabels->isChecked(); - vjs.disasmopcodes = disasmopcodes->isChecked(); - vjs.displayFullSourceFilename = displayFullSourceFilename->isChecked(); -} - - -// Load / Update the tabs dialog from the settings -void DebuggerTab::GetSettings(void) -{ - QVariant v(vjs.nbrdisasmlines); - //debuggerTab->edit1->setText(vjs.debuggerROMPath); - //debuggerTab->edit2->setText(vjs.absROMPath); - edit3->setText(v.toString()); - //debuggerTab->writeROM->setChecked(vjs.allowWritesToROM - displayHWlabels->setChecked(vjs.displayHWlabels); - disasmopcodes->setChecked(vjs.disasmopcodes); - displayFullSourceFilename->setChecked(vjs.displayFullSourceFilename); -} - +// Save / Update the settings from the tabs dialog +void DebuggerTab::SetSettings(void) +{ + bool ok; + + strcpy(vjs.debuggerROMPath, vjs.alpineROMPath); + strcpy(vjs.sourcefilesearchPaths, CheckForTrailingSlash(sourcefilesearchpaths->text()).toUtf8().data()); + vjs.nbrdisasmlines = nbrdisasmlines->text().toUInt(&ok, 10); + vjs.displayHWlabels = displayHWlabels->isChecked(); + vjs.disasmopcodes = disasmopcodes->isChecked(); + vjs.displayFullSourceFilename = displayFullSourceFilename->isChecked(); +} + + +// Load / Update the tabs dialog from the settings +void DebuggerTab::GetSettings(void) +{ + QVariant v(vjs.nbrdisasmlines); + nbrdisasmlines->setText(v.toString()); + sourcefilesearchpaths->setText(vjs.sourcefilesearchPaths); + displayHWlabels->setChecked(vjs.displayHWlabels); + disasmopcodes->setChecked(vjs.disasmopcodes); + displayFullSourceFilename->setChecked(vjs.displayFullSourceFilename); +} + + +// Remove the last character if slash or backslash at the end of each string +// Depend the platform transform slashes or backslashes +QString DebuggerTab::CheckForTrailingSlash(QString s) +{ + if (s.endsWith('/') || s.endsWith('\\')) + { + s.remove(s.length() - 1, 1); + } +#ifdef _WIN32 + s.replace(QString("/"), QString("\\")); + s.replace(QString("\\;"), QString(";")); +#else + s.replace(QString("\\"), QString("/")); + s.replace(QString("/;"), QString(";")); +#endif + return s; +}