Changeset View
Changeset View
Standalone View
Standalone View
debuggers/gdb/disassemblewidget.cpp
Show First 20 Lines • Show All 313 Lines • ▼ Show 20 Line(s) | |||||
314 | void DisassembleWidget::disassembleMemoryRegion(const QString& from, const QString& to) | 314 | void DisassembleWidget::disassembleMemoryRegion(const QString& from, const QString& to) | ||
315 | { | 315 | { | ||
316 | DebugSession *s = qobject_cast<DebugSession*>(KDevelop::ICore:: | 316 | DebugSession *s = qobject_cast<DebugSession*>(KDevelop::ICore:: | ||
317 | self()->debugController()->currentSession()); | 317 | self()->debugController()->currentSession()); | ||
318 | if(!s || !s->isRunning()) return; | 318 | if(!s || !s->isRunning()) return; | ||
319 | 319 | | |||
320 | //only get $pc | 320 | //only get $pc | ||
321 | if (from.isEmpty()){ | 321 | if (from.isEmpty()){ | ||
322 | s->addCommand( | 322 | s->addCommand(DataDisassemble, "-s \"$pc\" -e \"$pc+1\" -- 0", | ||
323 | new MICommand(DataDisassemble, "-s \"$pc\" -e \"$pc+1\" -- 0", this, &DisassembleWidget::updateExecutionAddressHandler ) ); | 323 | this, &DisassembleWidget::updateExecutionAddressHandler); | ||
324 | }else{ | 324 | }else{ | ||
325 | 325 | | |||
326 | QString cmd = (to.isEmpty())? | 326 | QString cmd = (to.isEmpty())? | ||
327 | QString("-s %1 -e \"%1 + 256\" -- 0").arg(from ): | 327 | QString("-s %1 -e \"%1 + 256\" -- 0").arg(from ): | ||
328 | QString("-s %1 -e %2+1 -- 0").arg(from).arg(to); // if both addr set | 328 | QString("-s %1 -e %2+1 -- 0").arg(from).arg(to); // if both addr set | ||
329 | 329 | | |||
330 | s->addCommand( | 330 | s->addCommand(DataDisassemble, cmd, | ||
331 | new MICommand(DataDisassemble, cmd, this, &DisassembleWidget::disassembleMemoryHandler ) ); | 331 | this, &DisassembleWidget::disassembleMemoryHandler); | ||
332 | } | 332 | } | ||
333 | } | 333 | } | ||
334 | 334 | | |||
335 | /***************************************************************************/ | 335 | /***************************************************************************/ | ||
336 | 336 | | |||
337 | void DisassembleWidget::disassembleMemoryHandler(const ResultRecord& r) | 337 | void DisassembleWidget::disassembleMemoryHandler(const ResultRecord& r) | ||
338 | { | 338 | { | ||
339 | const Value& content = r["asm_insns"]; | 339 | const Value& content = r["asm_insns"]; | ||
▲ Show 20 Lines • Show All 98 Lines • Show Last 20 Lines |