symtab/2252: GNU/Linux, Cygwin, GCC, C, C++

tobias.leutwein@bosch.com tobias.leutwein@bosch.com
Wed Apr 11 07:58:00 GMT 2007


>Number:         2252
>Category:       symtab
>Synopsis:       GNU/Linux, Cygwin, GCC, C, C++
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Apr 11 08:58:01 BST 2007
>Closed-Date:
>Last-Modified:
>Originator:     tobias.leutwein@bosch.com
>Release:        6.6
>Organization:
>Environment:
CYGWIN_NT-5.0 SI46227 1.5.24(0.156/4/2) 2007-01-31 10:57 i686 Cygwin
gcc-Version 3.4.4 (mingw special)
This GDB was configured as "i686-pc-cygwin"
>Description:
GDB could not determine the right size of arrays. Only observed by dwarf-2 debug format. If an array is referenced with [] or with wrong size this behaviour could be seen.
Example:
def.c:
  int8_t au8[2];
ref.h:
  extern int8_t au8[];

At the "How-To-Repeat" section the output of the command "ptype au8" is the important thing. If the "info variables" command is called first "ptype au8" returns always right thing. 
With linux and a newer gcc I have seen the same behaviour.
>How-To-Repeat:
tar -xzf src.tar.gz
gcc -g3 -gdwarf-2 -I. def.c main.c ref.c -o test.exe
gdb test.exe
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 "i686-pc-cygwin"...
(gdb) ptype au8
type = signed char [2]
(gdb) ptype refS
type = struct {
    int8_t a_i8;
    uint32_t b_u32;
} [4]
(gdb) ptype au8
type = signed char [0]
(gdb) info variables 
All defined variables:

File ref.c:
int8_t au8[0];
ref_t refS[4];
uint16_t ref_au16[3];

File def.c:
int8_t au8[2];

Non-debugging symbols:
0x00402000  __cygwin_crt0_bp
0x00402000  _bss_start__
0x00402010  _fmode
0x00402014  environ
0x00402080  _bss_end__
(gdb) quit
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/x-gzip; name="src.tar.gz"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="src.tar.gz"

H4sIAIyKHEYAA+2X32qDMBSHvTVPEbqbloLkn7Zgu7Fn2GURcdWywGqHJmNjFPbm24k6O9hGr3S9
ON9FgkZiUL/fiXmxC7besLAW13OmmPcO5z4A9oVSHmcRC3m4CMPQY1wJqTzKBl5Xg61NVlHq3eZ7
XeraVJk5VPXP6246xljTiFzpcvto84KuapPr0gQP14RAv0wNzexyI5KY/PcakeHYZ7ocOgDO+c/V
ovc/CpnzXwmB/o/Byf8KKoGTv3gxRVVSOEyND+3dBiIAEoG6T2X6fND5jLwRvxkvajOdxaS9jCfB
fWqloGvKRXPSWJiIxeSIEXKpVBdQ/4WKev9l67+ASED/R6D3f9L4PyHEgus8gvLvDM8sjzYSAoB8
ywPljl0Q0D4E+lhwQaFB/t2holO9ZjHVKwHNfD4jPoz7/aw6gaBwWwwN0/lH0qWITIIs1ctujCUu
PTA+BqN56wPf42z9X8iT/4yj/yPy6/7fvD4VebGj8DTs1nRaN38EYCbI6iJCCoiDpt6DoW0QxP3m
4dsPxB9ZEaPUCIIgCIIgCIIgCIIgCIIgCIIgg/AJ7q7ERAAoAAA=



More information about the Gdb-prs mailing list