Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
05-12-2004, 03:33 PM
|
#1
|
Member
Registered: Mar 2004
Location: USA
Distribution: Redhat Linux 9
Posts: 98
Rep:
|
howto use kdevelop to develop and debug a console program
Hi,
could someone in this forum explain me in detail the steps needed to build and debug a simple console application in C using the kdevelop environment?
The following C program can be used as an example:
/* test.c */
main()
{
printf("Hello world\n");
return 0;
}
What is the procedure in kdevelop to get this file in the kdevelop environment, into a new project, perform a build etc and set up a break point and then starting the debugger - gdb?
Thank you.
|
|
|
05-12-2004, 11:00 PM
|
#2
|
Member
Registered: Mar 2004
Location: Upstate NY
Distribution: Slackware/YDL
Posts: 77
Rep:
|
Create a project: Project->New Project->C->Simple Hello world
to build: Build->Build Project
To execute: Build->Execute Program
To set a breakpoint: Open source file right click on statement to break on and select 'Toggle Breakpoint'
To debug: Debug->Start
That's what I figured out in less than two minutes of playing.
|
|
|
05-13-2004, 03:24 PM
|
#3
|
Member
Registered: Mar 2004
Location: USA
Distribution: Redhat Linux 9
Posts: 98
Original Poster
Rep:
|
Hi,
got the debugger running.
some questions:
After setting the break point and running the program, how do we know the current execution is just waiting before the break point - visually?
Also as we (debug) step through the code, is there a way to visually see where the current execution is? (like a colored line in the source code indicating the line of code in execution).
Thank you.
|
|
|
05-13-2004, 04:22 PM
|
#4
|
Member
Registered: Mar 2004
Location: Upstate NY
Distribution: Slackware/YDL
Posts: 77
Rep:
|
Ok this is the last time I answer a question that takes looking in a menu or two to figure out:
To show breakpoints and current execution point: View->Show Icon Border
or F6
Sorry to sound pissy but...Maybe _try_ and find the answer yourself next time. The first time I used KDevelop was last night when you asked, I am now at a total of 3 or so minutes of use.
|
|
|
05-13-2004, 05:10 PM
|
#5
|
Member
Registered: Mar 2004
Location: USA
Distribution: Redhat Linux 9
Posts: 98
Original Poster
Rep:
|
Hi,
Actually my own search in kdevelop could not yield answers. This was the reason for my posting in the forum. But in anycase my apologies for asking the question. My kdevelop version is 2.1.5. However the option you specified under View->Show Icon Border is not there in my menu.
Thank you.
|
|
|
05-15-2004, 12:23 AM
|
#6
|
Member
Registered: Mar 2004
Location: USA
Distribution: Redhat Linux 9
Posts: 98
Original Poster
Rep:
|
hi kooch,
got the debugger problem resolved. somehow Kdevelop was not putting out the symbolics for the debugger to pick up. after setting the options (-g) in the project for gcc, doing autoconf, running 'configure', and then running make, proper executable was generated for the program! now it works great!
Thank you.
|
|
|
All times are GMT -5. The time now is 01:09 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|