LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Programming with KDevelop (https://www.linuxquestions.org/questions/linux-software-2/programming-with-kdevelop-275401/)

zipo13 01-08-2005 11:54 AM

Programming with KDevelop
 
Hi,
My first steps with linux programming I'm making with KDevelop (3.1.1 on Fedore Core 3).
I have downloaded a project which was developed with Kdevelop compiled it in debug configuration and executed it.
So far so good - no problems.
When I began to debug the code I managed to put some breakpoints but I couldn't go into the QT and KDE classes code.

I figured that the libs that I'm linking with do have debug info so I downloaded the qt-debuginfo rpm package and installed it.
Now I have it installed at: /usr/lib/debug/usr/lib but I can't figure out how to tell KDev to link with those libs instead of the default QT ones.

I've looked at the project settings and the Kdev setting and couldn't find anything useful.

I come from the VS 6 and VS .net world so maybe I'm used to doing things differently but I'm willing to learn :)

BTW what package to I need to install to debug KDE classes?

leonscape 01-08-2005 01:51 PM

What you usually need is development packages like qt-devel and kde-devel and similar. Which you may already have ( otherwise I'm not sure it would compile ).

Have you enabled debugging for libraries?
Goto the menu entry Project->Project Options... and go down the left hand list to debugger, and set "Try setting breakpoints in library loading"

zipo13 01-08-2005 02:03 PM

Hi,
I looked and I already had the "Try setting breakpoints in library loading" option set.
And I do have the qt-devel and the kde*-devel pakacges installed.
The problem is not that I can't set breakpoints in my code.
The problem is that I can't step into QT code or KDE code.
I know it links with KDE and QT libs but how does Kdevelop "knows" that the project should link with them?

leonscape 01-08-2005 02:28 PM

You can see this if you open the Automake Manager on the right, Then right click on the program name ( usually has ( program in bin ) appended to it ) and select options. In the flags tab $(KDE_RPATH) and $(all_libraries) and holders for some automake magic provided by scripts in the admin folder, these add paths for a KDE app.

If you click on libraries you'll probably see $(LIB_KDEUI) which is the kde user interface library, this gets replaced in the Makefile with -lkdeui or similar. When you link to the kdeui library all the libs it depends on ( kdecore, qt-mt ) also get linked in.

This is how it knows what to link with.

Is there any particular reason you want to step through the Qt and KDE classes? as its something I spend time trying to avoid...

zipo13 01-08-2005 02:55 PM

Thanks for answering these newbie questions.
I haven't noticed the tabs on the right till you mentioned they exist.

The reason I want to debug QT and KDE is that I want to learn about them.
I found that for me its better to just dive into the code and follow the flow of events.

I would avoid that too later but for now its interesting for me to lean the inner workings of the framework.

I have some more questions if you have the patience.

Where are the $(LIB_KDEUI) and others defined?
In my project I also have $(LIB_XCOMPOSITE) and $(LIB_XDAMAGE).

and is there a "define" that I can put to link with debug libs?

leonscape 01-08-2005 03:07 PM

If you look into the directory for your project you will find a sub folder called admin, This is a set of scripts put together by the KDE team to setup the definitions.

There done like this so KDE and it applications can be compiled on all the versions of Linux, *BSD, AIX and Solaris.

$(LIB_XCOMPOSITE) and $(LIB_XDAMAGE) are extensions to the X11 system, and these are defintions that point to the libraries.

To add the debugs you want, you'd have to replace $(KDE_RPATH) and $(all_libraries) with the paths you want i.e -L/usr/lib/debug/usr/lib, and others ( Check your make file in the debug directory to see what there currently pointing at ), and instead of using $(LIB_KDEUI) use -lkdeui

Due to the nature of Qt and KDE libs, with the SIGNAL SLOT mechanism, and the Linkage out to other libraries, I doubt you'll get a true picture of how everthing works, through watching them execute ( besides their pretty big :) ), but I wish you luck.

Heres some useful links for you:
KDE API
Qt Refrence Docs (API, Tutorials and explanations )
KDE Devlopers Corner, ( Tutorials, CVS, Tips )

zipo13 01-09-2005 01:35 AM

Hi,
Thanks for your help.
I'll try what you said as soon as I have some time.
Wish me luck....;)


All times are GMT -5. The time now is 09:51 AM.