How to debug gcc in Linux
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix Programming > How to debug gcc in Linux




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    How to debug gcc in Linux  
ern


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-20-05 11:05 PM

I'm using gcc in Linux to compile my program.  Is there a way to step
through the code in some kind of debugger mode?  Thanks.






[ Post a follow-up to this message ]



    Re: How to debug gcc in Linux  
David Schwartz


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-21-05 01:49 AM


"ern" <erniedude@gmail.com> wrote in message
news:1127253899.936108.228920@g14g2000cwa.googlegroups.com...

> I'm using gcc in Linux to compile my program.  Is there a way to step
> through the code in some kind of debugger mode?  Thanks.

Learn all about 'gdb'. It provides stepping, breakpoints, and
post-mortem debugging.

DS







[ Post a follow-up to this message ]



    Re: How to debug gcc in Linux  
Paul Pluzhnikov


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-21-05 07:50 AM

"ern" <erniedude@gmail.com> writes:

> I'm using gcc in Linux to compile my program.  Is there a way to step
> through the code in some kind of debugger mode?  Thanks.

In addition to "learn gdb" comment, please note that you selected
particularly bad subject for your post: the task that you want to
perform -- debug your own code (the compiler you used to compile
that code is mostly irrelevant) -- has absolutely nothing to do
with debugging gcc (the compiler itself) on Linux.

Cheers,
--
In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email.





[ Post a follow-up to this message ]



    Re: How to debug gcc in Linux  
Luotao Fu


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-21-05 07:50 AM

Hi,

ern schrieb:
> I'm using gcc in Linux to compile my program.  Is there a way to step
> through the code in some kind of debugger mode?  Thanks.
>

compile your code with -g flag,
gcc -g project.c -o project

the -g flag produces debug informations on the binary, which is
especially usable for gdb. You can also use some additional flags to
produce debug information in other formats.

After the compilition open the binary with gdb.
gdb project
you'll get a subshell, for the most important commandos on this subshell
(run, break, step, where etc.) pleas read the help. There're also some
GUI tools, ddd i.E. is a nice frontend for gdb.


Have fun
cheers
Luotao Fu





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 07:32 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register