This is the mail archive of the gdb-prs@sources.redhat.com 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]

exp/1151: enum types are casted to (byte)


>Number:         1151
>Category:       exp
>Synopsis:       enum types are casted to (byte)
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          patch
>Submitter-Id:   net
>Arrival-Date:   Tue Mar 25 10:28:01 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     mateuszx dot pusz at intel dot com
>Release:        GNU gdb 5.2-4 & GNU gdb 5.3
>Organization:
>Environment:
Linux mpuszx-rh8 2.4.18-14 #2 Mon Feb 24 18:22:47 CET 2003 i686 i686 i386 GNU/Linux
>Description:
When there is a long enum type defined (or simple enum with big starting value) GDB enumarates its values to 127 and the next value is -128 but all enums should be of ubyte4 type.

For example:
enum my_enum_e {
  FIRST_VALUE=126,
  SECOND_VALUE,
  THIRD_VALUE};
typedef enum my_enum_e my_enum_t;

----------------
(gdb) ptype my_enum_t
type = enum my_enum_e {FIRST_VALUE = 126, SECOND_VALUE,
    THIRD_VALUE = -128}

In fact in program THRID_VALUE's value is 128.
>How-To-Repeat:
Should be very easy. See the bug description.
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


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