home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / gnu / gdb / bug / 1242 < prev    next >
Encoding:
Text File  |  1992-11-21  |  910 b   |  40 lines

  1. Newsgroups: gnu.gdb.bug
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!graphics.cs.nyu.edu!fox
  3. From: fox@graphics.cs.nyu.edu (David Fox)
  4. Subject: The Sun bug, after taking a deep breath and counting to 10...
  5. Message-ID: <9211211820.AA23772@GRAPHICS.CS.NYU.EDU>
  6. Sender: gnulists@ai.mit.edu
  7. Organization: GNUs Not Usenet
  8. Distribution: gnu
  9. Date: Sat, 21 Nov 1992 08:20:45 GMT
  10. Approved: bug-gdb@prep.ai.mit.edu
  11. Lines: 27
  12.  
  13. Compile the following program with g++-2.1 or later on a sparc,
  14. invoke gdb-4.7, put a break point at the first statement of
  15. main, and then do a "next".  Instead of stopping at the second
  16. line of the program the program finishes executing and exit:
  17.  
  18. #include <stdio.h>
  19.  
  20. struct foo {
  21.   int a;
  22.   int b;
  23. };
  24.  
  25. foo bar(int x, int y)
  26. {
  27.   foo r;
  28.   r.a = x;
  29.   r.b = y;
  30.   return r;
  31. }
  32.  
  33. main()
  34. {
  35.   foo i = bar(1, 2);
  36.   foo j = bar(3, 4);
  37.   printf("%d %d %d %d\n", i.a, i.b, j.a, j.b);
  38. }
  39.  
  40.