[Bug symtab/12441] New: Wrong language selected when DW_AT_language tag is missing from the DWARF header

JPEWdev at gmail dot com sourceware-bugzilla@sourceware.org
Wed Jan 26 02:28:00 GMT 2011


http://sourceware.org/bugzilla/show_bug.cgi?id=12441

           Summary: Wrong language selected when DW_AT_language tag is
                    missing from the DWARF header
           Product: gdb
           Version: 7.2
            Status: NEW
          Severity: normal
          Priority: P2
         Component: symtab
        AssignedTo: unassigned@sourceware.org
        ReportedBy: JPEWdev@gmail.com


Created attachment 5213
  --> http://sourceware.org/bugzilla/attachment.cgi?id=5213
Example Patch file

If the header for a compilation unit is missing the DW_AT_language, the
language for the compilation unit is set to ADA (at least for GDB version 7.2). 

Searching through the code, the problem appears to be located in dwarf2read.c.
There are several places where set_cu_language() is called like so:

  attr = dwarf2_attr (cu->dies, DW_AT_language, cu);
  if (attr)
    set_cu_language (DW_UNSND (attr), cu);
  else
    set_cu_language (language_minimal, cu);

Since set_cu_language() maps a DWARF Language constant to an internal language
type, passing language_minimal as the first parameter when the tag cannot be
found is incorrect.

A suggested patch for the 7.2 code is attached.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the Gdb-prs mailing list