This is the mail archive of the gdb-prs@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: pascal/1477: gdb can not read DWARF-2 debug info about set types


The following reply was made to PR pascal/1477; it has been noted by GNATS.

From: Waldek Hebisch <hebisch@math.uni.wroc.pl>
To: muller@ics.u-strasbg.fr, gdb-prs@sources.redhat.com, 
 hebisch@math.uni.wroc.pl, nobody@sources.redhat.com, 
 gdb-gnats@sources.redhat.com
Cc:  
Subject: Re: pascal/1477: gdb can not read DWARF-2 debug info about set types
Date: Tue, 20 Feb 2007 22:57:15 +0100 (CET)

 > Synopsis: gdb can not read DWARF-2 debug info about set types
 > 
 > Responsible-Changed-From-To: unassigned->muller
 > Responsible-Changed-By: muller
 > Responsible-Changed-When: Mon Feb  5 16:48:53 2007
 > Responsible-Changed-Why:
 >     Pascal specific
 > State-Changed-From-To: open->feedback
 > State-Changed-By: muller
 > State-Changed-When: Mon Feb  5 16:48:53 2007
 > State-Changed-Why:
 >       Could you please test gdb 6.6, I think that
 >     this issue should be solved due to an ADA patch.
 >     ADA language apparently also has sets.
 > 
 > http://sourceware.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gdb&pr=1477
 > 
 
 The testcase included in the report works now.  However, there are still
 problems:
 - gdb does not recognize the program as a Pascal program (I have to
 use 'set language pascal', otherwise I get:
 
 hebisch@iduo2:~$ gcc/gdb-build/gdb/gdb ./a.out
 GNU gdb 6.6
 Copyright (C) 2006 Free Software Foundation, Inc.
 GDB is free software, covered by the GNU General Public License, and you are
 welcome to change it and/or distribute copies of it under certain conditions.
 Type "show copying" to see the conditions.
 There is absolutely no warranty for GDB.  Type "show warranty" for details.
 This GDB was configured as "x86_64-unknown-linux-gnu"...
 Using host libthread_db library "/lib/libthread_db.so.1".
 (gdb) break _p__M0_main_program
 Breakpoint 1 at 0x4029fc: file set1.pas, line 5.
 (gdb) run
 Starting program: /var/tmp/hebisch/a.out
 
 Breakpoint 1, main program () at set1.pas:6
 6       begin
 Current language:  auto; currently minimal
 (gdb) s
 7          dummy := [bar];
 (gdb) print dummy
 $1 = <error reading variable>
 (gdb) s
 Hello
 10      .
 (gdb) print dummy
 $2 = <error reading variable>
 (gdb)
 
 Also, a slightly more complicated program causes troubles:
 
 
 var
   foo: set of 1 .. 42 = [4 .. 27];
   i: Integer;
 
 begin
   i := 15;
   Exclude (foo, i);
   i := 3;
   Include (foo, i);
   if foo = [3 .. 14, 16 .. 27] then
     WriteLn ('OK')
   else
     WriteLn ('failed')
 end.
 
 gpc -g sets14b.pas
 sets14b.pas:1: warning: missing program header
 hebisch@iduo2:~$ gcc/gdb-build/gdb/gdb ./a.out
 GNU gdb 6.6
 Copyright (C) 2006 Free Software Foundation, Inc.
 GDB is free software, covered by the GNU General Public License, and you are
 welcome to change it and/or distribute copies of it under certain conditions.
 Type "show copying" to see the conditions.
 There is absolutely no warranty for GDB.  Type "show warranty" for details.
 This GDB was configured as "x86_64-unknown-linux-gnu"...
 Using host libthread_db library "/lib/libthread_db.so.1".
 (gdb) break _p__M0_main_program
 Breakpoint 1 at 0x4029fc: file sets14b.pas, line 4.
 (gdb) run
 Starting program: /var/tmp/hebisch/a.out
 
 Breakpoint 1, 0x00000000004029fc in main program () at sets14b.pas:4
 4         i: Integer;
 Current language:  auto; currently minimal
 (gdb) print foo
 Cannot access memory at address 0x533778
 (gdb) set language pascal
 Warning: the current language does not match this frame.
 (gdb) print foo
 Cannot access memory at address 0x533778
 (gdb) set language c
 (gdb) print *(long *)0x533778
 $1 = 268435440
 (gdb)
 
 AFAIK Modula-2 has sets and what works now is probably due to Modula-2
 patches.  However, it seems that Modula-2 handles some aspects quite
 different than Pascal.
 
 -- 
                               Waldek Hebisch
 hebisch@math.uni.wroc.pl 


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