home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / gnu / gdb / bug / 910 < prev    next >
Encoding:
Text File  |  1992-07-28  |  2.1 KB  |  68 lines

  1. Xref: sparky gnu.gdb.bug:910 gnu.g++.bug:1240
  2. Path: sparky!uunet!usc!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!bu.edu!ai-lab!ai.mit.edu!gnulists
  3. From: joe@consolve.com (Joe Shapiro)
  4. Newsgroups: gnu.gdb.bug,gnu.g++.bug
  5. Subject: Anonymous struct printing bug in either gdb or g++
  6. Message-ID: <9207272217.AA00764@somalia.consolve>
  7. Date: 27 Jul 92 22:17:14 GMT
  8. Followup-To: poster
  9. Lines: 55
  10. Approved: info-gnu@prep.ai.mit.edu
  11. To: bug-g++@prep.ai.mit.edu, bug-gdb@prep.ai.mit.edu
  12.  
  13. Hi, Folks
  14.     I'm not sure whether this is a g++ or gdb bug, so I'm sending this report
  15. to both bug mailing lists.  gdb 4.6 (and 4.5) can't find the type of a g++
  16. anonymous (i.e. untagged) struct.  Here's an example:
  17.  
  18.  
  19.  
  20. struct
  21. {
  22.     int a, b;
  23. } anon;
  24.  
  25.  
  26. struct named_t
  27. {
  28.     int a, b;
  29. } named;
  30.  
  31.  
  32. main()
  33. {
  34.     ++anon.a;
  35.     ++named.a;
  36. }
  37.  
  38.  
  39.  
  40.  
  41. joe@somalia> g++ -g -v static-bug.cc
  42. Reading specs from /usr/local/lib/gcc-lib/sun4/2.2.2/specs
  43. gcc version 2.2.2
  44.  /usr/local/lib/gcc-lib/sun4/2.2.2/cpp -lang-c++ -undef -D__GNUC__=2 -D__GNUG__=2 -D__cplusplus -Dsparc -Dsun -Dunix -D__sparc__ -D__sun__ -D__unix__ -D__sparc -D__sun -D__unix -g static-bug.cc /usr/tmp/cca00705.i
  45.  /usr/local/lib/gcc-lib/sun4/2.2.2/cc1plus /usr/tmp/cca00705.i -quiet -dumpbase static-bug.cc -g -o /usr/tmp/cca00705.s
  46.  as -o static-bug.o /usr/tmp/cca00705.s
  47.  /usr/local/lib/gcc-lib/sun4/2.2.2/ld -e start -dc -dp /lib/crt0.o -L/usr/local/lib/gcc-lib/sun4/2.2.2 -L/usr/local/lib static-bug.o -lg++ -lgcc -lc -lg -lgcc
  48.  
  49. /home/joe/gnu-bugs /home/joe/c-saw
  50. joe@somalia> gdb a.out
  51. GDB is free software and you are welcome to distribute copies of it
  52.  under certain conditions; type "show copying" to see the conditions.
  53. There is absolutely no warranty for GDB; type "show warranty" for details.
  54. GDB 4.6, Copyright 1992 Free Software Foundation, Inc...
  55. (gdb) b main
  56. Breakpoint 1 at 0x229c: file static-bug.cc, line 15.
  57. (gdb) r
  58. Starting program: /usr3/joe/gnu-bugs/a.out 
  59.  
  60. Breakpoint 1, main () at static-bug.cc:15
  61. 15          ++anon.a;
  62. (gdb) p anon 
  63. $1 = <unknown struct>
  64. (gdb) p named
  65. $2 = {a = 0, b = 0}
  66. (gdb) q
  67. The program is running.  Quit anyway? (y or n) y
  68.