[Qt-creator] Using gdb to debug a remote application

Bravo.Alex Alex.Bravo at IGT.com
Tue Oct 13 23:54:36 CEST 2009


Hi guys,

I'm trying to use Qt Creator for debugging an executable on a remote machine.
I'm using 1.3 branch as of 10/12/2009.

Pretty much how it works is I set up Gdb start up script to connect from my host (Windows) to a target (QNX6.4.1).
Then I cross-compile my QNX executable to, say D:\Development\test
Windows folder D:\ Development is mapped to a QNX's /Development/ directory, so QNX machine sees my newly compiled file as /Development/test

Then I press F5 in Creator to debug it. This results in  Creator sending command
file-exec-and-symbols "D:\Development\test",
even though in settings I specified /Development/test inside of "Run Settings | Executable:"

When I change one line in plaingdbadapter.cpp, so it sends command file-exec-and-symbols "/Development/test",
everything works fine, and I can fully debug my program.

So the question: Do you think it's a good idea not to assume that what is sent to gdb is a Windows executable?
What about an option to allow a choice of whether to add drive name (and flip slashes from backward to forward)?

This is the one-line change I made, btw:
void PlainGdbAdapter::prepareInferior()
{
    QTC_ASSERT(state() == AdapterStarted, qDebug() << state());
    setState(InferiorPreparing);
    if (!startParameters().processArgs.isEmpty())
        m_engine->postCommand(_("-exec-arguments ")
            + startParameters().processArgs.join(_(" ")));
    QFileInfo fi(startParameters().executable);
//AB    m_engine->postCommand(_("-file-exec-and-symbols \"%1\"").arg(fi.absoluteFilePath()),
    m_engine->postCommand(_("-file-exec-and-symbols \"%1\"").arg(startParameters().executable), //AB
        CB(handleFileExecAndSymbols));
}

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-creator-old/attachments/20091013/90b9a270/attachment.html 


More information about the Qt-creator-old mailing list