C Execution Problem

Tom St Denis tstdenis@ellipticsemi.com
Wed Feb 20 19:54:00 GMT 2008


Ponchi wrote:
> Hi all,
>
> gcc has succesfully compiled my C code without any warning and error, but
> when I tried to run the program even if I waited for a long time it still
> did not give any output, seems like running and running all the time. I
> checked the code and there is no possibility to have an infinite loop.
>
> On the other hand, I tried to find the problem by putting printf above all
> my function, and I think the problem is about reading .txt files. I checked
> the code thousands times but it is fine.
>
> Do you have any idea why the compilation is successful but I am still having
> trouble with running? May it be something about gcc, or is it just about my
> code?
>   

Debug your code?

Why not compile with debug syms turned on then use gdb to find out where 
it's hung by issuing  a SIGINT (e.g. ^C) and see what pops out?

You can also run it through strace and see if you're blocked on a syscall.

Tom



More information about the Gcc-help mailing list