home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / sys / sgi / 16489 < prev    next >
Encoding:
Text File  |  1992-11-16  |  1.5 KB  |  53 lines

  1. Newsgroups: comp.sys.sgi
  2. Path: sparky!uunet!ukma!darwin.sura.net!sgiblab!sgigate!sgi!quasar.mti.sgi.com!davea
  3. From: davea@quasar.mti.sgi.com (David B.Anderson)
  4. Subject: Re: dbx question.
  5. Message-ID: <selges4@sgi.sgi.com>
  6. Sender: davea@quasar.mti.sgi.com
  7. Organization: Silicon Graphics, Inc.  Mountain View, CA
  8. Date: Mon, 16 Nov 1992 18:17:00 GMT
  9. Lines: 42
  10.  
  11. In article <BxtKHF.4wK@news.cso.uiuc.edu> dsong@ncsa.uiuc.edu (Deyang Song) writes:
  12. >
  13. >
  14. >I came across a problem with dbx that I think may be a bug. The
  15. >problem is that dbx does not handle nested blocks properly. I have
  16. >a simple C test program below:
  17. >
  18. >     1  #include <stdio.h>
  19. >     2
  20. >     3  main()
  21. >     4  {
  22. >     5     int p=2;
  23. >     6
  24. >     7     {
  25. >     8        int p=4;
  26. >     9
  27. >    10        printf("\tp=%d\n", p);
  28. >    11     }
  29. >    12
  30. >    13     printf("p=%d\n",p);
  31. >    14  }
  32. >
  33. >I compiled it with -g and loaded it into dbx. When I stepped to
  34. >line 13, the visible p is still the one in the inner block. Can
  35. >someone tell me if it's a bug or there's an explanation for it?
  36.  
  37. It's a bug.  I believe that Workshop/Codevision handles this correctly.
  38. Only dbx gets it wrong.
  39.  
  40. The problem is that while dbx notices the beginnings of block scopes
  41. and the end of functions, dbx does not notice the end of inner-block
  42. scopes.
  43.  
  44. The scope data exists in the a.out. dbx has no excuse.  dbx has been
  45. this way a long time.
  46.  
  47. I hope get it fixed for the next major release (but the work is not done
  48. and I cannot promise....)
  49. [ David B. Anderson             (415)390-4263             davea@sgi.com ]
  50.  
  51.  
  52.  
  53.