Hi,
I'm having problems to make remote debugging work with Qt Creator. It
seems to be a bug in Qt Creator, or at least something that should be
improved on future releases. So I would like to share it in this list,
and hopefully one of you has already overcome the problem and could give
me hint !
I'm using Qt Creator 1.2.91 (snapshot) on Ubuntu 9.04 and I'm trying to
debug a program built for QtEmbedded-4.5.1 on a x86 based target running
a custom embedded linux. I was able to remotely debug the same
application with GDB alone and also with Eclipse, but not with Qt Creator.
After requesting the start of a debug session in Qt Creator, I get the
following error dialog:
----------------------------------------------------------------------------
Connecting to remote server failed:
31^error,data={msg="Don't know how to attach. Try \"help
target\".",logstreamoutput="attach\nDon't know how to attach. Try
\"help target\".\n",consolestreamoutput="A program is being debugged
already. Kill it? (y or n) [answered Y; input not from terminal]\n"}
----------------------------------------------------------------------------
The debug view shows the following messages (I have excluded some parts
for the sake of simplicity) :
----------------------------------------------------------------------------
sStarting debugger for tool chain 'GCC'...
dDebugger settings:
.
.
.
dState changed from DebuggerNotReady(0) to EngineStarting(1).
dState changed from EngineStarting(1) to AdapterStarting(2).
sNo server start script given. Assuming server runs already.
dTRYING TO START ADAPTER
dState changed from AdapterStarting(2) to AdapterStarted(3).
dState changed from AdapterStarted(3) to InferiorPreparing(5).
>~"GNU gdb 6.8\n"
.
.
.
>~"This GDB was configured as \"--host=i386-pc-linux-gnu
--target=i386-linux-uclibc\".\n"
dADAPTER SUCCESSFULLY STARTED, PREPARING INFERIOR
<33set architecture i386
<34-file-exec-and-symbols "<path to my project>/HelloWorld"
>&"set architecture i386\n"
>~"The target architecture is assumed to be i386\n"
>33^done
>34^done
<35target remote 192.168.0.180:1000
>&"target remote 192.168.0.180:1000\n"
>~"Remote debugging using 192.168.0.180:1000\n"
s[New Thread 601]
>~"[New Thread 601]\n"
>&"warning: Unable to find dynamic linker breakpoint function.\nGDB
will be unable to debug shared library initializers\nand track
explicitly loaded dynamic code."
>&"\n"
dState changed from InferiorPreparing(5) to InferiorPrepared(6).
sInferior prepared for startup.
sSetting breakpoints...
>~"0xb80dd8a4 in ?? ()\n"
>35^done
dINFERIOR PREPARED
<36show version
.
.
.
sStarting inferior...
dState changed from InferiorPrepared(6) to InferiorStarting(9).
sContinuing after temporary stop.
>&"show version\n"
>~"GNU gdb 6.8\n"
.
.
.
>36^done
dVERSION: 36^done,{logstreamoutput="show
version\n",consolestreamoutput="GNU gdb 6.8\nCopyright (C) 2008 Free
Software Foundation, Inc.\nLicense GPLv3+: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>\nThis is free software: you are free
to change and redistribute it.\nThere is NO WARRANTY, to the extent
permitted by law. Type \"show copying\"\nand \"show warranty\" for
details.\nThis GDB was configured as \"--host=i386-pc-linux-gnu
--target=i386-linux-uclibc\".\n"}
d
dGDB VERSION: 60800, BUILD: 0
>&"set print static-members off\n"
>37^done
>&"set print inferior-events 1\n"
>&"Undefined set print command: \"inferior-events 1\". Try \"help set
print\".\n"
>38^error,msg="Undefined set print command: \"inferior-events 1\". Try
\"help set print\"."
>&"set breakpoint pending on\n"
>39^done
>&"set print elements 10000\n"
>40^done
>41^done,register-names=["eax","ecx","edx","ebx","esp","ebp","esi","edi","eip","eflags","cs","ss","ds","es","fs","gs","st0","st1","st2","st3","st4","st5","st6","st7","fctrl","fstat","ftag","fiseg","fioff","foseg","fooff","fop","xmm0","xmm1","xmm2","xmm3","xmm4","xmm5","xmm6","xmm7","mxcsr","orig_eax","mm0","mm1","mm2","mm3","mm4","mm5","mm6","mm7"]
>&"set overload-resolution off\n"
>42^done
>&"handle SIGSEGV nopass stop print\n"
>~"Signal Stop\tPrint\tPass to program\tDescription\n"
>~"SIGSEGV Yes\tYes\tNo\t\tSegmentation fault\n"
>43^done
>&"set unwindonsignal on\n"
>44^done
>&"set width 0\n"
>45^done
>&"set height 0\n"
>46^done
<47attach
dState changed from InferiorStarting(9) to AdapterShuttingDown(19).
>&"attach\n"
>~"A program is being debugged already. Kill it? (y or n) [answered Y;
input not from terminal]\n"
>&"Don't know how to attach. Try \"help target\".\n"
>47^error,msg="Don't know how to attach. Try \"help target\"."
dINFERIOR START FAILED
dINITIATE GDBENGINE SHUTDOWN
<48-gdb-exit
>48^exit
dState changed from AdapterShuttingDown(19) to DebuggerNotReady(0).
dState changed from DebuggerNotReady(0) to DebuggerNotReady(0).
dGDB PROESS FINISHED
dADAPTER SUCCESSFULLY SHUT DOWN
----------------------------------------------------------------------------
Qt Creator also prints some debug messages on the terminal:
----------------------------------------------------------------------------
ASSERTION state() == InferiorRunningRequested FAILED AT
../../../../src/plugins/debugger/gdb/remotegdbadapter.cpp:251
InferiorStarting ( 9 )
ASSERTION false FAILED AT
../../../../src/plugins/debugger/gdb/remotegdbadapter.cpp:279
InferiorStarting ( 9 )
UNEXPECTED STATE TRANSITION: "State changed from InferiorStarting(9) to
AdapterShuttingDown(19)."
----------------------------------------------------------------------------
My guess is that the problem is the final 'attach' command sent to
gdbserver. Gdb and GdbServer are not agreeing on how to start the
program. I've tried to provide a start-up script for GDB in
Tools->Options->Debugger, without success.
Can someone give me a suggestion of what I should do to make it work ?
Thanks,
Rodrigo
_______________________________________________
Qt-creator mailing list
[email protected]
http://lists.trolltech.com/mailman/listinfo/qt-creator