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
b585cbda
Commit
b585cbda
authored
Jan 11, 2010
by
ck
Browse files
Maemo: Make gdbserver port user-configurable.
parent
834a47b1
Changes
7
Hide whitespace changes
Inline
Side-by-side
src/plugins/qt4projectmanager/qt-maemo/maemodeviceconfigurations.cpp
View file @
b585cbda
...
...
@@ -64,7 +64,8 @@ namespace {
const
QLatin1String
NameKey
(
"Name"
);
const
QLatin1String
TypeKey
(
"Type"
);
const
QLatin1String
HostKey
(
"Host"
);
const
QLatin1String
PortKey
(
"Port"
);
const
QLatin1String
SshPortKey
(
"SshPort"
);
const
QLatin1String
GdbServerPortKey
(
"GdbServerPort"
);
const
QLatin1String
UserNameKey
(
"Uname"
);
const
QLatin1String
AuthKey
(
"Authentication"
);
const
QLatin1String
KeyFileKey
(
"KeyFile"
);
...
...
@@ -92,7 +93,8 @@ private:
MaemoDeviceConfig
::
MaemoDeviceConfig
(
const
QString
&
name
)
:
name
(
name
),
type
(
Physical
),
port
(
22
),
sshPort
(
22
),
gdbServerPort
(
10000
),
authentication
(
Key
),
keyFile
(
DefaultKeyFile
),
timeout
(
30
),
...
...
@@ -105,7 +107,8 @@ MaemoDeviceConfig::MaemoDeviceConfig(const QSettings &settings,
:
name
(
settings
.
value
(
NameKey
).
toString
()),
type
(
static_cast
<
DeviceType
>
(
settings
.
value
(
TypeKey
,
Physical
).
toInt
())),
host
(
settings
.
value
(
HostKey
).
toString
()),
port
(
settings
.
value
(
PortKey
,
22
).
toInt
()),
sshPort
(
settings
.
value
(
SshPortKey
,
22
).
toInt
()),
gdbServerPort
(
settings
.
value
(
GdbServerPortKey
,
10000
).
toInt
()),
uname
(
settings
.
value
(
UserNameKey
).
toString
()),
authentication
(
static_cast
<
AuthType
>
(
settings
.
value
(
AuthKey
).
toInt
())),
pwd
(
settings
.
value
(
PasswordKey
).
toString
()),
...
...
@@ -132,7 +135,8 @@ void MaemoDeviceConfig::save(QSettings &settings) const
settings
.
setValue
(
NameKey
,
name
);
settings
.
setValue
(
TypeKey
,
type
);
settings
.
setValue
(
HostKey
,
host
);
settings
.
setValue
(
PortKey
,
port
);
settings
.
setValue
(
SshPortKey
,
sshPort
);
settings
.
setValue
(
GdbServerPortKey
,
gdbServerPort
);
settings
.
setValue
(
UserNameKey
,
uname
);
settings
.
setValue
(
AuthKey
,
authentication
);
settings
.
setValue
(
PasswordKey
,
pwd
);
...
...
src/plugins/qt4projectmanager/qt-maemo/maemodeviceconfigurations.h
View file @
b585cbda
...
...
@@ -62,7 +62,8 @@ public:
QString
name
;
DeviceType
type
;
QString
host
;
int
port
;
int
sshPort
;
int
gdbServerPort
;
QString
uname
;
AuthType
authentication
;
QString
pwd
;
...
...
src/plugins/qt4projectmanager/qt-maemo/maemoruncontrol.cpp
View file @
b585cbda
...
...
@@ -151,7 +151,7 @@ void AbstractMaemoRunControl::deploy()
emit
addToOutputWindow
(
this
,
tr
(
"File to deploy: %1."
).
arg
(
deployable
.
fileName
));
QStringList
cmdArgs
;
cmdArgs
<<
"-P"
<<
p
ort
()
<<
options
()
<<
deployable
.
fileName
cmdArgs
<<
"-P"
<<
sshP
ort
()
<<
options
()
<<
deployable
.
fileName
<<
(
devConfig
.
uname
+
"@"
+
devConfig
.
host
+
":"
+
remoteDir
());
deployProcess
.
setWorkingDirectory
(
deployable
.
dir
);
...
...
@@ -239,9 +239,9 @@ const QString AbstractMaemoRunControl::executableOnHost() const
return
runConfig
->
executable
();
}
const
QString
AbstractMaemoRunControl
::
p
ort
()
const
const
QString
AbstractMaemoRunControl
::
sshP
ort
()
const
{
return
QString
::
number
(
devConfig
.
p
ort
);
return
QString
::
number
(
devConfig
.
sshP
ort
);
}
const
QString
AbstractMaemoRunControl
::
executableFileName
()
const
...
...
@@ -376,7 +376,7 @@ void MaemoRunControl::startExecution()
.
arg
(
runConfig
->
arguments
().
join
(
" "
));
QStringList
cmdArgs
;
cmdArgs
<<
"-n"
<<
"-p"
<<
p
ort
()
<<
"-l"
<<
devConfig
.
uname
cmdArgs
<<
"-n"
<<
"-p"
<<
sshP
ort
()
<<
"-l"
<<
devConfig
.
uname
<<
options
()
<<
devConfig
.
host
<<
remoteCall
;
sshProcess
.
start
(
runConfig
->
sshCmd
(),
cmdArgs
);
...
...
@@ -428,7 +428,7 @@ void MaemoRunControl::stop()
QStringList
cmdArgs
;
const
QString
remoteCall
=
QString
::
fromLocal8Bit
(
"pkill -x %1; "
"sleep 1; pkill -x -9 %1"
).
arg
(
executableFileName
());
cmdArgs
<<
"-n"
<<
"-p"
<<
p
ort
()
<<
"-l"
<<
devConfig
.
uname
cmdArgs
<<
"-n"
<<
"-p"
<<
sshP
ort
()
<<
"-l"
<<
devConfig
.
uname
<<
options
()
<<
devConfig
.
host
<<
remoteCall
;
stopProcess
.
start
(
runConfig
->
sshCmd
(),
cmdArgs
);
#endif // USE_SSH_LIB
...
...
@@ -458,7 +458,7 @@ void MaemoRunControl::handleRemoteOutput(const QString &output)
MaemoDebugRunControl
::
MaemoDebugRunControl
(
RunConfiguration
*
runConfiguration
)
:
AbstractMaemoRunControl
(
runConfiguration
)
,
gdbServerPort
(
"10000"
),
debuggerManager
(
0
)
,
debuggerManager
(
0
)
,
startParams
(
new
Debugger
::
DebuggerStartParameters
)
{
#ifndef USE_SSH_LIB
...
...
@@ -472,7 +472,8 @@ MaemoDebugRunControl::MaemoDebugRunControl(RunConfiguration *runConfiguration)
QTC_ASSERT
(
debuggerManager
!=
0
,
return
);
startParams
->
startMode
=
Debugger
::
StartRemote
;
startParams
->
executable
=
executableOnHost
();
startParams
->
remoteChannel
=
devConfig
.
host
+
":"
+
gdbServerPort
;
startParams
->
remoteChannel
=
devConfig
.
host
+
":"
+
QString
::
number
(
devConfig
.
gdbServerPort
);
startParams
->
remoteArchitecture
=
"arm"
;
startParams
->
sysRoot
=
runConfig
->
sysRoot
();
startParams
->
toolChainType
=
ToolChain
::
GCC_MAEMO
;
...
...
@@ -513,8 +514,8 @@ void MaemoDebugRunControl::handleDeploymentFinished(bool success)
void
MaemoDebugRunControl
::
startGdbServer
()
{
const
QString
remoteCall
(
QString
::
fromLocal8Bit
(
"%1 gdbserver :%2 %3 %4"
).
arg
(
targetCmdLinePrefix
()).
arg
(
gdbServerPort
)
.
arg
(
executableOnTarget
())
.
arg
(
runConfig
->
arguments
().
join
(
" "
)));
arg
(
targetCmdLinePrefix
()).
arg
(
devConfig
.
gdbServerPort
)
.
arg
(
executableOnTarget
())
.
arg
(
runConfig
->
arguments
().
join
(
" "
)));
inferiorPid
=
-
1
;
#ifdef USE_SSH_LIB
sshRunner
.
reset
(
new
MaemoSshRunner
(
devConfig
,
remoteCall
));
...
...
@@ -524,7 +525,7 @@ void MaemoDebugRunControl::startGdbServer()
#else
QStringList
sshArgs
;
sshArgs
<<
"-t"
<<
"-n"
<<
"-l"
<<
devConfig
.
uname
<<
"-p"
<<
p
ort
()
<<
options
()
<<
devConfig
.
host
<<
remoteCall
;
<<
sshP
ort
()
<<
options
()
<<
devConfig
.
host
<<
remoteCall
;
disconnect
(
&
gdbServer
,
SIGNAL
(
readyReadStandardError
()),
0
,
0
);
connect
(
&
gdbServer
,
SIGNAL
(
readyReadStandardError
()),
this
,
SLOT
(
gdbServerStarted
()));
...
...
@@ -651,7 +652,7 @@ void MaemoDebugRunControl::debuggingFinished()
const
QString
remoteCall
=
QString
::
fromLocal8Bit
(
"kill %1; sleep 1; "
"kill -9 %1; pkill -x -9 gdbserver"
).
arg
(
inferiorPid
);
QStringList
sshArgs
;
sshArgs
<<
"-n"
<<
"-l"
<<
devConfig
.
uname
<<
"-p"
<<
p
ort
()
sshArgs
<<
"-n"
<<
"-l"
<<
devConfig
.
uname
<<
"-p"
<<
sshP
ort
()
<<
options
()
<<
devConfig
.
host
<<
remoteCall
;
stopProcess
.
start
(
runConfig
->
sshCmd
(),
sshArgs
);
}
...
...
src/plugins/qt4projectmanager/qt-maemo/maemoruncontrol.h
View file @
b585cbda
...
...
@@ -73,7 +73,7 @@ protected:
const
QString
executableOnHost
()
const
;
const
QString
executableOnTarget
()
const
;
const
QString
executableFileName
()
const
;
const
QString
p
ort
()
const
;
const
QString
sshP
ort
()
const
;
const
QString
targetCmdLinePrefix
()
const
;
const
QString
remoteDir
()
const
;
const
QStringList
options
()
const
;
...
...
@@ -183,7 +183,6 @@ private:
QProcess
gdbServer
;
QProcess
stopProcess
;
#endif // USE_SSH_LIB
const
QString
gdbServerPort
;
Debugger
::
DebuggerManager
*
debuggerManager
;
QSharedPointer
<
Debugger
::
DebuggerStartParameters
>
startParams
;
int
inferiorPid
;
...
...
src/plugins/qt4projectmanager/qt-maemo/maemosettingspage.cpp
View file @
b585cbda
...
...
@@ -133,7 +133,8 @@ private slots:
void
deviceTypeChanged
();
void
authenticationTypeChanged
();
void
hostNameEditingFinished
();
void
portEditingFinished
();
void
sshPortEditingFinished
();
void
gdbServerPortEditingFinished
();
void
timeoutEditingFinished
();
void
userNameEditingFinished
();
void
passwordEditingFinished
();
...
...
@@ -161,7 +162,8 @@ private:
Ui_maemoSettingsWidget
*
m_ui
;
QList
<
MaemoDeviceConfig
>
m_devConfs
;
PortAndTimeoutValidator
m_portValidator
;
PortAndTimeoutValidator
m_sshPortValidator
;
PortAndTimeoutValidator
m_gdbServerPortValidator
;
PortAndTimeoutValidator
m_timeoutValidator
;
NameValidator
m_nameValidator
;
#ifdef USE_SSH_LIB
...
...
@@ -239,7 +241,8 @@ void MaemoSettingsWidget::initGui()
{
m_ui
->
setupUi
(
this
);
m_ui
->
nameLineEdit
->
setValidator
(
&
m_nameValidator
);
m_ui
->
portLineEdit
->
setValidator
(
&
m_portValidator
);
m_ui
->
sshPortLineEdit
->
setValidator
(
&
m_sshPortValidator
);
m_ui
->
gdbServerPortLineEdit
->
setValidator
(
&
m_gdbServerPortValidator
);
m_ui
->
timeoutLineEdit
->
setValidator
(
&
m_timeoutValidator
);
m_ui
->
keyFileLineEdit
->
setExpectedKind
(
Utils
::
PathChooser
::
File
);
foreach
(
const
MaemoDeviceConfig
&
devConf
,
m_devConfs
)
...
...
@@ -305,14 +308,17 @@ void MaemoSettingsWidget::display(const MaemoDeviceConfig &devConfig)
else
m_ui
->
keyButton
->
setChecked
(
true
);
m_ui
->
hostLineEdit
->
setText
(
devConfig
.
host
);
m_ui
->
portLineEdit
->
setText
(
QString
::
number
(
devConfig
.
port
));
m_ui
->
sshPortLineEdit
->
setText
(
QString
::
number
(
devConfig
.
sshPort
));
m_ui
->
gdbServerPortLineEdit
->
setText
(
QString
::
number
(
devConfig
.
gdbServerPort
));
m_ui
->
timeoutLineEdit
->
setText
(
QString
::
number
(
devConfig
.
timeout
));
m_ui
->
userLineEdit
->
setText
(
devConfig
.
uname
);
m_ui
->
pwdLineEdit
->
setText
(
devConfig
.
pwd
);
m_ui
->
keyFileLineEdit
->
setPath
(
devConfig
.
keyFile
);
m_ui
->
detailsWidget
->
setEnabled
(
true
);
m_nameValidator
.
setDisplayName
(
devConfig
.
name
);
m_portValidator
.
setValue
(
devConfig
.
port
);
m_sshPortValidator
.
setValue
(
devConfig
.
sshPort
);
m_gdbServerPortValidator
.
setValue
(
devConfig
.
gdbServerPort
);
m_timeoutValidator
.
setValue
(
devConfig
.
timeout
);
m_ui
->
detailsWidget
->
setEnabled
(
true
);
}
...
...
@@ -367,9 +373,16 @@ void MaemoSettingsWidget::hostNameEditingFinished()
currentConfig
().
host
=
m_ui
->
hostLineEdit
->
text
();
}
void
MaemoSettingsWidget
::
p
ortEditingFinished
()
void
MaemoSettingsWidget
::
sshP
ortEditingFinished
()
{
setPortOrTimeout
(
m_ui
->
portLineEdit
,
currentConfig
().
port
,
m_portValidator
);
setPortOrTimeout
(
m_ui
->
sshPortLineEdit
,
currentConfig
().
sshPort
,
m_sshPortValidator
);
}
void
MaemoSettingsWidget
::
gdbServerPortEditingFinished
()
{
setPortOrTimeout
(
m_ui
->
gdbServerPortLineEdit
,
currentConfig
().
gdbServerPort
,
m_gdbServerPortValidator
);
}
void
MaemoSettingsWidget
::
timeoutEditingFinished
()
...
...
@@ -594,7 +607,8 @@ void MaemoSettingsWidget::clearDetails()
{
m_ui
->
nameLineEdit
->
clear
();
m_ui
->
hostLineEdit
->
clear
();
m_ui
->
portLineEdit
->
clear
();
m_ui
->
sshPortLineEdit
->
clear
();
m_ui
->
gdbServerPortLineEdit
->
clear
();
m_ui
->
timeoutLineEdit
->
clear
();
m_ui
->
userLineEdit
->
clear
();
m_ui
->
pwdLineEdit
->
clear
();
...
...
src/plugins/qt4projectmanager/qt-maemo/maemosettingswidget.ui
View file @
b585cbda
...
...
@@ -124,57 +124,67 @@
<item
row=
"4"
column=
"0"
>
<widget
class=
"QLabel"
name=
"label_4"
>
<property
name=
"text"
>
<string>
Port:
</string>
<string>
SSH
Port:
</string>
</property>
</widget>
</item>
<item
row=
"4"
column=
"1"
>
<widget
class=
"QLineEdit"
name=
"
p
ortLineEdit"
/>
<widget
class=
"QLineEdit"
name=
"
sshP
ortLineEdit"
/>
</item>
<item
row=
"
5
"
column=
"0"
>
<item
row=
"
6
"
column=
"0"
>
<widget
class=
"QLabel"
name=
"label_5"
>
<property
name=
"text"
>
<string>
Connection Timeout:
</string>
</property>
</widget>
</item>
<item
row=
"
5
"
column=
"1"
>
<item
row=
"
6
"
column=
"1"
>
<widget
class=
"QLineEdit"
name=
"timeoutLineEdit"
/>
</item>
<item
row=
"
6
"
column=
"0"
>
<item
row=
"
7
"
column=
"0"
>
<widget
class=
"QLabel"
name=
"label_6"
>
<property
name=
"text"
>
<string>
User Name:
</string>
</property>
</widget>
</item>
<item
row=
"
6
"
column=
"1"
>
<item
row=
"
7
"
column=
"1"
>
<widget
class=
"QLineEdit"
name=
"userLineEdit"
/>
</item>
<item
row=
"
7
"
column=
"0"
>
<item
row=
"
8
"
column=
"0"
>
<widget
class=
"QLabel"
name=
"passwordLabel"
>
<property
name=
"text"
>
<string>
Password:
</string>
</property>
</widget>
</item>
<item
row=
"
7
"
column=
"1"
>
<item
row=
"
8
"
column=
"1"
>
<widget
class=
"QLineEdit"
name=
"pwdLineEdit"
>
<property
name=
"echoMode"
>
<enum>
QLineEdit::Password
</enum>
</property>
</widget>
</item>
<item
row=
"
8
"
column=
"0"
>
<item
row=
"
9
"
column=
"0"
>
<widget
class=
"QLabel"
name=
"keyLabel"
>
<property
name=
"text"
>
<string>
Private key file:
</string>
</property>
</widget>
</item>
<item
row=
"
8
"
column=
"1"
>
<item
row=
"
9
"
column=
"1"
>
<widget
class=
"Utils::PathChooser"
name=
"keyFileLineEdit"
native=
"true"
/>
</item>
<item
row=
"5"
column=
"0"
>
<widget
class=
"QLabel"
name=
"gdbServerPortLabel"
>
<property
name=
"text"
>
<string>
Gdbserver Port:
</string>
</property>
</widget>
</item>
<item
row=
"5"
column=
"1"
>
<widget
class=
"QLineEdit"
name=
"gdbServerPortLineEdit"
/>
</item>
</layout>
</widget>
</item>
...
...
@@ -272,8 +282,8 @@ p, li { white-space: pre-wrap; }
<slot>
configNameEditingFinished()
</slot>
<hints>
<hint
type=
"sourcelabel"
>
<x>
3
72
</x>
<y>
14
6
</y>
<x>
3
96
</x>
<y>
14
5
</y>
</hint>
<hint
type=
"destinationlabel"
>
<x>
514
</x>
...
...
@@ -288,8 +298,8 @@ p, li { white-space: pre-wrap; }
<slot>
deviceTypeChanged()
</slot>
<hints>
<hint
type=
"sourcelabel"
>
<x>
26
4
</x>
<y>
1
75
</y>
<x>
26
7
</x>
<y>
1
69
</y>
</hint>
<hint
type=
"destinationlabel"
>
<x>
511
</x>
...
...
@@ -304,8 +314,8 @@ p, li { white-space: pre-wrap; }
<slot>
hostNameEditingFinished()
</slot>
<hints>
<hint
type=
"sourcelabel"
>
<x>
3
85
</x>
<y>
2
28
</y>
<x>
3
96
</x>
<y>
2
16
</y>
</hint>
<hint
type=
"destinationlabel"
>
<x>
424
</x>
...
...
@@ -314,14 +324,14 @@ p, li { white-space: pre-wrap; }
</hints>
</connection>
<connection>
<sender>
p
ortLineEdit
</sender>
<sender>
sshP
ortLineEdit
</sender>
<signal>
editingFinished()
</signal>
<receiver>
maemoSettingsWidget
</receiver>
<slot>
p
ortEditingFinished()
</slot>
<slot>
sshP
ortEditingFinished()
</slot>
<hints>
<hint
type=
"sourcelabel"
>
<x>
3
85
</x>
<y>
2
55
</y>
<x>
3
96
</x>
<y>
2
40
</y>
</hint>
<hint
type=
"destinationlabel"
>
<x>
514
</x>
...
...
@@ -384,8 +394,8 @@ p, li { white-space: pre-wrap; }
<slot>
deviceTypeChanged()
</slot>
<hints>
<hint
type=
"sourcelabel"
>
<x>
37
6
</x>
<y>
1
75
</y>
<x>
3
8
7
</x>
<y>
1
69
</y>
</hint>
<hint
type=
"destinationlabel"
>
<x>
426
</x>
...
...
@@ -521,12 +531,28 @@ p, li { white-space: pre-wrap; }
</hint>
</hints>
</connection>
<connection>
<sender>
gdbServerPortLineEdit
</sender>
<signal>
editingFinished()
</signal>
<receiver>
maemoSettingsWidget
</receiver>
<slot>
gdbServerPortEditingFinished()
</slot>
<hints>
<hint
type=
"sourcelabel"
>
<x>
218
</x>
<y>
255
</y>
</hint>
<hint
type=
"destinationlabel"
>
<x>
427
</x>
<y>
467
</y>
</hint>
</hints>
</connection>
</connections>
<slots>
<slot>
configNameEditingFinished()
</slot>
<slot>
deviceTypeChanged()
</slot>
<slot>
hostNameEditingFinished()
</slot>
<slot>
p
ortEditingFinished()
</slot>
<slot>
sshP
ortEditingFinished()
</slot>
<slot>
timeoutEditingFinished()
</slot>
<slot>
userNameEditingFinished()
</slot>
<slot>
passwordEditingFinished()
</slot>
...
...
@@ -537,5 +563,6 @@ p, li { white-space: pre-wrap; }
<slot>
keyFileEditingFinished()
</slot>
<slot>
testConfig()
</slot>
<slot>
deployKey()
</slot>
<slot>
gdbServerPortEditingFinished()
</slot>
</slots>
</ui>
src/plugins/qt4projectmanager/qt-maemo/maemosshconnection.cpp
View file @
b585cbda
...
...
@@ -74,8 +74,8 @@ MaemoSshConnection::MaemoSshConnection(const MaemoDeviceConfig &devConf,
authString
=
&
devConf
.
keyFile
;
connFunc
=
&
ne7ssh
::
connectWithKey
;
}
m_channel
=
(
ssh
.
*
connFunc
)(
devConf
.
host
.
to
Ascii
(),
devConf
.
p
ort
,
devConf
.
uname
.
toAscii
(),
authString
->
to
Ascii
(),
shell
,
devConf
.
timeout
);
m_channel
=
(
ssh
.
*
connFunc
)(
devConf
.
host
.
to
Latin1
(),
devConf
.
sshP
ort
,
devConf
.
uname
.
toAscii
(),
authString
->
to
Latin1
(),
shell
,
devConf
.
timeout
);
if
(
m_channel
==
-
1
)
throw
MaemoSshException
(
tr
(
"Could not connect to host"
));
}
...
...
@@ -130,7 +130,7 @@ void MaemoInteractiveSshConnection::runCommand(const QString &command)
ssh
.
lock
();
const
char
*
output
=
ssh
.
read
(
channel
(),
false
);
if
(
output
)
{
emit
remoteOutput
(
Q
Latin1
String
(
output
));
emit
remoteOutput
(
QString
::
fromUtf8
(
output
));
ssh
.
resetInput
(
channel
(),
false
);
}
ssh
.
unlock
();
...
...
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