This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Unifying the GCC Debugging Interface


On 11/21/2012 02:33 PM, Gabriel Dos Reis wrote:
On Wed, Nov 21, 2012 at 7:07 AM, Tobias Grosser <tobias@grosser.es> wrote:
On 11/20/2012 08:32 PM, Basile Starynkevitch wrote:

On Tue, Nov 20, 2012 at 11:24:40AM -0800, Lawrence Crowl wrote: [....]

All of these functions come in two forms.


       function (FILE *, item_to_dump, formatting)
       function (item_to_dump, formatting)


Since we have switched to C++, it would be really nice to have dump
functions
writing to a C++ std::ostream


If I understood correctly, including iostream may (depending on your c++
library) introduce static constructors in every translation unit.

This is obviously false on the fac

Sorry. I did not express this carefully.


Also, I probably did not make clear that I am not proposing to not use iostream, but rather asking of someone knowledgeable who understands the costs.

Is it correct to state that every translation unit that includes iostream will include the iostream static constructors? Will the number of static constructors increase linearly with the number of translation units? Is it necessary to include iostream in a core header, in case we want to use iostream for the debugging functionality?

e of it. Only the translation that includes
iostream gets the niftty counters.

Furthermore, not including iostream does not mean you don't
get static constructors -- GCC has lot of global variables and if
any of them incures dynamic initialization, you get
dynamic initialization.  Note also that if you explicitly delay
initialization to runtime, you are going to pay for it anyway
through brittle manual initialization.

I was mainly interested in compering FILE* and iostream. To my knowledge the FILE* interface does not have any significant construction overhead.


This could
negatively impact the startup time of gcc.

Do you have concrete data point on this specific case? (I am not asking for artificial benchmark)

No. I just heard about it and wanted to verify that this is a non-issue.


The cost you get with iostream isn't with dynamic
intiialization, it is with something else (notably locales.)

Thanks for the pointer.


Cheers
Tobi


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