home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / unix / sys5 / r4 / 911 < prev    next >
Encoding:
Text File  |  1992-12-21  |  2.1 KB  |  46 lines

  1. Newsgroups: comp.unix.sys5.r4
  2. Path: sparky!uunet!spool.mu.edu!umn.edu!csus.edu!netcom.com!rfg
  3. From: rfg@netcom.com (Ronald F. Guilmette)
  4. Subject: Debugging C code on SVR4 (was: cc -g problem)
  5. Message-ID: <1992Dec21.092236.21804@netcom.com>
  6. Organization: Netcom - Online Communication Services  (408 241-9760 guest) 
  7. Date: Mon, 21 Dec 1992 09:22:36 GMT
  8. Lines: 36
  9.  
  10. Some time ago, georg@norisc.erls01.siemens.de (Georg Biehler) wrote:
  11.  
  12. > The bug is in cc,  it produces wrong (or missing) line number information
  13. > for compilation units including files with functions defined in there.
  14. > An example is <sys/stat.h>,  defining stat(),  lstat() and other variants
  15. > or <sys/uname.h>.
  16. > The bug is in generix UNIX SVR4,  even in 4.2.  A (ugly) workaround is
  17. > to include the complete include file in your source file - this makes you
  18. > able to debug the code.
  19.  
  20. There does indeed seem to be a bug in the production of the DWARF line
  21. number information in generic (unfixed) versions of the standard SVR4
  22. C compiler.  This bug can be *very* annoying, and can make effective
  23. debugging almost impossible (as you are never really sure where you
  24. actually are).
  25.  
  26. Fortunately, the GNU C compiler does not suffer from this problem.  The
  27. DWARF line number information which it produces is correct (as far as
  28. I have been able to determine) and the DWARF output from GCC is 100%
  29. compatible with the standard SVR4 sdb debugger.  In fact, there are a
  30. few additional obscure cases where the DWARF output produced by GCC
  31. will cause the SVR4 sdb debugger to give answers which are *MORE CORRECT*
  32. than they would be if the same code had been compiled by the standard
  33. SVR4 C compiler.
  34.  
  35. -- 
  36.  
  37. // Ron ("Loose Cannon") Guilmette    uucp: ...uunet!lupine!segfault!rfg
  38. //
  39. //      "On the one hand I knew that programs could have a compelling
  40. //       and deep logical beauty, on the other hand I was forced to
  41. //       admit that most programs are presented in a way fit for
  42. //       mechanical execution, but even if of any beauty at all,
  43. //       totally unfit for human appreciation."
  44. //                                              -- Edsger W. Dijkstra
  45.