This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: how to debug
- From: LLeweLLyn Reese <llewelly at lifesupport dot shutdown dot com>
- To: mla <wyl_lyf at yahoo dot com>
- Cc: gcc-help at gcc dot gnu dot org
- Date: 30 Jul 2003 07:55:54 -0700
- Subject: Re: how to debug
- References: <20030729124313.31958.qmail@web14505.mail.yahoo.com>
mla <wyl_lyf@yahoo.com> writes:
> Hello all! Do you guys know how I could debug a
> successful compilation? I have a program that I
> compile in different platforms. The program works and
> there are no bugs on it. And gcc/g++ finishes
> compiling the program without errors. but when I run
> the program it generates some error. is there a way to
> find out which flags should I add to the compiling
> process for the program to work? thanks!
You need to use -g to make gcc produce debugging information. Also,
you should turn off optimizations, do not supply any -O flags, as
they make debugging quite confusing, especially for one not used
to the ways that optimizers transform code.
If you want help with a particular error, please:
(a) write a short but complete example program which reproduces
the error, and paste it directly into your mailer.
(b) paste the error directly into your mailer.
(c) explain what you did, including all commandline options and
input.