public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug symtab/12441] New: Wrong language selected when DW_AT_language tag is missing from the DWARF header
@ 2011-01-26  2:28 JPEWdev at gmail dot com
  2011-01-26  2:31 ` [Bug symtab/12441] " JPEWdev at gmail dot com
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: JPEWdev at gmail dot com @ 2011-01-26  2:28 UTC (permalink / raw)
  To: gdb-prs

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.


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-03-28 19:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-26  2:28 [Bug symtab/12441] New: Wrong language selected when DW_AT_language tag is missing from the DWARF header JPEWdev at gmail dot com
2011-01-26  2:31 ` [Bug symtab/12441] " JPEWdev at gmail dot com
2011-03-28 19:17 ` tromey at redhat dot com
2011-03-28 19:55 ` cvs-commit at gcc dot gnu.org
2011-03-28 21:01 ` tromey at redhat dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).