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