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

  1. Newsgroups: gnu.gdb.bug
  2. Path: sparky!uunet!cis.ohio-state.edu!trianguli.wrc.xerox.COM!leisner
  3. From: leisner@trianguli.wrc.xerox.COM (Marty Leisner 311/? x?)
  4. Subject: Problems with gcc/gdb
  5. Message-ID: <1992Jul24.164435.6510@spectrum.xerox.com>
  6. Sender: gnulists@ai.mit.edu
  7. Reply-To: leisner.henr801c@xerox.com
  8. Organization: Xerox
  9. Distribution: gnu
  10. Date: Fri, 24 Jul 1992 16:44:35 GMT
  11. Approved: bug-gdb@prep.ai.mit.edu
  12. Lines: 66
  13.  
  14. I haven't analyzed this case but:
  15.     gcc is producing working code
  16.     gdb appears not to be working correctly
  17.  
  18. I'm using gdb 4.5 (compiled with gcc 2.1.x) and gcc 2.2.2 on a Sparcstation running SunOS 4.1.2.
  19.  
  20. Here's a test program:
  21.  
  22.  
  23. typedef struct {
  24.     int i;
  25.     int j;
  26. } FOO;
  27.  
  28. static bar(const FOO me)
  29. {
  30.     printf("i = %d, j = %d\n", me.i, me.j);
  31. }
  32.  
  33. static FOO getfoo(void)
  34. {
  35.     FOO test;
  36.  
  37.     test.i = 5;
  38.     test.j = 10;
  39.     return test;
  40. }
  41.  
  42. main()
  43. {
  44.     FOO re;
  45.  
  46.     re = getfoo();
  47.     bar(re);
  48. }
  49.  
  50.  
  51.  
  52. It works fine
  53.  
  54. leisner@trianguli$ ./test
  55. i = 5, j = 10
  56.  
  57. In gdb,
  58. leisner@trianguli$ gdb test
  59. GDB is free software and you are welcome to distribute copies of it
  60.  under certain conditions; type "show copying" to see the conditions.
  61. There is absolutely no warranty for GDB; type "show warranty" for details.
  62. GDB 4.5, Copyright 1992 Free Software Foundation, Inc...
  63. (gdb) break bar
  64. Breakpoint 1 at 0x22a8: file test.c, line 9.
  65. (gdb) run
  66. Starting program: /a/rockwell/dk2g/leisner/tmp/test 
  67.  
  68. Breakpoint 1, bar (me={i = 289407105, j = 8292}) at test.c:9
  69. 9               printf("i = %d, j = %d\n", me.i, me.j);
  70.  
  71.  
  72. gdb is seeing me as garbarge, but the compiler is working...
  73.  
  74.  
  75. --
  76. marty
  77. leisner.henr801c@xerox.com  
  78. Member of the League for Programming Freedom
  79.  
  80.