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

* [Bug symtab/12441] Wrong language selected when DW_AT_language tag is missing from the DWARF header
  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 ` JPEWdev at gmail dot com
  2011-03-28 19:17 ` tromey at redhat dot com
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: JPEWdev at gmail dot com @ 2011-01-26  2:31 UTC (permalink / raw)
  To: gdb-prs

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

JPEWdev at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |JPEWdev at gmail dot com

-- 
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

* [Bug symtab/12441] Wrong language selected when DW_AT_language tag is missing from the DWARF header
  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
  3 siblings, 0 replies; 5+ messages in thread
From: tromey at redhat dot com @ 2011-03-28 19:17 UTC (permalink / raw)
  To: gdb-prs

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

Tom Tromey <tromey at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tromey at redhat dot com
         AssignedTo|unassigned at sourceware    |tromey at redhat dot com
                   |dot org                     |

--- Comment #1 from Tom Tromey <tromey at redhat dot com> 2011-03-28 19:10:47 UTC ---
Testing a (similar) patch.

-- 
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

* [Bug symtab/12441] Wrong language selected when DW_AT_language tag is missing from the DWARF header
  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
  3 siblings, 0 replies; 5+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2011-03-28 19:55 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #2 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> 2011-03-28 19:53:18 UTC ---
CVSROOT:    /cvs/src
Module name:    src
Changes by:    tromey@sourceware.org    2011-03-28 19:53:14

Modified files:
    gdb            : ChangeLog dwarf2read.c 

Log message:
    PR symtab/12441:
    * dwarf2read.c (prepare_one_comp_unit): Don't call set_cu_language
    with `language_minimal'.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/ChangeLog.diff?cvsroot=src&r1=1.12863&r2=1.12864
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/dwarf2read.c.diff?cvsroot=src&r1=1.514&r2=1.515

-- 
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

* [Bug symtab/12441] Wrong language selected when DW_AT_language tag is missing from the DWARF header
  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
                   ` (2 preceding siblings ...)
  2011-03-28 19:55 ` cvs-commit at gcc dot gnu.org
@ 2011-03-28 21:01 ` tromey at redhat dot com
  3 siblings, 0 replies; 5+ messages in thread
From: tromey at redhat dot com @ 2011-03-28 21:01 UTC (permalink / raw)
  To: gdb-prs

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

Tom Tromey <tromey at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |7.3

--- Comment #3 from Tom Tromey <tromey at redhat dot com> 2011-03-28 19:54:59 UTC ---
Fixed.

-- 
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).