Debugger[gdb]: Locate objdump in MinGW for release build check.

This commit is contained in:
Friedemann Kleint
2011-04-18 12:25:08 +02:00
parent 6630908b7f
commit a10e3a04d0

View File

@@ -38,6 +38,8 @@
#include "debuggercore.h"
#include "debuggerstringutils.h"
#include <projectexplorer/abi.h>
#include <utils/qtcassert.h>
#include <QtCore/QFileInfo>
@@ -126,6 +128,18 @@ void LocalPlainGdbAdapter::shutdownAdapter()
void LocalPlainGdbAdapter::checkForReleaseBuild()
{
QString objDump = _("objdump");
// Windows: Locate objdump in the debuggee's (MinGW) environment
if (ProjectExplorer::Abi::hostAbi().os() == ProjectExplorer::Abi::WindowsOS
&& startParameters().environment.size()) {
objDump = startParameters().environment.searchInPath(objDump);
} else {
objDump = Utils::Environment::systemEnvironment().searchInPath(objDump);
}
if (objDump.isEmpty()) {
showMessage(_("Could not locate objdump command for release build check"), LogWarning);
return;
}
// Quick check for a "release" build
QProcess proc;
QStringList args;
@@ -133,7 +147,7 @@ void LocalPlainGdbAdapter::checkForReleaseBuild()
args.append(_("-j"));
args.append(_(".debug_info"));
args.append(startParameters().executable);
proc.start(_("objdump"), args);
proc.start(objDump, args);
proc.closeWriteChannel();
if (!proc.waitForStarted()) {
showMessage(_("OBJDUMP PROCESS COULD NOT BE STARTED. "