Baruch Even wrote:

Shachar Shemesh wrote:

Hi all,

I'm trying to debug a C++ program I'm writing using ddd. Up until a few days ago everything was fine. I compiled with -g -Wall (and no -O), and everything worked. Today it stopped working.

It seems the compiler insists on expanding all inline functions into the function context. As a result, any function that uses auto_ptrs and std:string becomes impossible to debug. You spend most of your time jumping around inline functions, and don't get to see the code you wrote.

[snip]

I have tried "-fno-inline" and "-fno-default-inline", and they do not affect this behavior. This is not so surprising, as inlining is supposed to be off when there is no -O, and so one shouldn't be surprised when they don't make a difference.


Maybe you can try -O0 or -Os (optimize for size). Advice on the net seems to imply that only -Os will completely disable inlines. YMMV.

Praise Thor, the god of programmers, -O0 worked. Grrr. -Os didn't, btw.

So, without asking for any specific optimization level, previous gcc versions did no optimizations at all. What does the current version do?

As a sidenote - I'll mention that I already solved the specific bug using good ol' debug printfs.

If it's functions that are defined inline you can try to
#define inline
In your case it sounds like methods defined in the header of a class, no idea about those.

One would expect that telling the compiler not to inline would cause it not to inline. I guess one would be optimistic.


My memory claims there is an option to set inline according to complexity, but then my memory tends to invent things it wants (a hot sun for example).

-finline-limit ?

Baruch

Shachar

--
Shachar Shemesh
Lingnu Open Source Consulting ltd.
Have you backed up today's work? http://www.lingnu.com/backup.html


================================================================= To unsubscribe, send mail to [EMAIL PROTECTED] with the word "unsubscribe" in the message body, e.g., run the command echo unsubscribe | mail [EMAIL PROTECTED]



Reply via email to