Skip to content
GitLab
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
bd704d49
Commit
bd704d49
authored
Jan 12, 2011
by
Friedemann Kleint
Browse files
Debugger: Fix python path for Windows.
Fix
07cac219
. Reviewed-by:
Tobias Hunger
<
tobias.hunger@nokia.com
>
parent
e449c4c9
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/plugins/debugger/gdb/gdbengine.cpp
View file @
bd704d49
...
...
@@ -4122,26 +4122,31 @@ bool GdbEngine::startGdb(const QStringList &args, const QString &gdb, const QStr
const
QString
pythonPathVariable
=
QLatin1String
(
"PYTHONPATH"
);
QString
pythonPath
;
const
QString
environmentPythonPath
=
environment
.
value
(
pythonPathVariable
);
if
(
dir
.
exists
(
winPythonVersion
))
{
pythonPath
=
QDir
::
toNativeSeparators
(
dir
.
absoluteFilePath
(
winPythonVersion
));
}
else
if
(
dir
.
exists
(
QLatin1String
(
"lib"
)))
{
// Needed for our gdb 7.2 packages
pythonPath
=
QDir
::
toNativeSeparators
(
dir
.
absoluteFilePath
(
QLatin1String
(
"lib"
)));
}
else
{
if
(
environment
.
contains
(
pythonPathVariable
))
{
pythonPath
=
environment
.
value
(
pythonPathVariable
);
}
else
{
showMessage
(
_
(
"GDB %1 CANNOT FIND PYTHON INSTALLATION."
).
arg
(
m_gdb
)
)
;
showStatusMessage
(
_
(
"Gdb at %1 cannot find python"
).
arg
(
m_g
db
));
const
QString
msg
=
tr
(
"The gdb installed at %1 cannot "
"find a valid python installation in its %2 subdirectory.
\n
"
"You may set the PYTHONPATH to your installation."
)
.
arg
(
m_gdb
).
arg
(
winPythonVersion
);
handleAdapterStartFailed
(
msg
,
settingsIdHint
);
return
false
;
}
pythonPath
=
environmentPythonPath
;
}
if
(
pythonPath
.
isEmpty
())
{
const
QString
nativeGdb
=
QDir
::
toNativeSeparators
(
m_gdb
);
showMessage
(
_
(
"GDB %1 CANNOT FIND THE PYTHON INSTALLATION."
).
arg
(
nativeG
db
));
showStatusMessage
(
_
(
"%1 cannot find python"
).
arg
(
nativeGdb
));
const
QString
msg
=
tr
(
"The gdb installed at %1 cannot
"
"find a valid python installation in its %2 subdirectory.
\n
"
"You may set the PYTHONPATH to your installation."
)
.
arg
(
nativeGdb
).
arg
(
winPythonVersion
);
handleAdapterStartFailed
(
msg
,
settingsIdHint
)
;
return
false
;
}
environment
.
insert
(
pythonPathVariable
,
pythonPath
);
showMessage
(
_
(
"Python path: %1"
).
arg
(
pythonPath
),
LogMisc
);
// Apply to process
if
(
pythonPath
!=
environmentPythonPath
)
{
environment
.
insert
(
pythonPathVariable
,
pythonPath
);
gdbProc
()
->
setProcessEnvironment
(
environment
);
}
#endif
connect
(
gdbProc
(),
SIGNAL
(
error
(
QProcess
::
ProcessError
)),
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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