kdevelop and debug with libtool

Andreas Pakulat apaku at gmx.de
Fri Nov 9 20:24:47 GMT 2012


Hi,

On Fri, Nov 9, 2012 at 8:20 PM, dAgeCKo <dagecko at free.fr> wrote:
> I was used to debug directly on the console. But now I'd like to use
> kdevelop to ease my life a bit since the programs I have to debug are quite
> big.
>
> The project is a set of several libraries (.so) and several binary
> executable files, which, since I use libtool to create the libraries, are
> hidden in a subdirectory and replaced by a script file.
> So, to debug them manually I usually enter such a command:
>
> libtool --mode=execute gdb 'name_of_the_script'
>
> I tried to make kdevelop does it this way, but failed all my attempts.
>
> On the Internet, when searching, I could see that this is a common problem
> with Kdevelop since several years (I could saw topics from 2006 for example,
> and Kdevelop 3.x series).
>
> So, is the problem still not solved ?

There's no dedicated code in KDevelop 4 to handle libtool-stuff,
KDevelop3 had such code in its automake-support (which uses libtool)
but that has not been ported so far.

> How do people using kdevelop achieve to debug programs using libtool ?

I guess they either don't use libtool or don't use kdevelop for
debugging. Maybe some dropped libtool or they went back to commandline
or some other UI for gdb. I know there is interest from time to time,
but especially the gdb area in kdevelop is lacking someone with the
time and knowledge to maintain it.

> I can't beleive people here just use the console instead: it will make the debug tools from
> kdevelop quite useless, since, AFAIK, libtool projects are quite predominant over simple binary
> projects

That actually depends on where you look and who you ask. I haven't
touched any autotools or libtool-using project since 2006 or 2007
(ever since I stopped working on KDev3).

And its not enough if the users are needing libtool support, it
requires someone who has interest, time and the knowledge to work with
gdb and it mi-interface. As far as I know this is anything but simple
since its relatively badly maintained upstream, its hard to get stuff
fixed upstream and often requires trial&error to work with it. (note
this is based on various things that our previous gdb-expert said in
the past, so it may be outdated these days).

> * entered the debugger executable as libtool --mode=execute gdb
> -> nothing happens

That probably only works if libtool is an actual executable file. If
its a shell script you'll probably have to add a shell to the
commandline. I don't think KDevelop starts the executable through a
shell interpreter and thus it needs to be an actual executable.

Also you'll need to insert the commandline arguments to enable the
so-called MI mode of GDB since thats what KDevelop expects. I don't
know which those are, but starting a debug session should show them
inside the GDB tab when you enable the internal commands (or ps output
should show them).

Andreas




More information about the KDevelop mailing list