LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-08-2005, 11:54 AM   #1
zipo13
LQ Newbie
 
Registered: Mar 2004
Posts: 24

Rep: Reputation: 15
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?
 
Old 01-08-2005, 01:51 PM   #2
leonscape
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Debian SID / KDE 3.5
Posts: 2,313

Rep: Reputation: 48
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"
 
Old 01-08-2005, 02:03 PM   #3
zipo13
LQ Newbie
 
Registered: Mar 2004
Posts: 24

Original Poster
Rep: Reputation: 15
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?
 
Old 01-08-2005, 02:28 PM   #4
leonscape
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Debian SID / KDE 3.5
Posts: 2,313

Rep: Reputation: 48
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...
 
Old 01-08-2005, 02:55 PM   #5
zipo13
LQ Newbie
 
Registered: Mar 2004
Posts: 24

Original Poster
Rep: Reputation: 15
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?
 
Old 01-08-2005, 03:07 PM   #6
leonscape
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Debian SID / KDE 3.5
Posts: 2,313

Rep: Reputation: 48
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 )
 
Old 01-09-2005, 01:35 AM   #7
zipo13
LQ Newbie
 
Registered: Mar 2004
Posts: 24

Original Poster
Rep: Reputation: 15
Hi,
Thanks for your help.
I'll try what you said as soon as I have some time.
Wish me luck....
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
which programming language is used to do tcp/ip programming?? gajaykrishnan Linux - Networking 9 12-21-2012 05:16 AM
Java Programming with KDevelop? Corallis Linux - Newbie 5 03-10-2006 05:57 PM
Difference between Top Down programming & Bottom up programming minil Programming 1 06-17-2005 02:42 AM
kdevelop programming demmylls Programming 0 10-09-2003 01:40 PM
Thread Programming on KDevelop 1.4 Nguyen Hai Nam Programming 0 11-13-2001 02:41 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:40 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration