This is the mail archive of the gcc-patches@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]

[debug-early] emit early dwarf for locally scoped functions


Hi Jason.

I found that for locally scoped functions we were not emitting early dwarf. I've removed the restriction that only emitted non function-context functions to handle the case below. BTW, this shouldn't be a (bloat) problem, as we are going to clean up unused DIEs later (well, next week :)).

void foobar ()
{
  class Object {
  public:
    char Object_method ()
    {
      return 5;
    }
  };

  Object local;
  local.Object_method();
}

There was also a GDB regression with the above test (distilled from gdb.cp/local.cc) where Object_method's type was being generated as

	char Object_method (const Object *)

(or something like it). The problem was that gen_formal_types_die was creating nameless DIEs for the formal parameters when generating an object's members, but mainline was removing these nameless DIEs and I had mistakenly removed that bit. I'm putting the code back in, but guarding it with early_dwarf_dumping, since by the time we get to late debug, we should have the correct named parameters which should then be augmented with location information.

This patch fixes the gdb.cp/local.cc regressions, while generating early dwarf for Object_method and associates.

I'm committing to the branch.  Let me know if you have a problem with this.

Tested with the guality.exp suite as well as the GDB testsuite.

Aldy

Attachment: curr
Description: Text document


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