| 1 |
3 |
sergeykhbr |
#include "DbgMainWindow.h"
|
| 2 |
|
|
#include "moc_DbgMainWindow.h"
|
| 3 |
|
|
#include "ControlWidget/PnpWidget.h"
|
| 4 |
|
|
#include "CpuWidgets/RegsViewWidget.h"
|
| 5 |
|
|
#include "CpuWidgets/AsmViewWidget.h"
|
| 6 |
|
|
#include "CpuWidgets/MemViewWidget.h"
|
| 7 |
|
|
#include "CpuWidgets/SymbolBrowserWidget.h"
|
| 8 |
|
|
#include "CpuWidgets/StackTraceWidget.h"
|
| 9 |
|
|
#include "ControlWidget/ConsoleWidget.h"
|
| 10 |
|
|
#include "PeriphWidgets/UartWidget.h"
|
| 11 |
|
|
#include "PeriphWidgets/GpioWidget.h"
|
| 12 |
|
|
#include "GnssWidgets/MapWidget.h"
|
| 13 |
|
|
#include <QtWidgets/QtWidgets>
|
| 14 |
|
|
|
| 15 |
|
|
namespace debugger {
|
| 16 |
|
|
|
| 17 |
|
|
DbgMainWindow::DbgMainWindow(IGui *igui) : QMainWindow() {
|
| 18 |
|
|
igui_ = igui;
|
| 19 |
|
|
//initDone_ = init_done;
|
| 20 |
|
|
statusRequested_ = false;
|
| 21 |
|
|
ebreak_ = 0;
|
| 22 |
|
|
|
| 23 |
|
|
setWindowTitle(tr("RISC-V platform debugger"));
|
| 24 |
|
|
resize(QDesktopWidget().availableGeometry(this).size() * 0.7);
|
| 25 |
|
|
|
| 26 |
|
|
listConsoleListeners_.make_list(0);
|
| 27 |
|
|
/** Console commands used by main window: */
|
| 28 |
|
|
cmdStatus_.make_string("status");
|
| 29 |
|
|
cmdRun_.make_string("c");
|
| 30 |
|
|
cmdHalt_.make_string("halt");
|
| 31 |
|
|
cmdStep_.make_string("c 1");
|
| 32 |
|
|
|
| 33 |
|
|
createActions();
|
| 34 |
|
|
createMenus();
|
| 35 |
|
|
createStatusBar();
|
| 36 |
|
|
createMdiWindow();
|
| 37 |
|
|
|
| 38 |
|
|
/** QT documeneted behaviour:
|
| 39 |
|
|
*
|
| 40 |
|
|
* If you add a child widget to an already visible widget
|
| 41 |
|
|
* you must explicitly show the child to make it visible.
|
| 42 |
|
|
*/
|
| 43 |
|
|
addWidgets();
|
| 44 |
|
|
|
| 45 |
|
|
setUnifiedTitleAndToolBarOnMac(true);
|
| 46 |
|
|
|
| 47 |
|
|
ISocInfo *isoc = static_cast<ISocInfo *>(igui_->getSocInfo());
|
| 48 |
|
|
if (isoc) {
|
| 49 |
|
|
DsuMapType *dsu = isoc->getpDsu();
|
| 50 |
|
|
ebreak_ = new EBreakHandler(igui_);
|
| 51 |
|
|
|
| 52 |
|
|
ebreak_->setBrAddressFetch(
|
| 53 |
|
|
reinterpret_cast<uint64_t>(&dsu->udbg.v.br_address_fetch));
|
| 54 |
|
|
ebreak_->setHwRemoveBreakpoint(
|
| 55 |
|
|
reinterpret_cast<uint64_t>(&dsu->udbg.v.remove_breakpoint));
|
| 56 |
|
|
}
|
| 57 |
|
|
|
| 58 |
|
|
/**
|
| 59 |
|
|
* To use the following type in SIGNAL -> SLOT definitions
|
| 60 |
|
|
* we have to register them using qRegisterMetaType template
|
| 61 |
|
|
*/
|
| 62 |
|
|
qRegisterMetaType<uint64_t>("uint64_t");
|
| 63 |
|
|
qRegisterMetaType<uint32_t>("uint32_t");
|
| 64 |
|
|
|
| 65 |
|
|
tmrGlobal_ = new QTimer(this);
|
| 66 |
|
|
connect(tmrGlobal_, SIGNAL(timeout()), this, SLOT(slotUpdateByTimer()));
|
| 67 |
|
|
tmrGlobal_->setSingleShot(false);
|
| 68 |
|
|
tmrGlobal_->setInterval(250);
|
| 69 |
|
|
tmrGlobal_->start();
|
| 70 |
|
|
}
|
| 71 |
|
|
|
| 72 |
|
|
DbgMainWindow::~DbgMainWindow() {
|
| 73 |
|
|
if (ebreak_) {
|
| 74 |
|
|
delete ebreak_;
|
| 75 |
|
|
}
|
| 76 |
|
|
igui_->removeFromQueue(static_cast<IGuiCmdHandler *>(this));
|
| 77 |
|
|
}
|
| 78 |
|
|
|
| 79 |
|
|
void DbgMainWindow::closeEvent(QCloseEvent *ev) {
|
| 80 |
|
|
tmrGlobal_->stop();
|
| 81 |
|
|
delete tmrGlobal_;
|
| 82 |
|
|
ev->accept();
|
| 83 |
|
|
emit signalAboutToClose();
|
| 84 |
|
|
}
|
| 85 |
|
|
|
| 86 |
|
|
#ifndef QT_NO_CONTEXTMENU
|
| 87 |
|
|
void DbgMainWindow::contextMenuEvent(QContextMenuEvent *ev_) {
|
| 88 |
|
|
QMenu menu(this);
|
| 89 |
|
|
menu.addAction(actionRegs_);
|
| 90 |
|
|
menu.exec(ev_->globalPos());
|
| 91 |
|
|
}
|
| 92 |
|
|
#endif
|
| 93 |
|
|
|
| 94 |
|
|
void DbgMainWindow::handleResponse(AttributeType *req, AttributeType *resp) {
|
| 95 |
|
|
if (req->is_equal(cmdStatus_.to_string())) {
|
| 96 |
|
|
statusRequested_ = false;
|
| 97 |
|
|
if (resp->is_nil()) {
|
| 98 |
|
|
return;
|
| 99 |
|
|
}
|
| 100 |
|
|
DsuMapType::udbg_type::debug_region_type::control_reg ctrl;
|
| 101 |
|
|
ctrl.val = resp->to_uint64();
|
| 102 |
|
|
if ((actionRun_->isChecked() && ctrl.bits.halt)
|
| 103 |
|
|
|| (!actionRun_->isChecked() && !ctrl.bits.halt)) {
|
| 104 |
|
|
emit signalTargetStateChanged(ctrl.bits.halt == 0);
|
| 105 |
|
|
}
|
| 106 |
|
|
if (ctrl.bits.breakpoint && ebreak_) {
|
| 107 |
|
|
ebreak_->skip();
|
| 108 |
|
|
}
|
| 109 |
|
|
#if 0
|
| 110 |
|
|
static const char *xSTATES[] = {"Idle", "WaitGrant", "WaitResp", "WaitAccept"};
|
| 111 |
|
|
static const char *CSTATES[] = {"Idle", "IMem", "DMem"};
|
| 112 |
|
|
RISCV_printf(0, 0, "istate=%s dstate=%s; cstate=%s",
|
| 113 |
|
|
xSTATES[ctrl.bits.istate],
|
| 114 |
|
|
xSTATES[ctrl.bits.dstate],
|
| 115 |
|
|
CSTATES[ctrl.bits.cstate]);
|
| 116 |
|
|
#endif
|
| 117 |
|
|
}
|
| 118 |
|
|
}
|
| 119 |
|
|
|
| 120 |
|
|
void DbgMainWindow::createActions() {
|
| 121 |
|
|
actionRegs_ = new QAction(QIcon(tr(":/images/cpu_96x96.png")),
|
| 122 |
|
|
tr("&Regs"), this);
|
| 123 |
|
|
actionRegs_->setToolTip(tr("CPU Registers view"));
|
| 124 |
|
|
actionRegs_->setShortcut(QKeySequence(tr("Ctrl+r")));
|
| 125 |
|
|
actionRegs_->setCheckable(true);
|
| 126 |
|
|
actionRegs_->setChecked(false);
|
| 127 |
|
|
connect(actionRegs_, SIGNAL(triggered(bool)),
|
| 128 |
|
|
this, SLOT(slotActionTriggerRegs(bool)));
|
| 129 |
|
|
|
| 130 |
|
|
actionCpuAsm_ = new QAction(QIcon(tr(":/images/asm_96x96.png")),
|
| 131 |
|
|
tr("&Memory"), this);
|
| 132 |
|
|
actionCpuAsm_->setToolTip(tr("Disassembler view"));
|
| 133 |
|
|
actionCpuAsm_->setShortcut(QKeySequence(tr("Ctrl+d")));
|
| 134 |
|
|
actionCpuAsm_->setCheckable(true);
|
| 135 |
|
|
connect(actionCpuAsm_, SIGNAL(triggered(bool)),
|
| 136 |
|
|
this, SLOT(slotActionTriggerCpuAsmView(bool)));
|
| 137 |
|
|
|
| 138 |
|
|
actionStackTrace_ = new QAction(QIcon(tr(":/images/stack_96x96.png")),
|
| 139 |
|
|
tr("&Stack"), this);
|
| 140 |
|
|
actionStackTrace_->setToolTip(tr("Stack trace"));
|
| 141 |
|
|
actionStackTrace_->setShortcut(QKeySequence(tr("Ctrl+t")));
|
| 142 |
|
|
actionStackTrace_->setCheckable(true);
|
| 143 |
|
|
connect(actionStackTrace_, SIGNAL(triggered(bool)),
|
| 144 |
|
|
this, SLOT(slotActionTriggerStackTraceView(bool)));
|
| 145 |
|
|
|
| 146 |
|
|
actionSymbolBrowser_ = new QAction(QIcon(tr(":/images/info_96x96.png")),
|
| 147 |
|
|
tr("&Symbols"), this);
|
| 148 |
|
|
actionSymbolBrowser_->setToolTip(tr("Symbol Browser"));
|
| 149 |
|
|
actionSymbolBrowser_->setShortcut(QKeySequence(tr("Ctrl+s")));
|
| 150 |
|
|
actionSymbolBrowser_->setCheckable(false);
|
| 151 |
|
|
connect(actionSymbolBrowser_, SIGNAL(triggered()),
|
| 152 |
|
|
this, SLOT(slotActionTriggerSymbolBrowser()));
|
| 153 |
|
|
|
| 154 |
|
|
actionMem_ = new QAction(QIcon(tr(":/images/mem_96x96.png")),
|
| 155 |
|
|
tr("&Memory"), this);
|
| 156 |
|
|
actionMem_->setToolTip(tr("Memory view"));
|
| 157 |
|
|
actionMem_->setShortcut(QKeySequence(tr("Ctrl+m")));
|
| 158 |
|
|
actionMem_->setCheckable(true);
|
| 159 |
|
|
actionMem_->setChecked(false);
|
| 160 |
|
|
connect(actionMem_, SIGNAL(triggered(bool)),
|
| 161 |
|
|
this, SLOT(slotActionTriggerMemView(bool)));
|
| 162 |
|
|
|
| 163 |
|
|
actionPnp_ = new QAction(QIcon(tr(":/images/board_96x96.png")),
|
| 164 |
|
|
tr("&Pnp"), this);
|
| 165 |
|
|
actionPnp_->setToolTip(tr("Plug'n'play information view"));
|
| 166 |
|
|
actionPnp_->setShortcut(QKeySequence(tr("Ctrl+p")));
|
| 167 |
|
|
actionPnp_->setCheckable(true);
|
| 168 |
|
|
actionPnp_->setChecked(false);
|
| 169 |
|
|
connect(actionPnp_, SIGNAL(triggered(bool)),
|
| 170 |
|
|
this, SLOT(slotActionTriggerPnp(bool)));
|
| 171 |
|
|
|
| 172 |
|
|
actionGpio_ = new QAction(QIcon(tr(":/images/gpio_96x96.png")),
|
| 173 |
|
|
tr("&GPIO"), this);
|
| 174 |
|
|
actionGpio_->setToolTip(tr("GPIO control view"));
|
| 175 |
|
|
actionGpio_->setCheckable(true);
|
| 176 |
|
|
actionGpio_->setChecked(false);
|
| 177 |
|
|
connect(actionGpio_, SIGNAL(triggered(bool)),
|
| 178 |
|
|
this, SLOT(slotActionTriggerGpio(bool)));
|
| 179 |
|
|
|
| 180 |
|
|
actionSerial_ = new QAction(QIcon(tr(":/images/serial_96x96.png")),
|
| 181 |
|
|
tr("&Serial port"), this);
|
| 182 |
|
|
actionSerial_->setToolTip(tr("Serial port console view"));
|
| 183 |
|
|
actionSerial_->setCheckable(true);
|
| 184 |
|
|
actionSerial_->setChecked(false);
|
| 185 |
|
|
connect(actionSerial_, SIGNAL(triggered(bool)),
|
| 186 |
|
|
this, SLOT(slotActionTriggerUart0(bool)));
|
| 187 |
|
|
|
| 188 |
|
|
actionGnssMap_ = new QAction(QIcon(tr(":/images/opmap_96x96.png")),
|
| 189 |
|
|
tr("&OpenStreetMap"), this);
|
| 190 |
|
|
actionGnssMap_->setToolTip(tr("Open Street map with GNSS tracks view"));
|
| 191 |
|
|
actionGnssMap_->setCheckable(true);
|
| 192 |
|
|
actionGnssMap_->setChecked(false);
|
| 193 |
|
|
connect(actionGnssMap_, SIGNAL(triggered(bool)),
|
| 194 |
|
|
this, SLOT(slotActionTriggerGnssMap(bool)));
|
| 195 |
|
|
|
| 196 |
|
|
actionRun_ = new QAction(QIcon(tr(":/images/start_96x96.png")),
|
| 197 |
|
|
tr("&Run"), this);
|
| 198 |
|
|
actionRun_->setToolTip(tr("Start Execution (F5)"));
|
| 199 |
|
|
actionRun_->setShortcut(QKeySequence(tr("F5")));
|
| 200 |
|
|
actionRun_->setCheckable(true);
|
| 201 |
|
|
actionRun_->setChecked(false);
|
| 202 |
|
|
connect(actionRun_ , SIGNAL(triggered()),
|
| 203 |
|
|
this, SLOT(slotActionTargetRun()));
|
| 204 |
|
|
connect(this, SIGNAL(signalTargetStateChanged(bool)),
|
| 205 |
|
|
actionRun_, SLOT(setChecked(bool)));
|
| 206 |
|
|
|
| 207 |
|
|
actionHalt_ = new QAction(QIcon(tr(":/images/pause_96x96.png")),
|
| 208 |
|
|
tr("&Halt"), this);
|
| 209 |
|
|
actionHalt_->setToolTip(tr("Stop Execution (Ctrl+Alt+F5)"));
|
| 210 |
|
|
actionHalt_->setShortcut(QKeySequence(tr("Ctrl+Alt+F5")));
|
| 211 |
|
|
connect(actionHalt_ , SIGNAL(triggered()),
|
| 212 |
|
|
this, SLOT(slotActionTargetHalt()));
|
| 213 |
|
|
|
| 214 |
|
|
actionStep_ = new QAction(QIcon(tr(":/images/stepinto_96x96.png")),
|
| 215 |
|
|
tr("&Step Into"), this);
|
| 216 |
|
|
actionStep_->setToolTip(tr("Instruction Step (F11)"));
|
| 217 |
|
|
actionStep_->setShortcut(QKeySequence(tr("F11")));
|
| 218 |
|
|
connect(actionStep_ , SIGNAL(triggered()),
|
| 219 |
|
|
this, SLOT(slotActionTargetStepInto()));
|
| 220 |
|
|
|
| 221 |
|
|
|
| 222 |
|
|
actionQuit_ = new QAction(tr("&Quit"), this);
|
| 223 |
|
|
actionQuit_->setShortcuts(QKeySequence::Quit);
|
| 224 |
|
|
actionQuit_->setStatusTip(tr("Quit the application"));
|
| 225 |
|
|
connect(actionQuit_, SIGNAL(triggered()), this, SLOT(close()));
|
| 226 |
|
|
|
| 227 |
|
|
actionAbout_ = new QAction(tr("&About"), this);
|
| 228 |
|
|
actionAbout_->setStatusTip(tr("Show the application's About box"));
|
| 229 |
|
|
connect(actionAbout_, SIGNAL(triggered()), this, SLOT(slotActionAbout()));
|
| 230 |
|
|
|
| 231 |
|
|
QToolBar *toolbarRunControl = addToolBar(tr("toolbarRunControl"));
|
| 232 |
|
|
toolbarRunControl->addAction(actionRun_);
|
| 233 |
|
|
toolbarRunControl->addAction(actionHalt_);
|
| 234 |
|
|
toolbarRunControl->addAction(actionStep_);
|
| 235 |
|
|
|
| 236 |
|
|
QToolBar *toolbarCpu = addToolBar(tr("toolbarCpu"));
|
| 237 |
|
|
toolbarCpu->addAction(actionCpuAsm_);
|
| 238 |
|
|
toolbarCpu->addAction(actionRegs_);
|
| 239 |
|
|
toolbarCpu->addAction(actionStackTrace_);
|
| 240 |
|
|
toolbarCpu->addAction(actionMem_);
|
| 241 |
|
|
QToolBar *toolbarPeriph = addToolBar(tr("toolbarPeriph"));
|
| 242 |
|
|
toolbarPeriph->addAction(actionPnp_);
|
| 243 |
|
|
}
|
| 244 |
|
|
|
| 245 |
|
|
void DbgMainWindow::createMenus() {
|
| 246 |
|
|
QMenu *menu = menuBar()->addMenu(tr("&File"));
|
| 247 |
|
|
menu->addAction(actionQuit_);
|
| 248 |
|
|
menu->addSeparator();
|
| 249 |
|
|
|
| 250 |
|
|
menu = menuBar()->addMenu(tr("&Views"));
|
| 251 |
|
|
menu->addAction(actionSerial_);
|
| 252 |
|
|
menu->addAction(actionGpio_);
|
| 253 |
|
|
menu->addAction(actionPnp_);
|
| 254 |
|
|
menu->addSeparator();
|
| 255 |
|
|
menu->addAction(actionRegs_);
|
| 256 |
|
|
menu->addAction(actionSymbolBrowser_);
|
| 257 |
|
|
|
| 258 |
|
|
menu = menuBar()->addMenu(tr("&GNSS"));
|
| 259 |
|
|
menu->addAction(actionGnssMap_);
|
| 260 |
|
|
|
| 261 |
|
|
menu = menuBar()->addMenu(tr("&Help"));
|
| 262 |
|
|
menu->addAction(actionAbout_);
|
| 263 |
|
|
}
|
| 264 |
|
|
|
| 265 |
|
|
|
| 266 |
|
|
void DbgMainWindow::createStatusBar() {
|
| 267 |
|
|
statusBar()->showMessage(tr("Ready"));
|
| 268 |
|
|
}
|
| 269 |
|
|
|
| 270 |
|
|
void DbgMainWindow::createMdiWindow() {
|
| 271 |
|
|
AttributeType cfgMdi(Attr_Dict);
|
| 272 |
|
|
cfgMdi["Tabbed"].make_boolean(false);
|
| 273 |
|
|
mdiArea_ = new MdiAreaWidget(cfgMdi, this);
|
| 274 |
|
|
setCentralWidget(mdiArea_);
|
| 275 |
|
|
|
| 276 |
|
|
/** Docked Widgets: */
|
| 277 |
|
|
QDockWidget *dock = new QDockWidget(tr("Debugger console"), this);
|
| 278 |
|
|
dock->setAllowedAreas(Qt::BottomDockWidgetArea);
|
| 279 |
|
|
addDockWidget(Qt::BottomDockWidgetArea, dock);
|
| 280 |
|
|
|
| 281 |
|
|
ConsoleWidget *consoleWidget = new ConsoleWidget(igui_, this);
|
| 282 |
|
|
dock->setWidget(consoleWidget);
|
| 283 |
|
|
}
|
| 284 |
|
|
|
| 285 |
|
|
void DbgMainWindow::addWidgets() {
|
| 286 |
|
|
slotActionTriggerUart0(true);
|
| 287 |
|
|
slotActionTriggerCpuAsmView(true);
|
| 288 |
|
|
|
| 289 |
|
|
//slotActionTriggerGnssMap(true);
|
| 290 |
|
|
}
|
| 291 |
|
|
|
| 292 |
|
|
void DbgMainWindow::slotActionTriggerUart0(bool val) {
|
| 293 |
|
|
if (val) {
|
| 294 |
|
|
viewUart0_ =
|
| 295 |
|
|
new UartQMdiSubWindow(igui_, mdiArea_, this, actionSerial_);
|
| 296 |
|
|
} else {
|
| 297 |
|
|
viewUart0_->close();
|
| 298 |
|
|
}
|
| 299 |
|
|
}
|
| 300 |
|
|
|
| 301 |
|
|
void DbgMainWindow::slotActionTriggerCpuAsmView(bool val) {
|
| 302 |
|
|
if (val) {
|
| 303 |
|
|
viewCpuAsm_ =
|
| 304 |
|
|
new AsmQMdiSubWindow(igui_, mdiArea_, this, actionCpuAsm_);
|
| 305 |
|
|
} else {
|
| 306 |
|
|
viewCpuAsm_->close();
|
| 307 |
|
|
}
|
| 308 |
|
|
}
|
| 309 |
|
|
|
| 310 |
|
|
void DbgMainWindow::slotActionTriggerRegs(bool val) {
|
| 311 |
|
|
if (val) {
|
| 312 |
|
|
viewRegs_ = new RegsQMdiSubWindow(igui_, mdiArea_, this,
|
| 313 |
|
|
actionRegs_);
|
| 314 |
|
|
} else {
|
| 315 |
|
|
viewRegs_->close();
|
| 316 |
|
|
}
|
| 317 |
|
|
}
|
| 318 |
|
|
|
| 319 |
|
|
void DbgMainWindow::slotActionTriggerStackTraceView(bool val) {
|
| 320 |
|
|
if (val) {
|
| 321 |
|
|
viewStackTrace_ =
|
| 322 |
|
|
new StackTraceQMdiSubWindow(igui_, mdiArea_, this, actionStackTrace_);
|
| 323 |
|
|
} else {
|
| 324 |
|
|
viewStackTrace_->close();
|
| 325 |
|
|
}
|
| 326 |
|
|
}
|
| 327 |
|
|
|
| 328 |
|
|
void DbgMainWindow::slotActionTriggerMemView(bool val) {
|
| 329 |
|
|
if (val) {
|
| 330 |
|
|
viewMem_ = new MemQMdiSubWindow(igui_, mdiArea_, this,
|
| 331 |
|
|
0xfffff000, 20, actionMem_);
|
| 332 |
|
|
} else {
|
| 333 |
|
|
viewMem_->close();
|
| 334 |
|
|
}
|
| 335 |
|
|
}
|
| 336 |
|
|
|
| 337 |
|
|
void DbgMainWindow::slotActionTriggerGpio(bool val) {
|
| 338 |
|
|
if (val) {
|
| 339 |
|
|
viewGpio_ = new GpioQMdiSubWindow(igui_, mdiArea_, this,
|
| 340 |
|
|
actionGpio_);
|
| 341 |
|
|
} else {
|
| 342 |
|
|
viewGpio_->close();
|
| 343 |
|
|
}
|
| 344 |
|
|
}
|
| 345 |
|
|
|
| 346 |
|
|
void DbgMainWindow::slotActionTriggerPnp(bool val) {
|
| 347 |
|
|
if (val) {
|
| 348 |
|
|
viewPnp_ = new PnpQMdiSubWindow(igui_, mdiArea_, this,
|
| 349 |
|
|
actionPnp_);
|
| 350 |
|
|
} else {
|
| 351 |
|
|
viewPnp_->close();
|
| 352 |
|
|
}
|
| 353 |
|
|
}
|
| 354 |
|
|
|
| 355 |
|
|
void DbgMainWindow::slotActionTriggerGnssMap(bool val) {
|
| 356 |
|
|
if (val) {
|
| 357 |
|
|
viewGnssMap_ =
|
| 358 |
|
|
new MapQMdiSubWindow(igui_, mdiArea_, this, actionGnssMap_);
|
| 359 |
|
|
} else {
|
| 360 |
|
|
viewGnssMap_->close();
|
| 361 |
|
|
}
|
| 362 |
|
|
}
|
| 363 |
|
|
|
| 364 |
|
|
|
| 365 |
|
|
void DbgMainWindow::slotActionTriggerSymbolBrowser() {
|
| 366 |
|
|
new SymbolBrowserQMdiSubWindow(igui_, mdiArea_, this);
|
| 367 |
|
|
}
|
| 368 |
|
|
|
| 369 |
|
|
void DbgMainWindow::slotOpenDisasm(uint64_t addr, uint64_t sz) {
|
| 370 |
|
|
new AsmQMdiSubWindow(igui_, mdiArea_, this, NULL, addr);
|
| 371 |
|
|
}
|
| 372 |
|
|
|
| 373 |
|
|
void DbgMainWindow::slotOpenMemory(uint64_t addr, uint64_t sz) {
|
| 374 |
|
|
new MemQMdiSubWindow(igui_, mdiArea_, this, addr, sz);
|
| 375 |
|
|
}
|
| 376 |
|
|
|
| 377 |
|
|
//void DbgMainWindow::slotPostInit(AttributeType *cfg) {
|
| 378 |
|
|
// config_ = *cfg;
|
| 379 |
|
|
// Enable polling timer:
|
| 380 |
|
|
//connect(tmrGlobal_, SIGNAL(timeout()), this, SLOT(slotUpdateByTimer()));
|
| 381 |
|
|
//int ms = static_cast<int>(config_["PollingMs"].to_uint64());
|
| 382 |
|
|
//tmrGlobal_->setInterval(ms);
|
| 383 |
|
|
//tmrGlobal_->setSingleShot(false);
|
| 384 |
|
|
//tmrGlobal_->start(ms);
|
| 385 |
|
|
|
| 386 |
|
|
|
| 387 |
|
|
// Debug:
|
| 388 |
|
|
//slotActionTriggerGnssMap(true);
|
| 389 |
|
|
//}
|
| 390 |
|
|
|
| 391 |
|
|
void DbgMainWindow::slotUpdateByTimer() {
|
| 392 |
|
|
if (!statusRequested_) {
|
| 393 |
|
|
statusRequested_ = true;
|
| 394 |
|
|
igui_->registerCommand(static_cast<IGuiCmdHandler *>(this),
|
| 395 |
|
|
&cmdStatus_, true);
|
| 396 |
|
|
}
|
| 397 |
|
|
emit signalUpdateByTimer();
|
| 398 |
|
|
}
|
| 399 |
|
|
|
| 400 |
|
|
void DbgMainWindow::slotActionAbout() {
|
| 401 |
|
|
char date[128];
|
| 402 |
|
|
memcpy(date, __DATE__, sizeof(date));
|
| 403 |
|
|
QString build;
|
| 404 |
|
|
build.sprintf("Version: 1.0\nBuild: %s\n", date);
|
| 405 |
|
|
build += tr("Author: Sergey Khabarov\n");
|
| 406 |
|
|
build += tr("git: http://github.com/sergeykhbr/riscv_vhdl\n");
|
| 407 |
|
|
build += tr("e-mail: sergeykhbr@gmail.com\n\n\n"
|
| 408 |
|
|
"RISC-V debugger GUI plugin is the open source extension of\n"
|
| 409 |
|
|
"the base RISC-V debugger functionality providing friendly interface\n"
|
| 410 |
|
|
"with running SoC target or with the Simulated platform.\n"
|
| 411 |
|
|
"\n"
|
| 412 |
|
|
"This extension doesn't use any specific for GUI scripts or commands\n"
|
| 413 |
|
|
"and all shown information maybe achievied using debugger's console\n"
|
| 414 |
|
|
"commands. See 'help' command.\n\n"
|
| 415 |
|
|
);
|
| 416 |
|
|
build += tr("www.gnss-sensor.com\n");
|
| 417 |
|
|
|
| 418 |
|
|
QMessageBox::about(this, tr("About GUI plugin"), build);
|
| 419 |
|
|
}
|
| 420 |
|
|
|
| 421 |
|
|
void DbgMainWindow::slotActionTargetRun() {
|
| 422 |
|
|
actionRun_->setChecked(true);
|
| 423 |
|
|
igui_->registerCommand(static_cast<IGuiCmdHandler *>(this),
|
| 424 |
|
|
&cmdRun_, true);
|
| 425 |
|
|
}
|
| 426 |
|
|
|
| 427 |
|
|
void DbgMainWindow::slotActionTargetHalt() {
|
| 428 |
|
|
igui_->registerCommand(static_cast<IGuiCmdHandler *>(this),
|
| 429 |
|
|
&cmdHalt_, true);
|
| 430 |
|
|
}
|
| 431 |
|
|
|
| 432 |
|
|
void DbgMainWindow::slotActionTargetStepInto() {
|
| 433 |
|
|
igui_->registerCommand(static_cast<IGuiCmdHandler *>(this),
|
| 434 |
|
|
&cmdStep_, true);
|
| 435 |
|
|
}
|
| 436 |
|
|
|
| 437 |
|
|
/** Redraw all opened disassembler views */
|
| 438 |
|
|
void DbgMainWindow::slotBreakpointsChanged() {
|
| 439 |
|
|
emit signalRedrawDisasm();
|
| 440 |
|
|
}
|
| 441 |
|
|
|
| 442 |
|
|
} // namespace debugger
|
| 443 |
|
|
|