MCPcopy Create free account
hub / github.com/KDE/kdevelop / DisassembleWidget

Method DisassembleWidget

plugins/debuggercommon/widgets/disassemblewidget.cpp:206–279  ·  view source on GitHub ↗

/ / /

Source from the content-addressed store, hash-verified

204/***************************************************************************/
205/***************************************************************************/
206DisassembleWidget::DisassembleWidget(MIDebuggerPlugin*, QWidget* parent)
207 : QWidget(parent),
208 m_splitter(new KDevelop::AutoOrientedSplitter(this))
209{
210 auto* topLayout = new QVBoxLayout(this);
211 topLayout->setContentsMargins(0, 0, 0, 0);
212
213 { // initialize disasm/registers views
214 topLayout->addWidget(m_splitter);
215
216 //topLayout->setContentsMargins(0, 0, 0, 0);
217
218 m_disassembleWindow = new DisassembleWindow(m_splitter, this);
219
220 m_disassembleWindow->setWhatsThis(i18nc("@info:whatsthis", "<b>Machine code display</b><p>"
221 "A machine code view into your running "
222 "executable with the current instruction "
223 "highlighted. You can step instruction by "
224 "instruction using the debuggers toolbar "
225 "buttons of \"step over\" instruction and "
226 "\"step into\" instruction."));
227
228 m_disassembleWindow->setFont(QFontDatabase::systemFont(QFontDatabase::FixedFont));
229 m_disassembleWindow->setSelectionMode(QTreeWidget::SingleSelection);
230 m_disassembleWindow->setColumnCount(ColumnCount);
231 m_disassembleWindow->setUniformRowHeights(true);
232 m_disassembleWindow->setRootIsDecorated(false);
233
234 m_disassembleWindow->setHeaderLabels(QStringList{
235 QString(),
236 i18nc("@title:column", "Address"),
237 i18nc("@title:column", "Function"),
238 i18nc("@title:column", "Instruction")
239 });
240
241 m_splitter->setStretchFactor(0, 1);
242 m_splitter->setContentsMargins(0, 0, 0, 0);
243
244 m_registersManager = new RegistersManager(m_splitter);
245
246 m_config = KSharedConfig::openConfig()->group(QStringLiteral("Disassemble/Registers View"));
247
248 QByteArray state = m_config.readEntry<QByteArray>("splitterState", QByteArray());
249 if (!state.isEmpty()) {
250 m_splitter->restoreState(state);
251 }
252
253 }
254
255 setLayout(topLayout);
256
257 setWindowIcon( QIcon::fromTheme(QStringLiteral("system-run"), windowIcon()) );
258 setWindowTitle(i18nc("@title:window", "Disassemble/Registers View"));
259
260 KDevelop::IDebugController* pDC=KDevelop::ICore::self()->debugController();
261 Q_ASSERT(pDC);
262
263 connect(pDC,

Callers

nothing calls this directly

Calls 9

setHeaderLabelsMethod · 0.80
restoreStateMethod · 0.80
debugControllerMethod · 0.80
currentSessionMethod · 0.80
currentAddrMethod · 0.80
QStringClass · 0.50
QByteArrayClass · 0.50
addWidgetMethod · 0.45
isEmptyMethod · 0.45

Tested by

no test coverage detected