Commit 07718288 authored by dt's avatar dt
Browse files

Merge branch 'master' of git@scm.dev.nokia.troll.no:creator/mainline

parents d83e0e74 d47a001b
......@@ -2,7 +2,7 @@
#include "%UI_HDR%"
%CLASS%::%CLASS%(QWidget *parent)
: %BASECLASS%(parent), ui(new Ui::%CLASS%Class)
: %BASECLASS%(parent), ui(new Ui::%CLASS%)
{
ui->setupUi(this);
}
......
......@@ -5,7 +5,7 @@
namespace Ui
{
class %CLASS%Class;
class %CLASS%;
}
class %CLASS% : public %BASECLASS%
......@@ -17,7 +17,7 @@ public:
~%CLASS%();
private:
Ui::%CLASS%Class *ui;
Ui::%CLASS% *ui;
};
#endif // %PRE_DEF%
<ui version="4.0">
<class>%CLASS%Class</class>
<widget class="%BASECLASS%" name="%CLASS%Class" >
<widget class="%BASECLASS%" name="%CLASS%" >
<property name="geometry" >
<rect>
<x>0</x>
......
......@@ -65,6 +65,7 @@
#include "basefilewizard.h"
#include <coreplugin/findplaceholder.h>
#include <utils/pathchooser.h>
#include <extensionsystem/pluginmanager.h>
#include <QtCore/QDebug>
......@@ -836,10 +837,10 @@ QStringList MainWindow::showNewItemDialog(const QString &title,
const QString &defaultLocation)
{
QString defaultDir = defaultLocation;
if (defaultDir.isEmpty()) {
if (!m_coreImpl->fileManager()->currentFile().isEmpty())
defaultDir = QFileInfo(m_coreImpl->fileManager()->currentFile()).absolutePath();
}
if (defaultDir.isEmpty() && !m_coreImpl->fileManager()->currentFile().isEmpty())
defaultDir = QFileInfo(m_coreImpl->fileManager()->currentFile()).absolutePath();
if (defaultDir.isEmpty())
defaultDir = Core::Utils::PathChooser::homePath();
// Scan for wizards matching the filter and pick one. Don't show
// dialog if there is only one.
......
......@@ -262,6 +262,8 @@ void DebuggerManager::init()
this, SLOT(loadAllSymbols()));
connect(modulesView, SIGNAL(fileOpenRequested(QString)),
this, SLOT(fileOpen(QString)));
connect(modulesView, SIGNAL(newDockRequested(QWidget*)),
this, SLOT(createNewDock(QWidget*)));
// Source Files
//m_sourceFilesHandler = new SourceFilesHandler;
......@@ -508,6 +510,16 @@ void DebuggerManager::createDockWidgets()
m_watchDock = createDockForWidget(localsAndWatchers);
}
void DebuggerManager::createNewDock(QWidget *widget)
{
QDockWidget *dockWidget = new QDockWidget(widget->windowTitle(), m_mainWindow);
dockWidget->setObjectName(widget->windowTitle());
dockWidget->setFeatures(QDockWidget::DockWidgetClosable);
dockWidget->setWidget(widget);
m_mainWindow->addDockWidget(Qt::TopDockWidgetArea, dockWidget);
dockWidget->show();
}
QDockWidget *DebuggerManager::createDockForWidget(QWidget *widget)
{
QDockWidget *dockWidget = new QDockWidget(widget->windowTitle(), m_mainWindow);
......
......@@ -294,6 +294,7 @@ private slots:
void showDebuggerOutput(const QString &prefix, const QString &msg);
void showDebuggerInput(const QString &prefix, const QString &msg);
void showApplicationOutput(const QString &data);
void showWidgetInDock(QWidget *dock);
void reloadDisassembler();
void disassemblerDockToggled(bool on);
......@@ -402,6 +403,7 @@ private:
void init();
void setDebuggerType(DebuggerType type);
QDockWidget *createDockForWidget(QWidget *widget);
Q_SLOT void createNewDock(QWidget *widget);
void shutdown();
......
......@@ -2428,6 +2428,8 @@ void GdbEngine::handleModulesList(const GdbResultRecord &record)
{
QList<Module> modules;
if (record.resultClass == GdbResultDone) {
// that's console-based output, likely Linux or Windows,
// but we can avoid the #ifdef here
QString data = record.data.findChild("consolestreamoutput").data();
QTextStream ts(&data, QIODevice::ReadOnly);
while (!ts.atEnd()) {
......@@ -2442,6 +2444,21 @@ void GdbEngine::handleModulesList(const GdbResultRecord &record)
module.symbolsRead = (symbolsRead == "Yes");
modules.append(module);
}
if (modules.isEmpty()) {
// Mac has^done,shlib-info={num="1",name="dyld",kind="-",
// dyld-addr="0x8fe00000",reason="dyld",requested-state="Y",
// state="Y",path="/usr/lib/dyld",description="/usr/lib/dyld",
// loaded_addr="0x8fe00000",slide="0x0",prefix="__dyld_"},
// shlib-info={...}...
foreach (const GdbMi &item, record.data.children()) {
Module module;
module.moduleName = item.findChild("path").data();
module.symbolsRead = (item.findChild("state").data() == "Y");
module.startAddress = item.findChild("loaded_addr").data();
module.endAddress = "<unknown>";
modules.append(module);
}
}
}
qq->modulesHandler()->setModules(modules);
}
......
......@@ -30,13 +30,23 @@
#include "moduleswindow.h"
#include "moduleshandler.h" // for model roles
#include <QAction>
#include <QDebug>
#include <QHeaderView>
#include <QMenu>
#include <QResizeEvent>
#include <QToolButton>
#include <QtCore/QDebug>
#include <QtCore/QProcess>
#include <QtCore/QRegExp>
#include <QtGui/QAction>
#include <QtGui/QHeaderView>
#include <QtGui/QMenu>
#include <QtGui/QResizeEvent>
#include <QtGui/QToolButton>
#include <QtGui/QTreeWidget>
///////////////////////////////////////////////////////////////////////////
//
// ModulesWindow
//
///////////////////////////////////////////////////////////////////////////
using Debugger::Internal::ModulesWindow;
......@@ -93,20 +103,28 @@ void ModulesWindow::contextMenuEvent(QContextMenuEvent *ev)
QAction *act4 = new QAction(tr("Load symbols for all modules"), &menu);
QAction *act5 = 0;
QAction *act6 = 0;
QAction *act7 = 0;
if (name.isEmpty()) {
act5 = new QAction(tr("Load symbols for module"), &menu);
act6 = new QAction(tr("Edit file"), &menu);
act7 = new QAction(tr("Show symbols"), &menu);
} else {
act5 = new QAction(tr("Load symbols for module \"%1\"").arg(name), &menu);
act6 = new QAction(tr("Edit file \"%1\"").arg(name), &menu);
act7 = new QAction(tr("Show symbols in file \"%1\"").arg(name), &menu);
}
act5->setDisabled(name.isEmpty());
act6->setDisabled(name.isEmpty());
act7->setDisabled(name.isEmpty());
#ifndef Q_OS_LINUX
act7->setDisabled(true)l
#endif
menu.addAction(act0);
menu.addAction(act4);
menu.addAction(act5);
menu.addAction(act6);
menu.addAction(act7);
menu.addSeparator();
menu.addAction(act1);
menu.addAction(act2);
......@@ -127,6 +145,8 @@ void ModulesWindow::contextMenuEvent(QContextMenuEvent *ev)
emit loadSymbolsRequested(name);
else if (act == act6)
emit fileOpenRequested(name);
else if (act == act7)
showSymbols(name);
}
void ModulesWindow::resizeColumnsToContents()
......@@ -154,3 +174,32 @@ void ModulesWindow::setModel(QAbstractItemModel *model)
setAlwaysResizeColumnsToContents(true);
}
void ModulesWindow::showSymbols(const QString &name)
{
if (name.isEmpty())
return;
QProcess proc;
proc.start("nm", QStringList() << "-D" << name);
proc.waitForFinished();
QTreeWidget *w = new QTreeWidget;
w->setColumnCount(3);
w->setRootIsDecorated(false);
w->setAlternatingRowColors(true);
//w->header()->hide();
w->setHeaderLabels(QStringList() << tr("Address") << tr("Code") << tr("Symbol"));
w->setWindowTitle(tr("Symbols in \"%1\"").arg(name));
QString contents = QString::fromLocal8Bit(proc.readAllStandardOutput());
QRegExp re("([0-9a-f]+)?\\s+([^\\s]+)\\s+([^\\s]+)");
foreach (QString line, contents.split('\n')) {
if (re.indexIn(line) != -1) {
QTreeWidgetItem *it = new QTreeWidgetItem;
it->setData(0, Qt::DisplayRole, re.cap(1));
it->setData(1, Qt::DisplayRole, re.cap(2));
it->setData(2, Qt::DisplayRole, re.cap(3));
w->addTopLevelItem(it);
} else {
qDebug() << "UNHANDLED LINE" << line;
}
}
emit newDockRequested(w);
}
......@@ -48,11 +48,13 @@ signals:
void loadSymbolsRequested(const QString &modulesName);
void loadAllSymbolsRequested();
void fileOpenRequested(QString);
void newDockRequested(QWidget *w);
public slots:
void resizeColumnsToContents();
void setAlwaysResizeColumnsToContents(bool on);
void moduleActivated(const QModelIndex &);
void showSymbols(const QString &name);
private:
void resizeEvent(QResizeEvent *ev);
......
......@@ -294,6 +294,8 @@ private:
void updateSelection();
void quit();
QWidget *editor() const;
QChar characterAtCursor() const
{ return m_tc.document()->characterAt(m_tc.position()); }
public:
QTextEdit *m_textedit;
......@@ -1146,6 +1148,8 @@ EventResult FakeVimHandler::Private::handleCommandMode(int key, int unmodified,
for (int i = qMax(count(), 2) - 1; --i >= 0; ) {
moveToEndOfLine();
recordRemoveNextChar();
while (characterAtCursor() == ' ')
recordRemoveNextChar();
if (!m_gflag)
recordInsertText(" ");
}
......@@ -1999,12 +2003,10 @@ void FakeVimHandler::Private::moveToNextWord(bool simple)
{
// FIXME: 'w' should stop on empty lines, too
int repeat = count();
QTextDocument *doc = m_tc.document();
int n = lastPositionInDocument() - 1;
QChar c = doc->characterAt(m_tc.position());
int lastClass = charClass(c, simple);
int lastClass = charClass(characterAtCursor(), simple);
while (true) {
c = doc->characterAt(m_tc.position());
QChar c = characterAtCursor();
int thisClass = charClass(c, simple);
if (thisClass != lastClass && thisClass != 0)
--repeat;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment