X-Git-Url: http://git.hcoop.net/clinton/Virtual-Jaguar-Rx.git/blobdiff_plain/bc10fc4217b2e150831e80fb9ac66998f1d075dd..f0dd2f7b7cc2f165b00dedcbc5bf6fbaa2ca136d:/src/debugger/debuggertab.cpp diff --git a/src/debugger/debuggertab.cpp b/src/debugger/debuggertab.cpp index 07a6629..d6135e8 100644 --- a/src/debugger/debuggertab.cpp +++ b/src/debugger/debuggertab.cpp @@ -7,33 +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; - layout2->addWidget(edit3); - - QHBoxLayout * layout3 = new QHBoxLayout; + QVBoxLayout *layout2 = new QVBoxLayout; + nbrdisasmlines = new QLineEdit(""); + nbrdisasmlines->setPlaceholderText("Number of disassembly lines"); + layout2->addWidget(nbrdisasmlines); + + // 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; 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")); @@ -49,6 +64,7 @@ DebuggerTab::DebuggerTab(QWidget * parent/*= 0*/): QWidget(parent) } +// DebuggerTab::~DebuggerTab() { } @@ -59,11 +75,9 @@ void DebuggerTab::SetSettings(void) { bool ok; - //strcpy(vjs.debuggerROMPath, debuggerTab->edit1->text().toUtf8().data()); strcpy(vjs.debuggerROMPath, vjs.alpineROMPath); - //strcpy(vjs.absROMPath, debuggerTab->edit2->text().toUtf8().data()); - vjs.nbrdisasmlines = edit3->text().toUInt(&ok, 10); - //vjs.allowWritesToROM = debuggerTab->writeROM->isChecked(); + 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(); @@ -74,12 +88,28 @@ void DebuggerTab::SetSettings(void) 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 + 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; +}