linux-users archive

Re: Beginner Linux C (debugger) question


New Message Reply Date view Thread view Subject view Author view

From: Basher584 (email_suppressed_at_lugwash.org)
Date: Fri 07-Feb-2003 09:22:58 AM EST


On Fri, Feb 07, 2003 at 03:50:14AM -0500, Steve @LugWash wrote:
> I'm VERY green here with C
>
> Am currently going through a C programming tutorial.
> Per the textbook instructions it says:
>
> "It is important that you can compile & debug a simple program such as the
> one above. Type the program into the editor provided with your compiler,
> compile and link. If there are errors check closely that you have typed
> the program exactly as it appears on the page.
> Next, single step through the program in the debugger."
>
>
>
> OK I am using my favorite editor (vi) to enter the simple you guessed it,
> "hello world" program.
> Using either cc or gcc seems to compile it just fine.
> it creates a working executable (a.out)
> also seems to 'link' it as well as I am not doing any seperate linking
> process.
> Now um... about the debugging...
> Is there a single step debugger in Linux for C ?
> Searching the web does not turn up anything really obvious to a beginner.
> I discovered GDB but do not have a clue how to use it and it seems to
> be more for C++ and not really for C.
> I'm just seeking a kick in the general direction of some good reading
> This tutorial is awesome and explains the hell out of basic getting
> started with C but it assumes I have a debugger and have a clue how to
> load my program into it and single step it.
>
> Thanks for any pointers you might have!
>
>
> Steve
>

make sure you compile your program with debug data.. (-g)
gcc hello.c -g -o hello

A good graphical debugger is DDD
http://www.gnu.org/software/ddd/

ddd hello

-Ben

--
***  Sent from [e-mail suppressed]  ***  http://www.lugwash.org
to unsubscribe: `echo "unsubscribe" | mail [e-mail suppressed]`

New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.1.5 : Sat 01-Mar-2003 01:00:03 AM EST