Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
b052ce2c
Commit
b052ce2c
authored
Jun 12, 2009
by
hjk
Browse files
debugger: add a 'break at main' checkbox in the 'start and debug external' dialog
parent
94b1b1fd
Changes
8
Hide whitespace changes
Inline
Side-by-side
src/plugins/debugger/breakwindow.cpp
View file @
b052ce2c
...
...
@@ -168,13 +168,8 @@ void BreakWindow::contextMenuEvent(QContextMenuEvent *ev)
BreakByFunctionDialog
dlg
(
this
);
if
(
dlg
.
exec
())
emit
breakByFunctionRequested
(
dlg
.
functionName
());
}
else
if
(
act
==
act8
)
{
#ifdef Q_OS_WIN
emit
breakByFunctionRequested
(
"qMain"
);
#else
emit
breakByFunctionRequested
(
"main"
);
#endif
}
}
else
if
(
act
==
act8
)
emit
breakByFunctionMainRequested
();
}
void
BreakWindow
::
deleteBreakpoint
(
const
QModelIndex
&
idx
)
...
...
src/plugins/debugger/breakwindow.h
View file @
b052ce2c
...
...
@@ -51,6 +51,7 @@ signals:
void
breakpointActivated
(
int
index
);
void
breakpointSynchronizationRequested
();
void
breakByFunctionRequested
(
const
QString
&
functionName
);
void
breakByFunctionMainRequested
();
private
slots
:
void
rowActivated
(
const
QModelIndex
&
index
);
...
...
src/plugins/debugger/debuggerdialogs.cpp
View file @
b052ce2c
...
...
@@ -389,13 +389,13 @@ void AttachTcfDialog::updateState()
m_ui
->
serverStartScript
->
setEnabled
(
enabled
);
}
///////////////////////////////////////////////////////////////////////
//
// StartExternalDialog
//
///////////////////////////////////////////////////////////////////////
StartExternalDialog
::
StartExternalDialog
(
QWidget
*
parent
)
:
QDialog
(
parent
),
m_ui
(
new
Ui
::
StartExternalDialog
)
{
...
...
@@ -440,6 +440,12 @@ QString StartExternalDialog::executableArguments() const
return
m_ui
->
argsEdit
->
text
();
}
bool
StartExternalDialog
::
breakAtMain
()
const
{
return
m_ui
->
checkBoxBreakAtMain
->
isChecked
();
}
///////////////////////////////////////////////////////////////////////
//
...
...
src/plugins/debugger/debuggerdialogs.h
View file @
b052ce2c
...
...
@@ -140,6 +140,7 @@ public:
QString
executableFile
()
const
;
QString
executableArguments
()
const
;
bool
breakAtMain
()
const
;
private:
Ui
::
StartExternalDialog
*
m_ui
;
...
...
src/plugins/debugger/debuggermanager.cpp
View file @
b052ce2c
...
...
@@ -279,6 +279,8 @@ void DebuggerManager::init()
this
,
SIGNAL
(
setSessionValueRequested
(
QString
,
QVariant
)));
connect
(
breakView
,
SIGNAL
(
breakByFunctionRequested
(
QString
)),
this
,
SLOT
(
breakByFunction
(
QString
)),
Qt
::
QueuedConnection
);
connect
(
breakView
,
SIGNAL
(
breakByFunctionMainRequested
()),
this
,
SLOT
(
breakByFunctionMain
()),
Qt
::
QueuedConnection
);
// Modules
QAbstractItemView
*
modulesView
=
...
...
@@ -1106,6 +1108,16 @@ void DebuggerManager::setBreakpoint(const QString &fileName, int lineNumber)
attemptBreakpointSynchronization
();
}
void
DebuggerManager
::
breakByFunctionMain
()
{
#ifdef Q_OS_WIN
// FIXME: wrong on non-Qt based binaries
emit
breakByFunction
(
"qMain"
);
#else
emit
breakByFunction
(
"main"
);
#endif
}
void
DebuggerManager
::
breakByFunction
(
const
QString
&
functionName
)
{
QTC_ASSERT
(
m_breakHandler
,
return
);
...
...
src/plugins/debugger/debuggermanager.h
View file @
b052ce2c
...
...
@@ -127,7 +127,8 @@ enum DebuggerStartMode
StartRemote
// Start and attach to a remote process
};
struct
DebuggerStartParameters
{
struct
DebuggerStartParameters
{
DebuggerStartParameters
();
void
clear
();
...
...
@@ -278,6 +279,7 @@ public slots:
void
runToFunctionExec
();
void
toggleBreakpoint
();
void
breakByFunction
(
const
QString
&
functionName
);
void
breakByFunctionMain
();
void
setBreakpoint
(
const
QString
&
fileName
,
int
lineNumber
);
void
activateFrame
(
int
index
);
void
selectThread
(
int
index
);
...
...
src/plugins/debugger/debuggerplugin.cpp
View file @
b052ce2c
...
...
@@ -1202,15 +1202,17 @@ void DebuggerPlugin::startExternalApplication()
configValue
(
_
(
"LastExternalExecutableFile"
)).
toString
());
dlg
.
setExecutableArguments
(
configValue
(
_
(
"LastExternalExecutableArguments"
)).
toString
());
if
(
dlg
.
exec
()
!=
QDialog
::
Accepted
)
{
if
(
dlg
.
exec
()
!=
QDialog
::
Accepted
)
return
;
}
setConfigValue
(
_
(
"LastExternalExecutableFile"
),
dlg
.
executableFile
());
setConfigValue
(
_
(
"LastExternalExecutableArguments"
),
dlg
.
executableArguments
());
sp
->
executable
=
dlg
.
executableFile
();
sp
->
processArgs
=
dlg
.
executableArguments
().
split
(
QLatin1Char
(
' '
));
if
(
dlg
.
breakAtMain
())
m_manager
->
breakByFunctionMain
();
QSharedPointer
<
RunConfiguration
>
rc
=
activeRunConfiguration
();
if
(
RunControl
*
runControl
=
m_debuggerRunner
...
...
src/plugins/debugger/startexternaldialog.ui
View file @
b052ce2c
...
...
@@ -20,6 +20,19 @@
<property
name=
"margin"
>
<number>
9
</number>
</property>
<item>
<spacer>
<property
name=
"orientation"
>
<enum>
Qt::Vertical
</enum>
</property>
<property
name=
"sizeHint"
stdset=
"0"
>
<size>
<width>
407
</width>
<height>
16
</height>
</size>
</property>
</spacer>
</item>
<item>
<layout
class=
"QGridLayout"
>
<property
name=
"margin"
>
...
...
@@ -48,21 +61,22 @@
<item
row=
"0"
column=
"1"
>
<widget
class=
"Core::Utils::PathChooser"
name=
"execFile"
native=
"true"
/>
</item>
<item
row=
"2"
column=
"1"
>
<widget
class=
"QCheckBox"
name=
"checkBoxBreakAtMain"
>
<property
name=
"text"
>
<string/>
</property>
</widget>
</item>
<item
row=
"2"
column=
"0"
>
<widget
class=
"QLabel"
name=
"labelBreakAtMain"
>
<property
name=
"text"
>
<string>
Break at 'main':
</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<spacer>
<property
name=
"orientation"
>
<enum>
Qt::Vertical
</enum>
</property>
<property
name=
"sizeHint"
stdset=
"0"
>
<size>
<width>
407
</width>
<height>
16
</height>
</size>
</property>
</spacer>
</item>
<item>
<widget
class=
"Line"
name=
"line"
>
<property
name=
"orientation"
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment