public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/15102] New: dwarf/regression: array index treated as signed byte, when specified unsigned byte (leads to [0..-n])
@ 2013-02-05 19:17 gdb.bugs at mfriebe dot de
  2013-02-06 12:53 ` [Bug gdb/15102] " tromey at redhat dot com
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: gdb.bugs at mfriebe dot de @ 2013-02-05 19:17 UTC (permalink / raw)
  To: gdb-prs

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

             Bug #: 15102
           Summary: dwarf/regression: array index treated as signed byte,
                    when specified unsigned byte (leads to [0..-n])
           Product: gdb
           Version: 7.5
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gdb
        AssignedTo: unassigned@sourceware.org
        ReportedBy: gdb.bugs@mfriebe.de
    Classification: Unclassified


This issue is present in GDB 7.3, gdb 7.4, gdb 7.5
It was not present in 7.2

Compile using free-pascal (-gw creates dwarf 2)
   fpc.exe -gw Array.pas

program Foo;
type TByteArray = array[0..191] of integer;
var a: TByteArray;
begin
  a[1] := 0;
end.

execute in gdb:
  ptype TByteArray

type = array [0..-65] of SMALLINT

But it should be 0..191

OBJDUMP -w shows

 <2><95>: Abbrev Number: 6 (DW_TAG_subrange_type)
    <96>   DW_AT_lower_bound : 0
    <97>   DW_AT_upper_bound : 191
    <99>   DW_AT_stride      : 2
    <9a>   DW_AT_type        : <0xc3>

 <1><c3>: Abbrev Number: 4 (DW_TAG_typedef)
    <c4>   DW_AT_name        : BYTE
    <c9>   DW_AT_type        : <0xcd>
 <1><cd>: Abbrev Number: 8 (DW_TAG_base_type)
    <ce>   DW_AT_name        : BYTE
    <d3>   DW_AT_encoding    : 7        (unsigned)
    <d4>   DW_AT_byte_size   : 1


The basetype is clearly marked unsigned.

-- 
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] 4+ messages in thread

* [Bug gdb/15102] dwarf/regression: array index treated as signed byte, when specified unsigned byte (leads to [0..-n])
  2013-02-05 19:17 [Bug gdb/15102] New: dwarf/regression: array index treated as signed byte, when specified unsigned byte (leads to [0..-n]) gdb.bugs at mfriebe dot de
@ 2013-02-06 12:53 ` tromey at redhat dot com
  2013-02-18 21:04 ` cvs-commit at gcc dot gnu.org
  2013-02-18 21:06 ` tromey at redhat dot com
  2 siblings, 0 replies; 4+ messages in thread
From: tromey at redhat dot com @ 2013-02-06 12:53 UTC (permalink / raw)
  To: gdb-prs

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

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> 2013-02-06 12:52:58 UTC ---
Testing a patch.

The bug is that the subrange type code in dwarf2read.c
doesn't strip typedefs, so it doesn't see that the range
type is unsigned.

-- 
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] 4+ messages in thread

* [Bug gdb/15102] dwarf/regression: array index treated as signed byte, when specified unsigned byte (leads to [0..-n])
  2013-02-05 19:17 [Bug gdb/15102] New: dwarf/regression: array index treated as signed byte, when specified unsigned byte (leads to [0..-n]) gdb.bugs at mfriebe dot de
  2013-02-06 12:53 ` [Bug gdb/15102] " tromey at redhat dot com
@ 2013-02-18 21:04 ` cvs-commit at gcc dot gnu.org
  2013-02-18 21:06 ` tromey at redhat dot com
  2 siblings, 0 replies; 4+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2013-02-18 21:04 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #2 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> 2013-02-18 21:04:34 UTC ---
CVSROOT:    /cvs/src
Module name:    src
Changes by:    tromey@sourceware.org    2013-02-18 21:04:28

Modified files:
    gdb            : ChangeLog dwarf2read.c 
    gdb/testsuite  : ChangeLog 
Added files:
    gdb/testsuite/gdb.dwarf2: subrange.exp 

Log message:
    PR gdb/15102:
    * dwarf2read.c (read_subrange_type): Use result of
    'check_typedef'.
    gdb/testsuite
    * gdb.dwarf2/subrange.exp: New file.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/ChangeLog.diff?cvsroot=src&r1=1.15160&r2=1.15161
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/dwarf2read.c.diff?cvsroot=src&r1=1.753&r2=1.754
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/ChangeLog.diff?cvsroot=src&r1=1.3564&r2=1.3565
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.dwarf2/subrange.exp.diff?cvsroot=src&r1=NONE&r2=1.1

-- 
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] 4+ messages in thread

* [Bug gdb/15102] dwarf/regression: array index treated as signed byte, when specified unsigned byte (leads to [0..-n])
  2013-02-05 19:17 [Bug gdb/15102] New: dwarf/regression: array index treated as signed byte, when specified unsigned byte (leads to [0..-n]) gdb.bugs at mfriebe dot de
  2013-02-06 12:53 ` [Bug gdb/15102] " tromey at redhat dot com
  2013-02-18 21:04 ` cvs-commit at gcc dot gnu.org
@ 2013-02-18 21:06 ` tromey at redhat dot com
  2 siblings, 0 replies; 4+ messages in thread
From: tromey at redhat dot com @ 2013-02-18 21:06 UTC (permalink / raw)
  To: gdb-prs

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

Tom Tromey <tromey at redhat dot com> changed:

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

--- Comment #3 from Tom Tromey <tromey at redhat dot com> 2013-02-18 21:06:28 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] 4+ messages in thread

end of thread, other threads:[~2013-02-18 21:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-05 19:17 [Bug gdb/15102] New: dwarf/regression: array index treated as signed byte, when specified unsigned byte (leads to [0..-n]) gdb.bugs at mfriebe dot de
2013-02-06 12:53 ` [Bug gdb/15102] " tromey at redhat dot com
2013-02-18 21:04 ` cvs-commit at gcc dot gnu.org
2013-02-18 21:06 ` 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).