Thanks Brett I might try doing some debugging using a GUI front end to make things a little easier to work out and quicker. Failing that I might set one of my less Linuxly challenged mates to see if they can get it up and running. Regards, Kim
_____ From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Brett W. McCoy Sent: Sunday, 27 May 2007 10:47 AM To: [email protected] Subject: Re: [c-prog] Debugging code with many #ifdef statements On 5/26/07, mop <[EMAIL PROTECTED] <mailto:mop%40arach.net.au> au> wrote: > I wish to debug a code that has a lot of #ifdef statements. The code is old > and as I understand it, it is no longer maintained. It's a Linux/Unix > application and it appears that the #ifdef statements relate to the > differnet operating systems. It makes it an absolute bitch to trace through > in a debugger, and to work out what to expect the code to do. Is there a way > to pre-process the source code on the operating system that I am using to > remove the #ifdef statements leaving only the code for that system? I am > trying to get it working on Debian. With gcc I could use the -E switch, but > will require quite a bit of manual source code editing. > > Does anyone have any other suggestions? Using -E with gcc (or using cpp, which amounts to the same thing, generating pre-processed source code) is about all you can do here, aside from rewriting the code, unless there is some way to conditionally pre-process... -- Brett ---------------------------------------------------------- "In the rhythm of music a secret is hidden; If I were to divulge it, it would overturn the world." -- Jelaleddin Rumi [Non-text portions of this message have been removed]
