dwarfout.c bugfix revision 2

Toshiyasu Morita tm@netcom.com
Tue Feb 23 11:37:00 GMT 1999


Looks like my previous patch was bad - fully qualified names are not 
supposed to be emitted. However, the existing code doesn't emit correct 
information either.

Currently, for a destructor, GCC emits a DWARF1 AT_name without the 
leading tilde:

.L_D10:
        .ualong .L_D10_e-.L_D10
        .uaword 0x6     ! TAG_global_subroutine
        .uaword 0x12    ! AT_sibling
        .ualong .L_D14
        .uaword 0x38    ! AT_name
        .string "foo"
        .uaword 0x142   ! AT_member
        .ualong .L_T107
        .uaword 0x111   ! AT_low_pc
        .ualong __._3foo
        .uaword 0x121   ! AT_high_pc
        .ualong .L_f2_e
        .uaword 0x8041  ! AT_body_begin
        .ualong .L_b2
        .uaword 0x8051  ! AT_body_end
        .ualong .L_b2_e

With this patch the leading tilde is emitted properly:

.L_D10:
        .ualong .L_D10_e-.L_D10
        .uaword 0x6     ! TAG_global_subroutine
        .uaword 0x12    ! AT_sibling
        .ualong .L_D14
        .uaword 0x38    ! AT_name
        .string "~foo"
        .uaword 0x142   ! AT_member
        .ualong .L_T107
        .uaword 0x111   ! AT_low_pc
        .ualong __._3foo
        .uaword 0x121   ! AT_high_pc
        .ualong .L_f2_e
        .uaword 0x8041  ! AT_body_begin
        .ualong .L_b2
        .uaword 0x8051  ! AT_body_end
        .ualong .L_b2_e

Fri Feb 23 11:33:19 1999  Toshiyasu Morita <tm@netcom.com>

        * dwarfout.c (name_and_src_coords_attributes): When emitting a
        TAG_global_subroutine's AT_name, use decl_printable_name (decl, 0)
        instead of IDENTIFIER_POINTER (decl_name).

diff -c dwarfout.c.orig dwarfout.c
*** dwarfout.c.orig     Mon Feb 22 17:41:45 1999
--- dwarfout.c  Tue Feb 23 00:21:15 1999
***************
*** 3049,3055 ****

    if (decl_name && IDENTIFIER_POINTER (decl_name))
      {
!       name_attribute (IDENTIFIER_POINTER (decl_name));
  #ifdef DWARF_DECL_COORDINATES
        {
        register unsigned file_index;
--- 3049,3055 ----

    if (decl_name && IDENTIFIER_POINTER (decl_name))
      {
!       name_attribute (decl_printable_name (decl, 0));
  #ifdef DWARF_DECL_COORDINATES
        {
        register unsigned file_index;

Toshi


More information about the Gcc-patches mailing list