On Wed, 2005-08-24 at 12:33 -0700, James E Wilson wrote: > Nick Clifton wrote: > > The reason for this behaviour is that the debug information is being > > written out before the variables have been fully resolved. In > > particular DECL_SET() for the second and third observer functions is > > NULL when the debug info is generated, which is why they are being > > given the DW_AT_const_value attribute. > > See PR 21828 where some possible solutions for a related problem got > discussed. Eventually, PR 21828 was fixed when Richard Henderson fixed > something else and Mark Mitchell's patch for PR 18556 got reverted. > This is discussed in the log. > > Meanwhile, there have been reports of some other related problems. > There is a report from Apple near the end of PR 21828 that mentions > stabs is still broken. This got rereported as PR 23190 and contains a > patch similar to ones discussed in PR 21828. > > The interface between the front ends and cgraph really needs to be > worked out here. Currently, the C and C++ front ends are calling some > cgraph functions in different orders, and we are having lots of debug > related problems. > > Maybe we need to move the calls to the debugging hooks from toplev into > cgraph, so that they are only called when a variable is finalized?
This is something i meant to do for 4.1, but didn't get to :( At this point, cgraph should definitely be driving the debug output, at least for the variables it knows about. IMHO. :) The blocker last time i looked was that we had to support non-unit-at-a-time, and thus, it wasn't at all clear to me what logic i could remove completely, and what logic needed to be ! flag_unit_at_a_time.