This is the mail archive of the
gdb-prs@sources.redhat.com
mailing list for the GDB project.
Re: symtab/779: mishandled enums in sparc-sun-solaris2.8 gcc 3.2 + gdb 20021001
- From: Randy Smith <rsmith at netapp dot com>
- To: nobody at sources dot redhat dot com
- Cc: gdb-prs at sources dot redhat dot com,
- Date: 30 Jun 2003 16:38:00 -0000
- Subject: Re: symtab/779: mishandled enums in sparc-sun-solaris2.8 gcc 3.2 + gdb 20021001
- Reply-to: Randy Smith <rsmith at netapp dot com>
The following reply was made to PR symtab/779; it has been noted by GNATS.
From: Randy Smith <rsmith@netapp.com>
To: gdb-gnats@sources.redhat.com
Cc: jlentini@netapp.com, rsmith@netapp.com
Subject: Re: symtab/779: mishandled enums in sparc-sun-solaris2.8 gcc 3.2 + gdb 20021001
Date: Mon, 30 Jun 2003 12:29:29 -0400
This is a multi-part message in MIME format.
--------------070502000004000100050708
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
This problem also occurs on Redhat 7.2 with gdb 5.2. I enclose the
input .i file
below that shows the problem; compiling and running with that .i file
yields:
GNU gdb 5.2
Copyright 2002 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 "i686-pc-linux-gnu"...
(gdb) b main
Breakpoint 1 at 0x8048466: file test2.i, line 92.
(gdb) run
Starting program: /u/rsmith/tmp/test
Breakpoint 1, main (argc=1, argv=0xbffff7b4) at test2.i:92
(gdb) n
(gdb) n
(gdb) p tmptype2
$1 = RDAT_WARNING
(gdb) p tmptype
$2 = <error type>
(gdb) ptype DAT_RETURN
type = <unknown type>
(gdb) whatis tmptype
type = DAT_RETURN
(gdb) p tmptype
$3 = <error type>
(gdb) quit
If I remove the DAT_NOT_IMPLEMENTED assignment, I get:
GNU gdb 5.2
Copyright 2002 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 "i686-pc-linux-gnu"...
(gdb) ptype DAT_RETURN
type = enum dat_return {DAT_SUCCESS, DAT_ABORT = 65536,
DAT_CONN_QUAL_IN_USE = 131072, DAT_INSUFFICIENT_RESOURCES = 196608,
DAT_INTERNAL_ERROR = 262144, DAT_INVALID_HANDLE = 327680,
DAT_INVALID_PARAMETER = 393216, DAT_INVALID_STATE = 458752,
DAT_LENGTH_ERROR = 524288, DAT_MODEL_NOT_SUPPORTED = 589824,
DAT_NAME_NOT_FOUND = 655360, DAT_PRIVILEGES_VIOLATION = 720896,
DAT_PROTECTION_VIOLATION = 786432, DAT_QUEUE_EMPTY = 851968,
DAT_QUEUE_FULL = 917504, DAT_TIMEOUT_EXPIRED = 983040,
DAT_PROVIDER_ALREADY_REGISTERED = 1048576, DAT_PROVIDER_IN_USE =
1114112,
DAT_INVALID_ADDRESS = 1179648, DAT_INTERRUPTED_CALL = 1245184}
(gdb) quit
Debugger finished
--------------070502000004000100050708
Content-Type: text/plain;
name="test2.i"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="test2.i"
typedef enum dat_return
{
DAT_SUCCESS = 0x000000,
DAT_ABORT = 0x00010000,
DAT_CONN_QUAL_IN_USE = 0x00020000,
DAT_INSUFFICIENT_RESOURCES = 0x00030000,
DAT_INTERNAL_ERROR = 0x00040000,
DAT_INVALID_HANDLE = 0x00050000,
DAT_INVALID_PARAMETER = 0x00060000,
DAT_INVALID_STATE = 0x00070000,
DAT_LENGTH_ERROR = 0x00080000,
DAT_MODEL_NOT_SUPPORTED = 0x00090000,
DAT_NAME_NOT_FOUND = 0x000A0000,
DAT_PRIVILEGES_VIOLATION = 0x000B0000,
DAT_PROTECTION_VIOLATION = 0x000C0000,
DAT_QUEUE_EMPTY = 0x000D0000,
DAT_QUEUE_FULL = 0x000E0000,
DAT_TIMEOUT_EXPIRED = 0x000F0000,
DAT_PROVIDER_ALREADY_REGISTERED = 0x00100000,
DAT_PROVIDER_IN_USE = 0x00110000,
DAT_INVALID_ADDRESS = 0x00120000,
DAT_INTERRUPTED_CALL = 0x00130000,
DAT_NOT_IMPLEMENTED = 0xFFFF0000
} DAT_RETURN;
typedef enum dat_return2 {
RDAT_SUCCESS,
RDAT_FAILURE,
RDAT_WARNING
} DAT_RETURN2;
int
main(int argc, char **argv)
{
DAT_RETURN tmptype;
DAT_RETURN2 tmptype2;
tmptype = DAT_SUCCESS;
tmptype2 = RDAT_WARNING;
printf("%d %d\n", tmptype, tmptype2);
}
--------------070502000004000100050708--