forked from qt-creator/qt-creator
debugger: remove old disassembler view and handler
It is replaced by a real editor in e82d6c7b0
.
This commit is contained in:
@@ -1257,8 +1257,13 @@ bool CdbDebugEnginePrivate::attemptBreakpointSynchronization(QString *errorMessa
|
||||
return ok;
|
||||
}
|
||||
|
||||
void CdbDebugEngine::reloadDisassembler()
|
||||
void CdbDebugEngine::fetchDisassembler(DisassemblerViewAgent *agent,
|
||||
const StackFrame &frame)
|
||||
{
|
||||
// was: void CdbDebugEngine::reloadDisassembler()
|
||||
// use agent->address() to create a listing
|
||||
|
||||
/*
|
||||
enum { ContextLines = 40 };
|
||||
// Do we have a top stack frame?
|
||||
const ULONG64 offset = m_d->m_currentStackTrace ? m_d->m_currentStackTrace->instructionOffset() : ULONG64(0);
|
||||
@@ -1283,6 +1288,7 @@ void CdbDebugEngine::reloadDisassembler()
|
||||
} else {
|
||||
dh->setLines(QList<DisassemblerLine>());
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
void CdbDebugEngine::reloadModules()
|
||||
|
@@ -39,6 +39,7 @@ namespace Debugger {
|
||||
namespace Internal {
|
||||
|
||||
class DebuggerManager;
|
||||
class DisassemblerViewAgent;
|
||||
class CdbDebugEventCallback;
|
||||
class CdbDebugOutput;
|
||||
struct CdbDebugEnginePrivate;
|
||||
@@ -86,7 +87,8 @@ public:
|
||||
|
||||
virtual void attemptBreakpointSynchronization();
|
||||
|
||||
virtual void reloadDisassembler();
|
||||
virtual void fetchDisassembler(DisassemblerViewAgent *agent,
|
||||
const StackFrame &frame);
|
||||
|
||||
virtual void reloadModules();
|
||||
virtual void loadSymbols(const QString &moduleName);
|
||||
|
@@ -29,8 +29,6 @@ HEADERS += \
|
||||
debuggerplugin.h \
|
||||
debuggerrunner.h \
|
||||
debuggertooltip.h \
|
||||
disassemblerhandler.h \
|
||||
disassemblerwindow.h \
|
||||
watchutils.h \
|
||||
idebuggerengine.h \
|
||||
imports.h \
|
||||
@@ -59,8 +57,6 @@ SOURCES += \
|
||||
debuggerplugin.cpp \
|
||||
debuggerrunner.cpp \
|
||||
debuggertooltip.cpp \
|
||||
disassemblerhandler.cpp \
|
||||
disassemblerwindow.cpp \
|
||||
watchutils.cpp \
|
||||
moduleshandler.cpp \
|
||||
moduleswindow.cpp \
|
||||
|
@@ -35,7 +35,6 @@
|
||||
#include "idebuggerengine.h"
|
||||
|
||||
#include "breakwindow.h"
|
||||
#include "disassemblerwindow.h"
|
||||
#include "debuggeroutputwindow.h"
|
||||
#include "moduleswindow.h"
|
||||
#include "registerwindow.h"
|
||||
@@ -44,7 +43,6 @@
|
||||
#include "threadswindow.h"
|
||||
#include "watchwindow.h"
|
||||
|
||||
#include "disassemblerhandler.h"
|
||||
#include "breakhandler.h"
|
||||
#include "moduleshandler.h"
|
||||
#include "registerhandler.h"
|
||||
@@ -208,7 +206,6 @@ void DebuggerManager::init()
|
||||
|
||||
m_runControl = 0;
|
||||
|
||||
m_disassemblerHandler = 0;
|
||||
m_modulesHandler = 0;
|
||||
m_registerHandler = 0;
|
||||
|
||||
@@ -216,7 +213,6 @@ void DebuggerManager::init()
|
||||
m_statusLabel->setMinimumSize(QSize(30, 10));
|
||||
|
||||
m_breakWindow = new BreakWindow;
|
||||
m_disassemblerWindow = new DisassemblerWindow;
|
||||
m_modulesWindow = new ModulesWindow(this);
|
||||
m_outputWindow = new DebuggerOutputWindow;
|
||||
m_registerWindow = new RegisterWindow(this);
|
||||
@@ -252,14 +248,6 @@ void DebuggerManager::init()
|
||||
connect(threadsView, SIGNAL(threadSelected(int)),
|
||||
this, SLOT(selectThread(int)));
|
||||
|
||||
// Disassembler
|
||||
m_disassemblerHandler = new DisassemblerHandler;
|
||||
QAbstractItemView *disassemblerView =
|
||||
qobject_cast<QAbstractItemView *>(m_disassemblerWindow);
|
||||
disassemblerView->setModel(m_disassemblerHandler->model());
|
||||
connect(m_disassemblerWindow, SIGNAL(reloadDisassemblerRequested()),
|
||||
this, SLOT(reloadDisassembler()));
|
||||
|
||||
// Breakpoints
|
||||
m_breakHandler = new BreakHandler(this);
|
||||
QAbstractItemView *breakView =
|
||||
@@ -419,10 +407,6 @@ void DebuggerManager::init()
|
||||
|
||||
m_breakDock = m_mainWindow->addDockForWidget(m_breakWindow);
|
||||
|
||||
m_disassemblerDock = m_mainWindow->addDockForWidget(m_disassemblerWindow);
|
||||
connect(m_disassemblerDock->toggleViewAction(), SIGNAL(toggled(bool)),
|
||||
this, SLOT(reloadDisassembler()), Qt::QueuedConnection);
|
||||
|
||||
m_modulesDock = m_mainWindow->addDockForWidget(m_modulesWindow);
|
||||
connect(m_modulesDock->toggleViewAction(), SIGNAL(toggled(bool)),
|
||||
this, SLOT(reloadModules()), Qt::QueuedConnection);
|
||||
@@ -505,7 +489,6 @@ void DebuggerManager::setSimpleDockWidgetArrangement()
|
||||
}
|
||||
|
||||
m_mainWindow->tabifyDockWidget(m_watchDock, m_breakDock);
|
||||
m_mainWindow->tabifyDockWidget(m_watchDock, m_disassemblerDock);
|
||||
m_mainWindow->tabifyDockWidget(m_watchDock, m_modulesDock);
|
||||
m_mainWindow->tabifyDockWidget(m_watchDock, m_outputDock);
|
||||
m_mainWindow->tabifyDockWidget(m_watchDock, m_registerDock);
|
||||
@@ -516,7 +499,6 @@ void DebuggerManager::setSimpleDockWidgetArrangement()
|
||||
// saves cycles since the corresponding information won't be retrieved.
|
||||
m_sourceFilesDock->hide();
|
||||
m_registerDock->hide();
|
||||
m_disassemblerDock->hide();
|
||||
m_modulesDock->hide();
|
||||
m_outputDock->hide();
|
||||
m_mainWindow->setTrackingEnabled(true);
|
||||
@@ -613,7 +595,6 @@ void DebuggerManager::shutdown()
|
||||
// Delete these manually before deleting the manager
|
||||
// (who will delete the models for most views)
|
||||
doDelete(m_breakWindow);
|
||||
doDelete(m_disassemblerWindow);
|
||||
doDelete(m_modulesWindow);
|
||||
doDelete(m_outputWindow);
|
||||
doDelete(m_registerWindow);
|
||||
@@ -625,7 +606,6 @@ void DebuggerManager::shutdown()
|
||||
doDelete(m_localsWindow);
|
||||
|
||||
doDelete(m_breakHandler);
|
||||
doDelete(m_disassemblerHandler);
|
||||
doDelete(m_threadsHandler);
|
||||
doDelete(m_modulesHandler);
|
||||
doDelete(m_registerHandler);
|
||||
@@ -759,7 +739,7 @@ static IDebuggerEngine *determineDebuggerEngine(const QString &executable,
|
||||
return scriptEngine;
|
||||
}
|
||||
|
||||
#ifndef Q_OS_WIN
|
||||
#ifndef Q_OS_WIN
|
||||
Q_UNUSED(settingsIdHint)
|
||||
if (!gdbEngine) {
|
||||
*errorMessage = msgEngineNotAvailable("Gdb Engine");
|
||||
@@ -876,7 +856,6 @@ void DebuggerManager::cleanupViews()
|
||||
breakHandler()->setAllPending();
|
||||
stackHandler()->removeAll();
|
||||
threadsHandler()->removeAll();
|
||||
disassemblerHandler()->removeAll();
|
||||
modulesHandler()->removeAll();
|
||||
watchHandler()->cleanup();
|
||||
m_sourceFilesWindow->removeAll();
|
||||
@@ -1176,7 +1155,6 @@ void DebuggerManager::setBusyCursor(bool busy)
|
||||
|
||||
QCursor cursor(busy ? Qt::BusyCursor : Qt::ArrowCursor);
|
||||
m_breakWindow->setCursor(cursor);
|
||||
m_disassemblerWindow->setCursor(cursor);
|
||||
m_localsWindow->setCursor(cursor);
|
||||
m_modulesWindow->setCursor(cursor);
|
||||
m_outputWindow->setCursor(cursor);
|
||||
@@ -1308,25 +1286,6 @@ void DebuggerManager::stepByInstructionTriggered()
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Disassembler specific stuff
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
void DebuggerManager::reloadDisassembler()
|
||||
{
|
||||
if (m_engine && m_disassemblerDock && m_disassemblerDock->isVisible())
|
||||
m_engine->reloadDisassembler();
|
||||
}
|
||||
|
||||
void DebuggerManager::disassemblerDockToggled(bool on)
|
||||
{
|
||||
if (on)
|
||||
reloadDisassembler();
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Source files specific stuff
|
||||
|
@@ -73,7 +73,6 @@ class DebugMode;
|
||||
|
||||
class BreakHandler;
|
||||
class BreakpointData;
|
||||
class DisassemblerHandler;
|
||||
class ModulesHandler;
|
||||
class RegisterHandler;
|
||||
class SourceFilesWindow;
|
||||
@@ -219,7 +218,6 @@ private:
|
||||
virtual void notifyInferiorExited() = 0;
|
||||
virtual void notifyInferiorPidChanged(qint64) = 0;
|
||||
|
||||
virtual DisassemblerHandler *disassemblerHandler() = 0;
|
||||
virtual ModulesHandler *modulesHandler() = 0;
|
||||
virtual BreakHandler *breakHandler() = 0;
|
||||
virtual RegisterHandler *registerHandler() = 0;
|
||||
@@ -232,7 +230,6 @@ private:
|
||||
virtual void showDebuggerOutput(int channel, const QString &msg) = 0;
|
||||
virtual void showDebuggerInput(int channel, const QString &msg) = 0;
|
||||
|
||||
virtual void reloadDisassembler() = 0;
|
||||
virtual void reloadModules() = 0;
|
||||
virtual void reloadSourceFiles() = 0;
|
||||
virtual void reloadRegisters() = 0;
|
||||
@@ -330,9 +327,6 @@ private slots:
|
||||
void showDebuggerInput(int channel, const QString &msg);
|
||||
void showApplicationOutput(const QString &data);
|
||||
|
||||
void reloadDisassembler();
|
||||
void disassemblerDockToggled(bool on);
|
||||
|
||||
void reloadSourceFiles();
|
||||
void sourceFilesDockToggled(bool on);
|
||||
|
||||
@@ -353,7 +347,6 @@ private:
|
||||
//
|
||||
// Implementation of IDebuggerManagerAccessForEngines
|
||||
//
|
||||
DisassemblerHandler *disassemblerHandler() { return m_disassemblerHandler; }
|
||||
ModulesHandler *modulesHandler() { return m_modulesHandler; }
|
||||
BreakHandler *breakHandler() { return m_breakHandler; }
|
||||
RegisterHandler *registerHandler() { return m_registerHandler; }
|
||||
@@ -438,7 +431,6 @@ private:
|
||||
Core::Utils::FancyMainWindow *m_mainWindow;
|
||||
QLabel *m_statusLabel;
|
||||
QDockWidget *m_breakDock;
|
||||
QDockWidget *m_disassemblerDock;
|
||||
QDockWidget *m_modulesDock;
|
||||
QDockWidget *m_outputDock;
|
||||
QDockWidget *m_registerDock;
|
||||
@@ -448,7 +440,6 @@ private:
|
||||
QDockWidget *m_watchDock;
|
||||
|
||||
BreakHandler *m_breakHandler;
|
||||
DisassemblerHandler *m_disassemblerHandler;
|
||||
ModulesHandler *m_modulesHandler;
|
||||
RegisterHandler *m_registerHandler;
|
||||
StackHandler *m_stackHandler;
|
||||
@@ -474,7 +465,6 @@ private:
|
||||
QAction *m_reverseDirectionAction;
|
||||
|
||||
QWidget *m_breakWindow;
|
||||
QWidget *m_disassemblerWindow;
|
||||
QWidget *m_localsWindow;
|
||||
QWidget *m_registerWindow;
|
||||
QWidget *m_modulesWindow;
|
||||
|
@@ -1,194 +0,0 @@
|
||||
/**************************************************************************
|
||||
**
|
||||
** This file is part of Qt Creator
|
||||
**
|
||||
** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
||||
**
|
||||
** Contact: Nokia Corporation (qt-info@nokia.com)
|
||||
**
|
||||
** Commercial Usage
|
||||
**
|
||||
** Licensees holding valid Qt Commercial licenses may use this file in
|
||||
** accordance with the Qt Commercial License Agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and Nokia.
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
**
|
||||
** Alternatively, this file may be used under the terms of the GNU Lesser
|
||||
** General Public License version 2.1 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPL included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 2.1 requirements
|
||||
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||
**
|
||||
** If you are unsure which license is appropriate for your use, please
|
||||
** contact the sales department at http://qt.nokia.com/contact.
|
||||
**
|
||||
**************************************************************************/
|
||||
|
||||
#include "disassemblerhandler.h"
|
||||
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QtCore/QDebug>
|
||||
#include <QtCore/QAbstractTableModel>
|
||||
|
||||
#include <QtGui/QIcon>
|
||||
|
||||
using namespace Debugger;
|
||||
using namespace Debugger::Internal;
|
||||
|
||||
void DisassemblerLine::clear()
|
||||
{
|
||||
address.clear();
|
||||
symbol.clear();
|
||||
addressDisplay.clear();
|
||||
symbolDisplay.clear();
|
||||
mnemonic.clear();
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// DisassemblerModel
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////
|
||||
|
||||
/*! A model to represent the stack in a QTreeView. */
|
||||
class Debugger::Internal::DisassemblerModel : public QAbstractTableModel
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
DisassemblerModel(QObject *parent);
|
||||
|
||||
// ItemModel
|
||||
int rowCount(const QModelIndex &parent = QModelIndex()) const;
|
||||
int columnCount(const QModelIndex &parent = QModelIndex()) const;
|
||||
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
|
||||
QVariant headerData(int section, Qt::Orientation orientation,
|
||||
int role = Qt::DisplayRole) const;
|
||||
|
||||
// Properties
|
||||
void setLines(const QList<DisassemblerLine> &lines);
|
||||
QList<DisassemblerLine> lines() const;
|
||||
void setCurrentLine(int line) { m_currentLine = line; }
|
||||
|
||||
private:
|
||||
friend class DisassemblerHandler;
|
||||
QList<DisassemblerLine> m_lines;
|
||||
int m_currentLine;
|
||||
QIcon m_positionIcon;
|
||||
QIcon m_emptyIcon;
|
||||
};
|
||||
|
||||
DisassemblerModel::DisassemblerModel(QObject *parent)
|
||||
: QAbstractTableModel(parent), m_currentLine(0)
|
||||
{
|
||||
m_emptyIcon = QIcon(":/debugger/images/empty.svg");
|
||||
m_positionIcon = QIcon(":/debugger/images/location.svg");
|
||||
}
|
||||
|
||||
int DisassemblerModel::rowCount(const QModelIndex &parent) const
|
||||
{
|
||||
Q_UNUSED(parent)
|
||||
return m_lines.size();
|
||||
}
|
||||
|
||||
int DisassemblerModel::columnCount(const QModelIndex &parent) const
|
||||
{
|
||||
Q_UNUSED(parent)
|
||||
return 3;
|
||||
}
|
||||
|
||||
QVariant DisassemblerModel::data(const QModelIndex &index, int role) const
|
||||
{
|
||||
if (!index.isValid() || index.row() >= m_lines.size())
|
||||
return QVariant();
|
||||
|
||||
const DisassemblerLine &line = m_lines.at(index.row());
|
||||
|
||||
if (role == Qt::DisplayRole) {
|
||||
switch (index.column()) {
|
||||
case 0:
|
||||
return line.addressDisplay;
|
||||
case 1:
|
||||
return line.symbolDisplay;
|
||||
case 2:
|
||||
return line.mnemonic;
|
||||
}
|
||||
} else if (role == Qt::ToolTipRole) {
|
||||
return QString();
|
||||
} else if (role == Qt::DecorationRole && index.column() == 0) {
|
||||
// Return icon that indicates whether this is the active stack frame
|
||||
return (index.row() == m_currentLine) ? m_positionIcon : m_emptyIcon;
|
||||
}
|
||||
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
QVariant DisassemblerModel::headerData(int section, Qt::Orientation orientation,
|
||||
int role) const
|
||||
{
|
||||
if (orientation == Qt::Horizontal && role == Qt::DisplayRole) {
|
||||
switch (section) {
|
||||
case 1: return DisassemblerHandler::tr("Address");
|
||||
case 2: return DisassemblerHandler::tr("Symbol");
|
||||
case 3: return DisassemblerHandler::tr("Mnemonic");
|
||||
};
|
||||
}
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
void DisassemblerModel::setLines(const QList<DisassemblerLine> &lines)
|
||||
{
|
||||
m_lines = lines;
|
||||
if (m_currentLine >= m_lines.size())
|
||||
m_currentLine = m_lines.size() - 1;
|
||||
reset();
|
||||
}
|
||||
|
||||
QList<DisassemblerLine> DisassemblerModel::lines() const
|
||||
{
|
||||
return m_lines;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// DisassemblerHandler
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////
|
||||
|
||||
DisassemblerHandler::DisassemblerHandler()
|
||||
{
|
||||
m_model = new DisassemblerModel(this);
|
||||
}
|
||||
|
||||
void DisassemblerHandler::removeAll()
|
||||
{
|
||||
m_model->m_lines.clear();
|
||||
}
|
||||
|
||||
QAbstractItemModel *DisassemblerHandler::model() const
|
||||
{
|
||||
return m_model;
|
||||
}
|
||||
|
||||
void DisassemblerHandler::setLines(const QList<DisassemblerLine> &lines)
|
||||
{
|
||||
m_model->setLines(lines);
|
||||
}
|
||||
|
||||
QList<DisassemblerLine> DisassemblerHandler::lines() const
|
||||
{
|
||||
return m_model->lines();
|
||||
}
|
||||
|
||||
void DisassemblerHandler::setCurrentLine(int line)
|
||||
{
|
||||
m_model->setCurrentLine(line);
|
||||
}
|
||||
|
||||
#include "disassemblerhandler.moc"
|
@@ -1,77 +0,0 @@
|
||||
/**************************************************************************
|
||||
**
|
||||
** This file is part of Qt Creator
|
||||
**
|
||||
** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
||||
**
|
||||
** Contact: Nokia Corporation (qt-info@nokia.com)
|
||||
**
|
||||
** Commercial Usage
|
||||
**
|
||||
** Licensees holding valid Qt Commercial licenses may use this file in
|
||||
** accordance with the Qt Commercial License Agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and Nokia.
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
**
|
||||
** Alternatively, this file may be used under the terms of the GNU Lesser
|
||||
** General Public License version 2.1 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPL included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 2.1 requirements
|
||||
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||
**
|
||||
** If you are unsure which license is appropriate for your use, please
|
||||
** contact the sales department at http://qt.nokia.com/contact.
|
||||
**
|
||||
**************************************************************************/
|
||||
|
||||
#ifndef DISASSEMBLERHANDLER_H
|
||||
#define DISASSEMBLERHANDLER_H
|
||||
|
||||
#include <QtCore/QObject>
|
||||
#include <QtCore/QAbstractItemModel>
|
||||
|
||||
#include <QtGui/QIcon>
|
||||
|
||||
namespace Debugger {
|
||||
namespace Internal {
|
||||
|
||||
class DisassemblerLine
|
||||
{
|
||||
public:
|
||||
void clear();
|
||||
|
||||
QString address;
|
||||
QString symbol;
|
||||
QString addressDisplay;
|
||||
QString symbolDisplay;
|
||||
QString mnemonic;
|
||||
};
|
||||
|
||||
class DisassemblerModel;
|
||||
|
||||
class DisassemblerHandler : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
DisassemblerHandler();
|
||||
QAbstractItemModel *model() const;
|
||||
|
||||
public slots:
|
||||
void removeAll();
|
||||
|
||||
void setLines(const QList<DisassemblerLine> &lines);
|
||||
QList<DisassemblerLine> lines() const;
|
||||
void setCurrentLine(int line);
|
||||
|
||||
private:
|
||||
DisassemblerModel *m_model;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace Debugger
|
||||
|
||||
#endif // DISASSEMBLERHANDLER_H
|
@@ -1,134 +0,0 @@
|
||||
/**************************************************************************
|
||||
**
|
||||
** This file is part of Qt Creator
|
||||
**
|
||||
** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
||||
**
|
||||
** Contact: Nokia Corporation (qt-info@nokia.com)
|
||||
**
|
||||
** Commercial Usage
|
||||
**
|
||||
** Licensees holding valid Qt Commercial licenses may use this file in
|
||||
** accordance with the Qt Commercial License Agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and Nokia.
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
**
|
||||
** Alternatively, this file may be used under the terms of the GNU Lesser
|
||||
** General Public License version 2.1 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPL included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 2.1 requirements
|
||||
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||
**
|
||||
** If you are unsure which license is appropriate for your use, please
|
||||
** contact the sales department at http://qt.nokia.com/contact.
|
||||
**
|
||||
**************************************************************************/
|
||||
|
||||
#include "disassemblerwindow.h"
|
||||
#include "debuggeractions.h"
|
||||
|
||||
#include <QAction>
|
||||
#include <QDebug>
|
||||
#include <QHeaderView>
|
||||
#include <QMenu>
|
||||
#include <QResizeEvent>
|
||||
|
||||
|
||||
using namespace Debugger::Internal;
|
||||
|
||||
DisassemblerWindow::DisassemblerWindow()
|
||||
: m_alwaysResizeColumnsToContents(true), m_alwaysReloadContents(false)
|
||||
{
|
||||
QAction *act = theDebuggerAction(UseAlternatingRowColors);
|
||||
setWindowTitle(tr("Disassembler"));
|
||||
setSortingEnabled(false);
|
||||
setAlternatingRowColors(act->isChecked());
|
||||
setRootIsDecorated(false);
|
||||
header()->hide();
|
||||
connect(act, SIGNAL(toggled(bool)),
|
||||
this, SLOT(setAlternatingRowColorsHelper(bool)));
|
||||
}
|
||||
|
||||
void DisassemblerWindow::resizeEvent(QResizeEvent *ev)
|
||||
{
|
||||
//QHeaderView *hv = header();
|
||||
//int totalSize = ev->size().width() - 110;
|
||||
//hv->resizeSection(0, 60);
|
||||
//hv->resizeSection(1, (totalSize * 50) / 100);
|
||||
//hv->resizeSection(2, (totalSize * 50) / 100);
|
||||
//hv->resizeSection(3, 50);
|
||||
QTreeView::resizeEvent(ev);
|
||||
}
|
||||
|
||||
void DisassemblerWindow::contextMenuEvent(QContextMenuEvent *ev)
|
||||
{
|
||||
QMenu menu;
|
||||
|
||||
QAction *act1 = new QAction(tr("Adjust column widths to contents"), &menu);
|
||||
QAction *act2 = new QAction(tr("Always adjust column widths to contents"), &menu);
|
||||
act2->setCheckable(true);
|
||||
// FIXME: make this a SavedAction
|
||||
act2->setChecked(m_alwaysResizeColumnsToContents);
|
||||
QAction *act3 = new QAction(tr("Reload disassembler listing"), &menu);
|
||||
QAction *act4 = new QAction(tr("Always reload disassembler listing"), &menu);
|
||||
act4->setCheckable(true);
|
||||
act4->setChecked(m_alwaysReloadContents);
|
||||
menu.addAction(act3);
|
||||
//menu.addAction(act4);
|
||||
menu.addSeparator();
|
||||
menu.addAction(act1);
|
||||
menu.addAction(act2);
|
||||
menu.addSeparator();
|
||||
menu.addAction(theDebuggerAction(SettingsDialog));
|
||||
|
||||
QAction *act = menu.exec(ev->globalPos());
|
||||
|
||||
if (act == act1)
|
||||
resizeColumnsToContents();
|
||||
else if (act == act2)
|
||||
setAlwaysResizeColumnsToContents(!m_alwaysResizeColumnsToContents);
|
||||
else if (act == act3)
|
||||
reloadContents();
|
||||
else if (act == act2)
|
||||
setAlwaysReloadContents(!m_alwaysReloadContents);
|
||||
}
|
||||
|
||||
void DisassemblerWindow::resizeColumnsToContents()
|
||||
{
|
||||
resizeColumnToContents(0);
|
||||
resizeColumnToContents(1);
|
||||
resizeColumnToContents(2);
|
||||
}
|
||||
|
||||
void DisassemblerWindow::setAlwaysResizeColumnsToContents(bool on)
|
||||
{
|
||||
m_alwaysResizeColumnsToContents = on;
|
||||
QHeaderView::ResizeMode mode = on
|
||||
? QHeaderView::ResizeToContents : QHeaderView::Interactive;
|
||||
header()->setResizeMode(0, mode);
|
||||
header()->setResizeMode(1, mode);
|
||||
header()->setResizeMode(2, mode);
|
||||
}
|
||||
|
||||
void DisassemblerWindow::setAlwaysReloadContents(bool on)
|
||||
{
|
||||
m_alwaysReloadContents = on;
|
||||
if (m_alwaysReloadContents)
|
||||
reloadContents();
|
||||
}
|
||||
|
||||
void DisassemblerWindow::reloadContents()
|
||||
{
|
||||
emit reloadDisassemblerRequested();
|
||||
}
|
||||
|
||||
|
||||
void DisassemblerWindow::setModel(QAbstractItemModel *model)
|
||||
{
|
||||
QTreeView::setModel(model);
|
||||
setAlwaysResizeColumnsToContents(true);
|
||||
}
|
||||
|
@@ -1,68 +0,0 @@
|
||||
/**************************************************************************
|
||||
**
|
||||
** This file is part of Qt Creator
|
||||
**
|
||||
** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
||||
**
|
||||
** Contact: Nokia Corporation (qt-info@nokia.com)
|
||||
**
|
||||
** Commercial Usage
|
||||
**
|
||||
** Licensees holding valid Qt Commercial licenses may use this file in
|
||||
** accordance with the Qt Commercial License Agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and Nokia.
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
**
|
||||
** Alternatively, this file may be used under the terms of the GNU Lesser
|
||||
** General Public License version 2.1 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPL included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 2.1 requirements
|
||||
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||
**
|
||||
** If you are unsure which license is appropriate for your use, please
|
||||
** contact the sales department at http://qt.nokia.com/contact.
|
||||
**
|
||||
**************************************************************************/
|
||||
|
||||
#ifndef DEBUGGER_DISASSEMBLERWINDOW_H
|
||||
#define DEBUGGER_DISASSEMBLERWINDOW_H
|
||||
|
||||
#include <QTreeView>
|
||||
|
||||
namespace Debugger {
|
||||
namespace Internal {
|
||||
|
||||
class DisassemblerWindow : public QTreeView
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
DisassemblerWindow();
|
||||
void setModel(QAbstractItemModel *model);
|
||||
|
||||
signals:
|
||||
void reloadDisassemblerRequested();
|
||||
|
||||
public slots:
|
||||
void resizeColumnsToContents();
|
||||
void setAlwaysResizeColumnsToContents(bool on);
|
||||
void reloadContents();
|
||||
void setAlwaysReloadContents(bool on);
|
||||
void setAlternatingRowColorsHelper(bool on) { setAlternatingRowColors(on); }
|
||||
|
||||
private:
|
||||
void resizeEvent(QResizeEvent *ev);
|
||||
void contextMenuEvent(QContextMenuEvent *ev);
|
||||
|
||||
bool m_alwaysResizeColumnsToContents;
|
||||
bool m_alwaysReloadContents;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace Debugger
|
||||
|
||||
#endif // DEBUGGER_DISASSEMBLERWINDOW_H
|
||||
|
@@ -41,7 +41,6 @@
|
||||
#include "gdbmi.h"
|
||||
#include "procinterrupt.h"
|
||||
|
||||
#include "disassemblerhandler.h"
|
||||
#include "breakhandler.h"
|
||||
#include "moduleshandler.h"
|
||||
#include "registerhandler.h"
|
||||
@@ -244,7 +243,6 @@ void GdbEngine::initializeVariables()
|
||||
|
||||
m_inbuffer.clear();
|
||||
|
||||
m_address.clear();
|
||||
m_currentFunctionArgs.clear();
|
||||
m_currentFrame.clear();
|
||||
m_dumperHelper.clear();
|
||||
@@ -1271,18 +1269,6 @@ void GdbEngine::handleAsyncOutput2(const GdbMi &data)
|
||||
if (supportsThreads())
|
||||
postCommand(_("-thread-list-ids"), WatchUpdate, CB(handleStackListThreads), currentId);
|
||||
|
||||
//
|
||||
// Disassembler
|
||||
//
|
||||
// Linux:
|
||||
//"79*stopped,reason="end-stepping-range",reason="breakpoint-hit",bkptno="1",
|
||||
//thread-id="1",frame={addr="0x0000000000405d8f",func="run1",
|
||||
//args=[{name="argc",value="1"},{name="argv",value="0x7fffb7c23058"}],
|
||||
//file="test1.cpp",fullname="/home/apoenitz/dev/work/test1/test1.cpp",line="261"}"
|
||||
// Mac: (but only sometimes)
|
||||
m_address = _(data.findChild("frame").findChild("addr").data());
|
||||
qq->reloadDisassembler();
|
||||
|
||||
//
|
||||
// Registers
|
||||
//
|
||||
@@ -2324,69 +2310,6 @@ void GdbEngine::attemptBreakpointSynchronization()
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Disassembler specific stuff
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
void GdbEngine::reloadDisassembler()
|
||||
{
|
||||
emit postCommand(_("disassemble"), CB(handleDisassemblerList), m_address);
|
||||
}
|
||||
|
||||
void GdbEngine::handleDisassemblerList(const GdbResultRecord &record,
|
||||
const QVariant &cookie)
|
||||
{
|
||||
QString listedLine = cookie.toString();
|
||||
QList<DisassemblerLine> lines;
|
||||
static const QString pad = _(" ");
|
||||
int currentLine = -1;
|
||||
if (record.resultClass == GdbResultDone) {
|
||||
QString res = _(record.data.findChild("consolestreamoutput").data());
|
||||
QTextStream ts(&res, QIODevice::ReadOnly);
|
||||
while (!ts.atEnd()) {
|
||||
//0x0000000000405fd8 <_ZN11QTextStreamD1Ev@plt+0>:
|
||||
// jmpq *2151890(%rip) # 0x6135b0 <_GLOBAL_OFFSET_TABLE_+640>
|
||||
//0x0000000000405fde <_ZN11QTextStreamD1Ev@plt+6>:
|
||||
// pushq $0x4d
|
||||
//0x0000000000405fe3 <_ZN11QTextStreamD1Ev@plt+11>:
|
||||
// jmpq 0x405af8 <_init+24>
|
||||
//0x0000000000405fe8 <_ZN9QHashData6rehashEi@plt+0>:
|
||||
// jmpq *2151882(%rip) # 0x6135b8 <_GLOBAL_OFFSET_TABLE_+648>
|
||||
QString str = ts.readLine();
|
||||
if (!str.startsWith(__("0x"))) {
|
||||
//qDebug() << "IGNORING DISASSEMBLER" << str;
|
||||
continue;
|
||||
}
|
||||
DisassemblerLine line;
|
||||
QTextStream ts(&str, QIODevice::ReadOnly);
|
||||
ts >> line.address >> line.symbol;
|
||||
line.mnemonic = ts.readLine().trimmed();
|
||||
if (line.symbol.endsWith(_c(':')))
|
||||
line.symbol.chop(1);
|
||||
line.addressDisplay = line.address + pad;
|
||||
if (line.addressDisplay.startsWith(__("0x00000000")))
|
||||
line.addressDisplay.replace(2, 8, QString());
|
||||
line.symbolDisplay = line.symbol + pad;
|
||||
|
||||
if (line.address == listedLine)
|
||||
currentLine = lines.size();
|
||||
|
||||
lines.append(line);
|
||||
}
|
||||
} else {
|
||||
DisassemblerLine line;
|
||||
line.addressDisplay = tr("<could not retreive module information>");
|
||||
lines.append(line);
|
||||
}
|
||||
|
||||
qq->disassemblerHandler()->setLines(lines);
|
||||
if (currentLine != -1)
|
||||
qq->disassemblerHandler()->setCurrentLine(currentLine);
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Modules specific stuff
|
||||
|
@@ -288,16 +288,6 @@ private:
|
||||
void breakpointDataFromOutput(BreakpointData *data, const GdbMi &bkpt);
|
||||
void sendInsertBreakpoint(int index);
|
||||
|
||||
|
||||
//
|
||||
// Disassembler specific stuff
|
||||
//
|
||||
void handleDisassemblerList(const GdbResultRecord &record,
|
||||
const QVariant &cookie);
|
||||
void reloadDisassembler();
|
||||
QString m_address;
|
||||
|
||||
|
||||
//
|
||||
// Modules specific stuff
|
||||
//
|
||||
|
@@ -85,8 +85,6 @@ public:
|
||||
|
||||
virtual void attemptBreakpointSynchronization() = 0;
|
||||
|
||||
virtual void reloadDisassembler() = 0;
|
||||
|
||||
virtual void reloadModules() = 0;
|
||||
virtual void loadSymbols(const QString &moduleName) = 0;
|
||||
virtual void loadAllSymbols() = 0;
|
||||
|
@@ -33,7 +33,6 @@
|
||||
#include "breakhandler.h"
|
||||
#include "debuggerconstants.h"
|
||||
#include "debuggermanager.h"
|
||||
#include "disassemblerhandler.h"
|
||||
#include "moduleshandler.h"
|
||||
#include "registerhandler.h"
|
||||
#include "stackhandler.h"
|
||||
@@ -396,10 +395,6 @@ void ScriptEngine::attemptBreakpointSynchronization()
|
||||
handler->updateMarkers();
|
||||
}
|
||||
|
||||
void ScriptEngine::reloadDisassembler()
|
||||
{
|
||||
}
|
||||
|
||||
void ScriptEngine::loadSymbols(const QString &moduleName)
|
||||
{
|
||||
Q_UNUSED(moduleName)
|
||||
|
@@ -98,7 +98,6 @@ private:
|
||||
void loadSymbols(const QString &moduleName);
|
||||
void loadAllSymbols();
|
||||
virtual QList<Symbol> moduleSymbols(const QString &moduleName);
|
||||
void reloadDisassembler();
|
||||
void reloadModules();
|
||||
void reloadRegisters() {}
|
||||
void reloadSourceFiles() {}
|
||||
|
@@ -33,7 +33,6 @@
|
||||
#include "breakhandler.h"
|
||||
#include "debuggerconstants.h"
|
||||
#include "debuggermanager.h"
|
||||
#include "disassemblerhandler.h"
|
||||
#include "moduleshandler.h"
|
||||
#include "registerhandler.h"
|
||||
#include "stackhandler.h"
|
||||
@@ -305,10 +304,6 @@ void TcfEngine::attemptBreakpointSynchronization()
|
||||
{
|
||||
}
|
||||
|
||||
void TcfEngine::reloadDisassembler()
|
||||
{
|
||||
}
|
||||
|
||||
void TcfEngine::loadSymbols(const QString &moduleName)
|
||||
{
|
||||
Q_UNUSED(moduleName)
|
||||
|
@@ -104,7 +104,6 @@ private:
|
||||
void loadSymbols(const QString &moduleName);
|
||||
void loadAllSymbols();
|
||||
virtual QList<Symbol> moduleSymbols(const QString &moduleName);
|
||||
void reloadDisassembler();
|
||||
void reloadModules();
|
||||
void reloadRegisters() {}
|
||||
void reloadSourceFiles() {}
|
||||
|
Reference in New Issue
Block a user