Re: some points still missing
> You can do this by:
> - Compile with -g
> - copying the binary: cp -pv progname
> - striping the debug information from
> - install progname and progname.debug(or
> keep it).
> Then you have the stripped binary and
> the debug binary
> and if you need to debug or analyze a
> core file, just use
> the debug binary for example with gdb to
> analyze the core file:
> gdb progname.debug core
Or you can just ship stripped *known* binaries, and then ask users (who don't compile themselves) to email the core to you, where you have the unstripped binary.
If they compile themselves, of course, it should probably default to debug builds.
> My sugestion is simple, why not create a
> modifier for functions that would hint
> the compiler that this function depends
> only on it's parameters and nothing
> else. The compiler would then be able to
> mark call's to this functions that have
> static parameters and then when the
> liker see those calls it would simply
> call the
> function and replace the call entirely
> with the result.
gcc already has this. info gcc and search for 'pure', which implies a function doesn't do anything except return a result based on global functions and passed params. gcc 3 has an even stricter one called 'const' which implies it doesn't even look at global functions.
While I doubt gcc actually does this, it would be perfectly legal to just evaluate a function marked 'const' during a *compile* and sub in the value of it.