This is the mail archive of the gdb@sourceware.cygnus.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

GCC: -D definitions in executable ???


A friend of mine at work was complaining about some third party source
code and all the #ifdefs contained within.  It was so hard to read and
figure out what is going on.  He is dead against them unless they are
absolutely necessary.  I agree but I think they are necessary more often
than he would like.  I argued that to have multiple copies of the same
code for different targets or compile options makes for big
synchronisation problems and is a software maintenance nightmare.

Anyways, I wondered if it was possible to put all the -D definitions (or
all entrire command line) in the output file debug sections.  Maybe this
or something similar already exists ?

With this type of feature, it would be possible for smart debuggers,
such as gdb, to highlight code that was not conditionally compiled, in
another color or even not be displayed.  I'm thinking of debugger GUIs.

Smart editors could also make use of this feature, except that they
would have to get this info from somewhere else.  ie. not the
executable.  Maybe a makefile/project.  I haven't thought this one
through yet.

Any ideas or comments from the GCC/GDB community ?

Thanks,
Brendan Simon.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]