From: Eric Blinn <eric.blinn@sdrc.com>
To: gdb-patches@cygnus.com
Cc: monty.stein@heimdall.sdrc.com, eric.blinn@heimdall.sdrc.com
Subject: GDB 4.16.86 bug report
Date: Thu, 19 Mar 1998 16:48:00 -0000 [thread overview]
Message-ID: <Pine.SGI.3.96.980319190127.15550A-100000@sgipd381> (raw)
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
next reply other threads:[~1998-03-19 16:48 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
1998-03-19 16:48 Eric Blinn [this message]
1998-04-24 13:20 ` Peter.Schauer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.SGI.3.96.980319190127.15550A-100000@sgipd381 \
--to=eric.blinn@sdrc.com \
--cc=eric.blinn@heimdall.sdrc.com \
--cc=gdb-patches@cygnus.com \
--cc=monty.stein@heimdall.sdrc.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox