LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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


Reply
  Search this Thread
Old 07-27-2009, 05:25 PM   #1
debianD
Member
 
Registered: Jul 2009
Posts: 37

Rep: Reputation: 16
a gdb question !!


Hi ,
After this question it will be quite clear that I am Linux newbie.
Mostly I worked in Windows using VS 2005 and 08.
So the Microsoft debugger has a deep impact on my mind,I have heard that gdb is also a powerful debugger.
I tried to generate a core file, I know dump is always generated when there is a fault,does it mean a clean program can't be debug?
If no how?

Help appreciated.

Cheers!!
 
Old 07-27-2009, 05:35 PM   #2
raconteur
Member
 
Registered: Dec 2007
Location: Slightly left of center
Distribution: slackware
Posts: 276
Blog Entries: 2

Rep: Reputation: 44
gdb is indeed a powerful debugger. It can be a bit intimidating when used on the command line.
If you're familiar with symbolic debuggers in an IDE (Integrated Development Environment) such as Visual Studio, you'll probably be more comfortable using an IDE in Linux.
The symbolic debuggers integrated into most Linux IDEs are based on gdb.
It would be inappropriate for me to recommend any one IDE over another in this forum ;-) it is certainly a personal choice.
I recommend searching these forums for opinions regarding the available IDEs in addition to doing a web search for other opinions and options.
If you wish to use gdb on the command line, there are excellent guides available (again, look in these forums and elsewhere on the 'net).
You can set a wide range of breakpoints and data examination details in gdb, so the answer to your question is "no, it does not mean that a program that compiles cleanly cannot be debugged".
You just have to decide how you want to go about it.
 
Old 07-27-2009, 08:59 PM   #3
graemef
Senior Member
 
Registered: Nov 2005
Location: Hanoi
Distribution: Fedora 13, Ubuntu 10.04
Posts: 2,379

Rep: Reputation: 148Reputation: 148
Just to add to the post from raconteur, whilst and IDE may be teh solution for you there are standalone GUI frontends for gdb, such as cgdb (curses) KDgb (KDE) ddd (gnome) you may want to try these before selecting your IDE of choice, that way you can start to understand gdb.
Really before using gdb you want to compile your code with the -g switch to generate debugging information.
 
Old 07-27-2009, 09:17 PM   #4
bannock
LQ Newbie
 
Registered: Jun 2009
Location: Toronto
Distribution: Ubuntu, Fedora
Posts: 24

Rep: Reputation: 18
Quote:
Originally Posted by debianD View Post
I tried to generate a core file, I know dump is always generated when there is a fault,does it mean a clean program can't be debug?
You can start gdb with a core file using the 'core' command inside gdb.
Or you attach to your running process (compiled with -g) using 'gdb -p <pid>'
I'm not sure what you mean by 'clean program'.
 
Old 07-28-2009, 04:08 AM   #5
debianD
Member
 
Registered: Jul 2009
Posts: 37

Original Poster
Rep: Reputation: 16
thanks to All for your suggestions!
I have got this from google and found it really useful ,a base to kick off .
Forwarded by Mr Richard Stallman.
http://www.network-theory.co.uk/docs...tro/index.html

Clean program means = No error + no Warning

Cheers!!
 
  


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
Question about GDB..... webquinty Linux - Software 0 07-01-2008 11:26 AM
gdb / pstack question pchernik Linux - Software 2 06-25-2008 08:35 AM
Dumb question about gdb nc3b Programming 6 05-29-2007 07:36 AM
gdb c++ question markhod Programming 3 04-25-2007 01:45 PM
a question about gdb captainstorm Programming 5 10-07-2003 11:13 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:58 PM.

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