* GDB 4.16.86 bug report
@ 1998-03-19 16:48 Eric Blinn
1998-04-24 13:20 ` Peter.Schauer
0 siblings, 1 reply; 2+ messages in thread
From: Eric Blinn @ 1998-03-19 16:48 UTC (permalink / raw)
To: gdb-patches; +Cc: monty.stein, eric.blinn
Hello,
I believe we have found a bug in the GDB 4.16.86 snapshot. We are
running IBM AIX 4.2.1.0 and compiling with the IBM Cset++ 3.1.4.5
C compiler. The problem we are seeing is that GDB seems to think that
variables declared with the "const" or "volatile" qualifiers are
incomplete structs. The following example demonstrates the problem:
[rios68:/u/qablinn/scratch/tmp] ls
testing.c
[rios68:/u/qablinn/scratch/tmp] nl -ba testing.c
1 #include <stdio.h>
2
3 int main( void )
4 {
5 int imain = 1;
6 const int jmain = 2;
7
8 printf( "%d %d\n",imain, jmain );
9 }
[rios68:/u/qablinn/scratch/tmp] xlc -g -o testing testing.c
[rios68:/u/qablinn/scratch/tmp] ls
testing testing.c
[rios68:/u/qablinn/scratch/tmp] gdb testing
GNU gdb 4.16.86
Copyright 1997 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 "powerpc-ibm-aix4.2.1.0"...
(gdb) list
1 #include <stdio.h>
2
3 int main( void )
4 {
5 int imain = 1;
6 const int jmain = 2;
7
8 printf( "%d %d\n",imain, jmain );
9 }
(gdb) break main
Breakpoint 1 at 0x10000214: file testing.c, line 5.
(gdb) run
Starting program: /scratch/qablinn/tmp/testing
Breakpoint 1, main () at testing.c:5
5 int imain = 1;
(gdb) next
6 const int jmain = 2;
(gdb) next
8 printf( "%d %d\n",imain, jmain );
(gdb) whatis imain
type = int
(gdb) print imain
$1 = 1
(gdb) whatis jmain
type = struct <unknown>
(gdb) print jmain
$2 = <incomplete type>
(gdb) print (const int) jmain
$3 = 2
(gdb) next
1 2
9 }
(gdb) next
0x100001a0 in __start ()
(gdb) next
Single stepping until exit from function __start,
which has no line number information.
Program exited with code 04.
(gdb) quit
[rios68:/u/qablinn/scratch/tmp]
As you can see, a workaround is to cast the variable to the necessary
type when printing it. We have begun to investigate this problem but
wanted to also get it in front of developers more knowledgeable of GDB
internals. Please send any correspondence to both Monty Stein
(monty.stein@sdrc.com) and myself (eric.blinn@sdrc.com).
Thanks,
Eric Blinn
Software QA Engineer II
Structural Dynamics Research Corporation
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: GDB 4.16.86 bug report
1998-03-19 16:48 GDB 4.16.86 bug report Eric Blinn
@ 1998-04-24 13:20 ` Peter.Schauer
0 siblings, 0 replies; 2+ messages in thread
From: Peter.Schauer @ 1998-04-24 13:20 UTC (permalink / raw)
To: gdb-patches
Sorry for the late reply, but GDB does not support the debugging
info produced by Cset++ (which is yet another extension to the stabs
debugging format), but g++ should work.
> Hello,
>
> I believe we have found a bug in the GDB 4.16.86 snapshot. We are
> running IBM AIX 4.2.1.0 and compiling with the IBM Cset++ 3.1.4.5
> C compiler. The problem we are seeing is that GDB seems to think that
> variables declared with the "const" or "volatile" qualifiers are
> incomplete structs. The following example demonstrates the problem:
>
> [rios68:/u/qablinn/scratch/tmp] ls
> testing.c
> [rios68:/u/qablinn/scratch/tmp] nl -ba testing.c
> 1 #include <stdio.h>
> 2
> 3 int main( void )
> 4 {
> 5 int imain = 1;
> 6 const int jmain = 2;
> 7
> 8 printf( "%d %d\n",imain, jmain );
> 9 }
> [rios68:/u/qablinn/scratch/tmp] xlc -g -o testing testing.c
> [rios68:/u/qablinn/scratch/tmp] ls
> testing testing.c
> [rios68:/u/qablinn/scratch/tmp] gdb testing
> GNU gdb 4.16.86
> Copyright 1997 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 "powerpc-ibm-aix4.2.1.0"...
> (gdb) list
> 1 #include <stdio.h>
> 2
> 3 int main( void )
> 4 {
> 5 int imain = 1;
> 6 const int jmain = 2;
> 7
> 8 printf( "%d %d\n",imain, jmain );
> 9 }
> (gdb) break main
> Breakpoint 1 at 0x10000214: file testing.c, line 5.
> (gdb) run
> Starting program: /scratch/qablinn/tmp/testing
>
> Breakpoint 1, main () at testing.c:5
> 5 int imain = 1;
> (gdb) next
> 6 const int jmain = 2;
> (gdb) next
> 8 printf( "%d %d\n",imain, jmain );
> (gdb) whatis imain
> type = int
> (gdb) print imain
> $1 = 1
> (gdb) whatis jmain
> type = struct <unknown>
> (gdb) print jmain
> $2 = <incomplete type>
> (gdb) print (const int) jmain
> $3 = 2
> (gdb) next
> 1 2
> 9 }
> (gdb) next
> 0x100001a0 in __start ()
> (gdb) next
> Single stepping until exit from function __start,
> which has no line number information.
>
> Program exited with code 04.
> (gdb) quit
> [rios68:/u/qablinn/scratch/tmp]
>
> As you can see, a workaround is to cast the variable to the necessary
> type when printing it. We have begun to investigate this problem but
> wanted to also get it in front of developers more knowledgeable of GDB
> internals. Please send any correspondence to both Monty Stein
> (monty.stein@sdrc.com) and myself (eric.blinn@sdrc.com).
>
> Thanks,
> Eric Blinn
>
> Software QA Engineer II
> Structural Dynamics Research Corporation
>
>
>
--
Peter Schauer pes@regent.e-technik.tu-muenchen.de
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~1998-04-24 13:20 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-03-19 16:48 GDB 4.16.86 bug report Eric Blinn
1998-04-24 13:20 ` Peter.Schauer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox