Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix compilation using the new repository
- Loading branch information
Showing
84 changed files
with
14,296 additions
and
272 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
*.c text eol=native | ||
*.cpp text eol=native | ||
*.h text eol=native | ||
*.m4 text eol=native | ||
.gitattributes text eol=native | ||
.gitignore text eol=native | ||
*.md text eol=native | ||
LICENSE text eol=native | ||
configure.ac text eol=native | ||
Makefile* text eol=native | ||
*.pro text eol=native |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/Makefile | ||
Makefile.unix | ||
OMEdit*/bin/ | ||
OMEdit*/build/release/ | ||
autom4te.cache/ | ||
config.guess | ||
config.sub | ||
config.log | ||
config.status | ||
configure | ||
*.config | ||
*.o | ||
*.qm | ||
/OMEdit/OMEditGUI/Debugger/Parser/GDBMIOutput.tokens | ||
/OMEdit/OMEditGUI/Debugger/Parser/GDBMIOutputLexer.c | ||
/OMEdit/OMEditGUI/Debugger/Parser/GDBMIOutputLexer.h | ||
/OMEdit/OMEditGUI/Debugger/Parser/GDBMIOutputParser.c | ||
/OMEdit/OMEditGUI/Debugger/Parser/GDBMIOutputParser.h | ||
/OMEdit/OMEditGUI/Debugger/Parser/Makefile.lib.unix | ||
/OMEdit/OMEditGUI/Debugger/Parser/libGDBMIParser.a | ||
/OMEdit/OMEditGUI/Makefile | ||
/OMEdit/OMEditGUI/OMC/Parser/OMCOutput.tokens | ||
/OMEdit/OMEditGUI/OMC/Parser/OMCOutputLexer.c | ||
/OMEdit/OMEditGUI/OMC/Parser/OMCOutputLexer.cpp | ||
/OMEdit/OMEditGUI/OMC/Parser/OMCOutputLexer.h | ||
/OMEdit/OMEditGUI/OMC/Parser/OMCOutputParser.c | ||
/OMEdit/OMEditGUI/OMC/Parser/OMCOutputParser.cpp | ||
/OMEdit/OMEditGUI/OMC/Parser/OMCOutputParser.h | ||
qm.stamp | ||
/OMEdit/OMEditGUI/omc_config.h | ||
/OMEdit/generatedfiles/ | ||
/build/ | ||
install-sh | ||
/qjson-0.8.1/build/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "common"] | ||
path = common | ||
url = ../OpenModelica-common.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
all: omedit | ||
|
||
prefix = @prefix@ | ||
exec_prefix = @exec_prefix@ | ||
bindir = @bindir@ | ||
CMAKE=CC="$(CC)" CXX="$(CXX)" CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS)" cmake | ||
CMAKE_TARGET = "Unix Makefiles" | ||
|
||
ifeq (@APP@,) | ||
install: | ||
mkdir -p ${DESTDIR}/@bindir@ | ||
cp -a build/bin/OMEdit@EXE@ ${DESTDIR}/@bindir@ | ||
else | ||
install: | ||
mkdir -p ${DESTDIR}/Applications/ | ||
cp -a build/Applications/OMEdit@APP@ ${DESTDIR}/Applications/ | ||
endif | ||
mkdir -p ${DESTDIR}/lib/@host_short@/omc/ ${DESTDIR}/share/omedit/nls/ | ||
cp -a build/lib/@host_short@/omc/* ${DESTDIR}/lib/@host_short@/omc/ | ||
cp -a build/share/omedit/nls/* ${DESTDIR}/share/omedit/nls/ | ||
|
||
mkbuilddirs: | ||
mkdir -p build/bin build/share/omedit/nls build/lib/@host_short@/omc | ||
omedit: mkbuilddirs qjson | ||
$(MAKE) -C OMEdit/OMEditGUI -f Makefile.unix | ||
clean: | ||
$(MAKE) -C OMEdit/OMEditGUI -f Makefile.unix clean | ||
distclean: clean | ||
rm -f config.status configure Makefile OMEdit/OMEditGUI/Makefile.unix OMEdit/OMEditGUI/OMEdit.config | ||
Makefile: Makefile.in config.status | ||
./config.status | ||
config.status: configure | ||
./config.status -recheck | ||
configure: configure.ac common/m4/corba.m4 common/m4/omhome.m4 common/m4/qmake.m4 | ||
autoconf | ||
|
||
qjson: | ||
test -d qjson-0.8.1 | ||
mkdir -p qjson-0.8.1/build/include/qjson | ||
(cd qjson-0.8.1/build && test -f Makefile || CC="$(CC)" CXX="$(CXX)" CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS)" $(CMAKE) -D CMAKE_AR:String="$(AR)" .. -G $(CMAKE_TARGET)) | ||
test -f qjson-0.8.1/build/lib/libqjson$(SHREXT) || $(MAKE) -C qjson-0.8.1/build | ||
test "(" ! `uname` = Darwin ")" -o "(" ! -f qjson-0.8.1/build/lib/libqjson$(SHREXT) ")" || install_name_tool -id @rpath/libqjson$(SHREXT) 3rdParty/qjson-0.8.1/build/lib/libqjson$(SHREXT) | ||
cp -a qjson-0.8.1/build/lib/libqjson*$(SHREXT)* build/lib/@host_short@/omc/ | ||
cp -a qjson-0.8.1/src/*.h qjson-0.8.1/build/include/qjson |
187 changes: 187 additions & 0 deletions
187
OMEdit/OMEditGUI/Debugger/Attach/AttachToProcessDialog.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,187 @@ | ||
/* | ||
* This file is part of OpenModelica. | ||
* | ||
* Copyright (c) 1998-CurrentYear, Open Source Modelica Consortium (OSMC), | ||
* c/o Linköpings universitet, Department of Computer and Information Science, | ||
* SE-58183 Linköping, Sweden. | ||
* | ||
* All rights reserved. | ||
* | ||
* THIS PROGRAM IS PROVIDED UNDER THE TERMS OF GPL VERSION 3 LICENSE OR | ||
* THIS OSMC PUBLIC LICENSE (OSMC-PL) VERSION 1.2. | ||
* ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE | ||
* OF THE OSMC PUBLIC LICENSE OR THE GPL VERSION 3, ACCORDING TO RECIPIENTS CHOICE. | ||
* | ||
* The OpenModelica software and the Open Source Modelica | ||
* Consortium (OSMC) Public License (OSMC-PL) are obtained | ||
* from OSMC, either from the above address, | ||
* from the URLs: http://www.ida.liu.se/projects/OpenModelica or | ||
* http://www.openmodelica.org, and in the OpenModelica distribution. | ||
* GNU version 3 is obtained from: http://www.gnu.org/copyleft/gpl.html. | ||
* | ||
* This program is distributed WITHOUT ANY WARRANTY; without | ||
* even the implied warranty of MERCHANTABILITY or FITNESS | ||
* FOR A PARTICULAR PURPOSE, EXCEPT AS EXPRESSLY SET FORTH | ||
* IN THE BY RECIPIENT SELECTED SUBSIDIARY LICENSE CONDITIONS OF OSMC-PL. | ||
* | ||
* See the full OSMC Public License conditions for more details. | ||
* | ||
*/ | ||
/* | ||
* | ||
* @author Adeel Asghar <adeel.asghar@liu.se> | ||
* | ||
* RCS: $Id: AttachToProcessDialog.cpp 24682 2015-02-21 14:20:21Z adeas31 $ | ||
* | ||
*/ | ||
|
||
#include "AttachToProcessDialog.h" | ||
|
||
/*! | ||
\class AttachToProcessDialog | ||
\brief Provides interface for attaching a debugger to a running process. | ||
*/ | ||
/*! | ||
\param pDebuggerMainWindow - pointer to DebuggerMainWindow | ||
*/ | ||
AttachToProcessDialog::AttachToProcessDialog(DebuggerMainWindow *pDebuggerMainWindow) | ||
: QDialog(pDebuggerMainWindow, Qt::WindowTitleHint) | ||
{ | ||
setWindowTitle(QString(Helper::applicationName).append(" - ").append(Helper::attachToRunningProcess)); | ||
setAttribute(Qt::WA_DeleteOnClose); | ||
resize(500, 400); | ||
mpDebuggerMainWindow = pDebuggerMainWindow; | ||
// attach to process id | ||
mpAttachToProcessIDLabel = new Label(tr("Attach to Process ID:")); | ||
mpAttachToProcessIDTextBox = new QLineEdit; | ||
// filter | ||
mpFilterProcessesTextBox = new QLineEdit; | ||
mpFilterProcessesTextBox->setPlaceholderText(tr("Filter Processes")); | ||
// processes tree view model & proxy | ||
mpProcessListModel = new ProcessListModel; | ||
mProcessListFilterModel.setSourceModel(mpProcessListModel); | ||
mProcessListFilterModel.setFilterRegExp(mpFilterProcessesTextBox->text()); | ||
// processes tree view | ||
mpProcessesTreeView = new QTreeView; | ||
mpProcessesTreeView->setItemDelegate(new ItemDelegate(mpProcessesTreeView)); | ||
mpProcessesTreeView->setModel(&mProcessListFilterModel); | ||
mpProcessesTreeView->setTextElideMode(Qt::ElideMiddle); | ||
mpProcessesTreeView->setIndentation(0); | ||
mpProcessesTreeView->setSelectionBehavior(QAbstractItemView::SelectRows); | ||
mpProcessesTreeView->setSelectionMode(QAbstractItemView::SingleSelection); | ||
mpProcessesTreeView->setUniformRowHeights(true); | ||
//mpProcessesTreeView->setRootIsDecorated(false); | ||
mpProcessesTreeView->setSortingEnabled(true); | ||
mpProcessesTreeView->header()->setDefaultSectionSize(100); | ||
mpProcessesTreeView->header()->setStretchLastSection(true); | ||
mpProcessesTreeView->sortByColumn(1, Qt::AscendingOrder); | ||
// Create the buttons | ||
mpOkButton = new QPushButton(Helper::ok); | ||
mpOkButton->setEnabled(false); | ||
connect(mpOkButton, SIGNAL(clicked()), SLOT(attachProcess())); | ||
mpRefreshButton = new QPushButton(Helper::refresh); | ||
connect(mpRefreshButton, SIGNAL(clicked()), SLOT(updateProcessList())); | ||
mpCancelButton = new QPushButton(Helper::cancel); | ||
connect(mpCancelButton, SIGNAL(clicked()), SLOT(reject())); | ||
// create buttons box | ||
mpButtonBox = new QDialogButtonBox(Qt::Horizontal); | ||
mpButtonBox->addButton(mpOkButton, QDialogButtonBox::ActionRole); | ||
mpButtonBox->addButton(mpRefreshButton, QDialogButtonBox::ActionRole); | ||
mpButtonBox->addButton(mpCancelButton, QDialogButtonBox::ActionRole); | ||
|
||
connect(mpAttachToProcessIDTextBox, SIGNAL(textChanged(QString)), this, SLOT(processIDChanged(QString))); | ||
connect(mpFilterProcessesTextBox, SIGNAL(textChanged(QString)), this, SLOT(setFilterString(QString))); | ||
connect(mpProcessesTreeView, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(processSelected(QModelIndex))); | ||
connect(mpProcessesTreeView, SIGNAL(clicked(QModelIndex)), this, SLOT(processClicked(QModelIndex))); | ||
// set the layout | ||
QGridLayout *pMainLayout = new QGridLayout; | ||
pMainLayout->setAlignment(Qt::AlignTop | Qt::AlignLeft); | ||
pMainLayout->addWidget(mpAttachToProcessIDLabel, 0, 0); | ||
pMainLayout->addWidget(mpAttachToProcessIDTextBox, 0, 1); | ||
pMainLayout->addWidget(mpFilterProcessesTextBox, 1, 0, 1 ,2); | ||
pMainLayout->addWidget(mpProcessesTreeView, 2, 0, 1 ,2); | ||
pMainLayout->addWidget(mpButtonBox, 3, 0, 1, 2, Qt::AlignRight); | ||
setLayout(pMainLayout); | ||
// get the list of processes | ||
updateProcessList(); | ||
} | ||
|
||
/*! | ||
Slot activated when mpOkButton clicked signal is raised.\n | ||
Starts GDB and try to attach it to the selected process. | ||
*/ | ||
void AttachToProcessDialog::attachProcess() | ||
{ | ||
GDBAdapter *pGDBAdapter = mpDebuggerMainWindow->getGDBAdapter(); | ||
if (pGDBAdapter->isGDBRunning()) { | ||
QMessageBox::information(this, QString(Helper::applicationName).append(" - ").append(Helper::information), | ||
GUIMessages::getMessage(GUIMessages::DEBUGGER_ALREADY_RUNNING), Helper::ok); | ||
} else { | ||
QString GDBPath = mpDebuggerMainWindow->getMainWindow()->getOptionsDialog()->getDebuggerPage()->getGDBPath(); | ||
pGDBAdapter->launch(mpAttachToProcessIDTextBox->text(), GDBPath); | ||
} | ||
accept(); | ||
} | ||
|
||
/*! | ||
Slot activated when mpRefreshButton clicked signal is raised.\n | ||
Updates/Refresh the list of processes. | ||
*/ | ||
void AttachToProcessDialog::updateProcessList() | ||
{ | ||
mpProcessListModel->updateProcessList(); | ||
} | ||
|
||
/*! | ||
Slot activated when mpAttachToProcessIDTextBox textChanged signal is raised.\n | ||
Notifies that user as changed the process id. | ||
*/ | ||
void AttachToProcessDialog::processIDChanged(const QString &pid) | ||
{ | ||
const bool enabled = !pid.isEmpty() && pid != QLatin1String("0") && pid != QString::number(mpProcessListModel->getSelfProcessID()); | ||
mpOkButton->setEnabled(enabled); | ||
} | ||
|
||
/*! | ||
Slot activated when mpFilterProcessesTextBox textChanged signal is raised.\n | ||
Sets the filter on processes. | ||
*/ | ||
void AttachToProcessDialog::setFilterString(const QString &filter) | ||
{ | ||
mProcessListFilterModel.setFilterRegExp(filter); | ||
// Activate the line edit if there's a unique filtered process. | ||
QString processId; | ||
if (mProcessListFilterModel.rowCount(QModelIndex()) == 1) | ||
{ | ||
QModelIndex index = mProcessListFilterModel.index(0, 0, QModelIndex()); | ||
processId = mpProcessListModel->processIdAt(mProcessListFilterModel.mapToSource(index)); | ||
} | ||
mpAttachToProcessIDTextBox->setText(processId); | ||
processIDChanged(processId); | ||
} | ||
|
||
/*! | ||
Slot activated when mpProcessesTreeView doubleClicked signal is raised.\n | ||
Selects the clicked process. | ||
*/ | ||
void AttachToProcessDialog::processSelected(const QModelIndex &index) | ||
{ | ||
const QString processId = mpProcessListModel->processIdAt(mProcessListFilterModel.mapToSource(index)); | ||
if (!processId.isEmpty()) { | ||
mpAttachToProcessIDTextBox->setText(processId); | ||
if (mpOkButton->isEnabled()) | ||
mpOkButton->animateClick(); | ||
} | ||
} | ||
|
||
/*! | ||
Slot activated when mpProcessesTreeView clicked signal is raised.\n | ||
Mark the clicked process selected. | ||
*/ | ||
void AttachToProcessDialog::processClicked(const QModelIndex &index) | ||
{ | ||
const QString processId = mpProcessListModel->processIdAt(mProcessListFilterModel.mapToSource(index)); | ||
if (!processId.isEmpty()) | ||
mpAttachToProcessIDTextBox->setText(processId); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
/* | ||
* This file is part of OpenModelica. | ||
* | ||
* Copyright (c) 1998-CurrentYear, Open Source Modelica Consortium (OSMC), | ||
* c/o Linköpings universitet, Department of Computer and Information Science, | ||
* SE-58183 Linköping, Sweden. | ||
* | ||
* All rights reserved. | ||
* | ||
* THIS PROGRAM IS PROVIDED UNDER THE TERMS OF GPL VERSION 3 LICENSE OR | ||
* THIS OSMC PUBLIC LICENSE (OSMC-PL) VERSION 1.2. | ||
* ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE | ||
* OF THE OSMC PUBLIC LICENSE OR THE GPL VERSION 3, ACCORDING TO RECIPIENTS CHOICE. | ||
* | ||
* The OpenModelica software and the Open Source Modelica | ||
* Consortium (OSMC) Public License (OSMC-PL) are obtained | ||
* from OSMC, either from the above address, | ||
* from the URLs: http://www.ida.liu.se/projects/OpenModelica or | ||
* http://www.openmodelica.org, and in the OpenModelica distribution. | ||
* GNU version 3 is obtained from: http://www.gnu.org/copyleft/gpl.html. | ||
* | ||
* This program is distributed WITHOUT ANY WARRANTY; without | ||
* even the implied warranty of MERCHANTABILITY or FITNESS | ||
* FOR A PARTICULAR PURPOSE, EXCEPT AS EXPRESSLY SET FORTH | ||
* IN THE BY RECIPIENT SELECTED SUBSIDIARY LICENSE CONDITIONS OF OSMC-PL. | ||
* | ||
* See the full OSMC Public License conditions for more details. | ||
* | ||
*/ | ||
/* | ||
* | ||
* @author Adeel Asghar <adeel.asghar@liu.se> | ||
* | ||
* RCS: $Id: AttachToProcessDialog.h 22008 2014-08-26 23:13:07Z hudson $ | ||
* | ||
*/ | ||
|
||
#ifndef ATTACHTOPROCESSDIALOG_H | ||
#define ATTACHTOPROCESSDIALOG_H | ||
|
||
#include "DebuggerMainWindow.h" | ||
|
||
class AttachToProcessDialog : public QDialog | ||
{ | ||
Q_OBJECT | ||
public: | ||
AttachToProcessDialog(DebuggerMainWindow *pDebuggerMainWindow); | ||
private: | ||
DebuggerMainWindow *mpDebuggerMainWindow; | ||
Label *mpAttachToProcessIDLabel; | ||
QLineEdit *mpAttachToProcessIDTextBox; | ||
QLineEdit *mpFilterProcessesTextBox; | ||
ProcessListModel *mpProcessListModel; | ||
ProcessListFilterModel mProcessListFilterModel; | ||
QTreeView *mpProcessesTreeView; | ||
QPushButton *mpOkButton; | ||
QPushButton *mpRefreshButton; | ||
QPushButton *mpCancelButton; | ||
QDialogButtonBox *mpButtonBox; | ||
public slots: | ||
void attachProcess(); | ||
void updateProcessList(); | ||
void processIDChanged(const QString &pid); | ||
void setFilterString(const QString &filter); | ||
void processSelected(const QModelIndex &index); | ||
void processClicked(const QModelIndex &index); | ||
|
||
}; | ||
|
||
#endif // ATTACHTOPROCESSDIALOG_H |
Oops, something went wrong.