home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / gnu / gcc / help / 2567 < prev    next >
Encoding:
Text File  |  1992-11-20  |  3.1 KB  |  70 lines

  1. Newsgroups: gnu.gcc.help
  2. Path: sparky!uunet!cis.ohio-state.edu!shasta.nextwave.COM!markg
  3. From: markg@shasta.nextwave.COM (Mark Glasser)
  4. Subject: 2 problems: dbx support & alignment of doubles in structs
  5. Message-ID: <9211210047.AA15779@shasta.nextwave.com>
  6. Sender: daemon@cis.ohio-state.edu
  7. Organization: GNUs Not Usenet
  8. Distribution: gnu
  9. Date: Sat, 21 Nov 1992 00:47:20 GMT
  10. Lines: 58
  11.  
  12.  
  13. I've just installed gcc-2.3.1.  I'm having difficulties on two fronts:
  14.  
  15.     1. The generated code does not seem to be able to be debugged with dbx.
  16.  
  17.     2. Assigning to a double that is a member of a dynamically allocated
  18.        structure is problematic.  Doubles seem to have different alignment
  19.        requirements than with the compiler shipped with the OS.
  20.  
  21. The particulars:
  22.  
  23. I'm running on a Sun sparc with SunOS 4.1.1.  The "other" compiler is the
  24. Sun C compiler shipped with the system (We got these machines prior to
  25. unbundling).  Gcc is configured as
  26.  
  27.     #!/bin/sh
  28.     # GCC was configured as follows:
  29.     ./configure --target=sparc-sun-sunos4.1
  30.     echo host=sparc-sun-sunos4.1 target=sparc-sun-sunos4.1 build=sparc-sun-sunos4.1
  31.  
  32. With -g my unserstanding is gcc generates dbx debugging info with gdb
  33. extensions.  Debugging with gdb works fine.  Dbx crashes.  I recompiled and
  34. replaced -g with -gdbx.  The compiler complains that -gdbx is not supported.
  35. A quick perusal through the compiler source reveals that -gstabs enables dbx
  36. debugging output without the gdb extensions.  I recompile and try again.  No
  37. success.  My program has a section that is dynamically linked (i.e. compiled
  38. with -fpic).  Could this have anything to do with the problem?
  39.  
  40. The problem with doubles is a little more subtle.  Assigning to a double
  41. that is the member of a structure causes a bus error.
  42.  
  43. I'm using an in-house memory allocation package that piggybacks off of
  44. malloc and provides memory analysis and debugging capabilities.  This
  45. packages has been in use for several years in a number of projects.  It's
  46. very stable and I have good confidence in it.
  47.  
  48. The memory package guarantees that all memory blocks returned are aligned on
  49. 4 byte boundaries.  Everything works fine with Sun C.  With GNUC bus errors
  50. ensue unless I change the memory package to align to 8 byte boundaries.
  51. What's the problem here?  Is Sun C "smarter" about padding the strucutre
  52. properly so that sizeof does the right thing and the proper alignments are
  53. enforced?  Maybe the real question is: why did it operate proplery under Sun
  54. C?  Since doubles require 8 byte alignments it shouldn't have worked.
  55.  
  56. Are there any known bugs relating to these issues?  Am I doing something
  57. wrong?  
  58.  
  59. Thank you in advance for any light you can shed on these problems
  60.  
  61.  
  62. Mark Glasser
  63. ------------------------------------------------------------------------
  64. markg@nextwave.com                            Nextwave Design Automation
  65.                                                 450 San Antonio Road #27
  66.                                                      Palo Alto, CA 94306
  67.                                                     (voice) 415.855.9795
  68.                                                       (fax) 415.855.9792
  69. ------------------------------------------------------------------------
  70.