This is the mail archive of the gdb@sourceware.org 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]
Other format: [Raw text]

Re: More "catch assert" Ada failures


> OK, thanks to Daniel's help, I'm able to reproduce the issue. The issue
> in this case is that the name attributed for the entity is not following
> the GNAT encoding:
> 
>      <1><8e990>: Abbrev Number: 9 (DW_TAG_subprogram)
>          DW_AT_sibling     : <8e9b7>
>          DW_AT_external    : 1
>          DW_AT_name        : (indirect string, offset: 0x48349): system.assertions.raise_assert_failure
>          DW_AT_decl_file   : 2
>          DW_AT_decl_line   : 42
>          DW_AT_low_pc      : 0x1a73a0
>          DW_AT_high_pc     : 0x1a73d8
>          DW_AT_frame_base  : 0x857ee        (location list)
> 
> The dots should actually be "__". Not sure why this is happening,
> however. I'll see if I can get a hint or two from my compiler collegues...

With the help of Eric Botcazou, we determined GCC built straight from
the FSF tree follows our encoding, and thus does not have the "__"
replaced by dots. So it looks like it's something that the Debian
version of GCC might be doing differently. Apparently, the name
attribute generation is generated by:

  /* Generate a DW_AT_name attribute given some string value to be included as
     the value of the attribute.  */

  static void
  add_name_attribute (dw_die_ref die, const char *name_string)
  {
    if (name_string != NULL && *name_string != 0)
      {
        if (demangle_name_func)
          name_string = (*demangle_name_func) (name_string);

        add_AT_string (die, DW_AT_name, name_string);
      }
  }

In our case (GNAT compiler), demangle_name_func is NULL, so we
emit the encoded name without any modification. Maybe that's
where Debian GCC does things differently?

-- 
Joel


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