This is the mail archive of the
gdb-prs@sourceware.org
mailing list for the GDB project.
pascal/2223: The dwarf2 reader does not set language_pascal when encountering DW_LANG_Pascal83
- From: jonas at freepascal dot org
- To: gdb-gnats at sources dot redhat dot com
- Date: 1 Feb 2007 20:58:14 -0000
- Subject: pascal/2223: The dwarf2 reader does not set language_pascal when encountering DW_LANG_Pascal83
- Reply-to: jonas at freepascal dot org
>Number: 2223
>Category: pascal
>Synopsis: The dwarf2 reader does not set language_pascal when encountering DW_LANG_Pascal83
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: patch
>Submitter-Id: net
>Arrival-Date: Thu Feb 01 21:08:01 GMT 2007
>Closed-Date:
>Last-Modified:
>Originator: jonas@freepascal.org
>Release: 6.3.50/6.3.0.0/CVS head 2007-02-01
>Organization:
>Environment:
Tested on Mac OS X/ppc 10.4.8/Xcode 2.4.1 (GNU gdb 6.3.50-20050815 (Apple version gdb-573)) and Scientific Linux SL release 4.4 (Beryllium) (GNU gdb Red Hat Linux (6.3.0.0-1.132.EL4rh)). Patch a
>Description:
The dwarf2 reader sets the current language to "language_minimal" rather than to "language_pascal" if the debug information specifies DW_LANG_Pascal83.
>How-To-Repeat:
Compile any program with gpc with -gdwarf-2 (or with Free Pascal with -gw2), load the result in gdb, set a breakpoint on "main" (resp. PASCALMAIN) and run. When hitting the breakpoint, gdb will say this:
Current language: auto; currently minimal
as opposed to this when compiling with stabs and after typing "show lang":
The current source language is "auto; currently pascal".
The patch below fixes that so the language is properly set to Pascal in case the dwarf debug info says it's DW_LANG_Pascal83.
>Fix:
--- dwarf2read.c.org 2007-02-01 21:15:16.000000000 +0100
+++ dwarf2read.c 2007-02-01 21:16:32.000000000 +0100
@@ -6325,9 +6325,11 @@
case DW_LANG_Modula2:
cu->language = language_m2;
break;
+ case DW_LANG_Pascal83:
+ cu->language = language_pascal;
+ break;
case DW_LANG_Cobol74:
case DW_LANG_Cobol85:
- case DW_LANG_Pascal83:
default:
cu->language = language_minimal;
break;
>Release-Note:
>Audit-Trail:
>Unformatted: