[Qt-creator] libgdbmacros.so won't get loaded fordebuggedapplication

Eike Ziller eike.ziller at nokia.com
Mon Jan 5 12:47:25 CET 2009


On Dec 30, 2008, at 10:08 PM, ext Illich Jan wrote:

> Andre Poenitz wrote:
>>
>>> 1. On an older systems (CentOS 4.6) the libgdbmacros.so won't get
>>> loaded into the debugged application. I know that the distribution's
>>> gdb (old 6.3 version) is not supported, but I have relatively
>>> up-to-date versions of development tools installed (Qt 4.4.1, gdb
>>> 6.7.1, gcc 4.1.2). Debugged app is linked against Qt 4.4.1.
>>
>> I assume that Options -> Debugger -> Gdb  points to the 6.7.1 gdb...
>>
>> Could you check whether 'ldd libgdbmacros.so.1.0.0' does not yield
>> unresolved libraries, and also whether the Qt version it points to
>> is the same as the one used by your application?
>
> I've dug around a bit and found out that it's some sort of dynamic  
> linker or gdb symbol resolver issue (even upgrading to latest gdb  
> 6.8 did not help).
>
> When qtcreator tries to send 'call dlopen("...libgdbmacros"...)' to  
> gdb, gdb responds 'No symbol "dlopen" in current context.'
>
> As a temporary workaround, dlopen()ing libgdbmacros.so in debugged  
> app's main() makes it work (Qt structures are shown correctly then).
>
> For some obscure reason, gdb cannot resolve 'dlopen' symbol, only  
> dlopen's procedure linkage table (PLT) proxy 'dlopen at plt'. I tried  
> an ugly hack: changing the line
>
> sendCommand("call dlopen(\"" + lib + "\", " + flag + ")");
> to
> sendCommand("call 'dlopen at plt'(\"" + lib + "\", " + flag + ")");
>
> in src/plugins/debugger/gdbengine.cpp makes it work - provided that  
> dlopen has been called at least once from debugged app (for any  
> library) before gdb gets this command. For some reason the PLT proxy  
> does not work correctly if it's called from gdb context to resolve  
> the real function address (which is done first time the proxy is  
> called).

Could you try
         sendCommand("call (void)dlopen(\"" + lib + "\", " + flag +  
")");
like it is done in the Q_OS_MAC part of the code?

Thanks, Eike

-- 
Eike Ziller
Software Engineer
Nokia, Qt Software
Phone  +49 (0)30 6392 3255
Fax    +49 (0)30 6392 3256
E-mail eike.ziller at nokia.com







More information about the Qt-creator-old mailing list