home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / gnu / gdb / bug / 1000 next >
Encoding:
Text File  |  1992-08-25  |  5.2 KB  |  177 lines

  1. Newsgroups: gnu.gdb.bug
  2. Path: sparky!uunet!convex!darwin.sura.net!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!lookout.IT.USwc.USwest.COM!dir
  3. From: dir@lookout.IT.USwc.USwest.COM (Daniel I. Rosenblatt)
  4. Subject: gdb-4.6 vs Sun's acc
  5. Message-ID: <199208251522.AA06678@lookout.it.uswc.uswest.com>
  6. Sender: gnulists@ai.mit.edu
  7. Organization: GNUs Not Usenet
  8. Distribution: gnu
  9. Date: Tue, 25 Aug 1992 03:22:47 GMT
  10. Approved: bug-gdb@prep.ai.mit.edu
  11. Lines: 164
  12.  
  13. Both gcc (2.2.2) and Sun's standard cc work fine with gdb-4.6.
  14. Sun's acc generates somewhat different symbol table info which causes
  15. gdb-4.6 to abort.  My configuration is a Sun 4/670 running SunOS 4.1.2.
  16. I built gdb-4.6 with gcc-2.2.2 and 'configure sparc'.  Here is a session
  17. demonstrating the problem:
  18. ------------------------------------------------------------------------
  19. Script started on Tue Aug 25 09:15:14 1992
  20. kmongo_jr% cat tst.c
  21. main(argc, argv)
  22. int argc;
  23. char *argv[];
  24. {
  25.     int i = 7, j = 19;
  26.     double x = 2.3;
  27.  
  28.     printf("%d %d %f\n", i, j, x);
  29.     abort();
  30. }
  31. kmongo_jr% /home/lang/acc -g -S tst.c
  32. kmongo_jr% cat tst.s
  33.     .stabs    "/home/dir/gdb-4.6/",0x64,0,0,LL0
  34.     .stabs    "tst.c",0x64,0,0,LL0
  35. LL0:
  36.     .seg    "data"
  37.     .stabs    "int:t(0,1)=r(0,1);-2147483648;2147483647;",0x80,0,0,0
  38.     .stabs    "char:t(0,2)=r(0,2);0;127;",0x80,0,0,0
  39.     .stabs    "short:t(0,3)=r(0,1);-32768;32767;",0x80,0,0,0
  40.     .stabs    "long:t(0,4)=r(0,1);-2147483648;2147483647;",0x80,0,0,0
  41.     .stabs    "unsigned char:t(0,5)=r(0,1);0;255;",0x80,0,0,0
  42.     .stabs    "unsigned short:t(0,6)=r(0,1);0;65535;",0x80,0,0,0
  43.     .stabs    "unsigned int:t(0,7)=r(0,1);0;-1;",0x80,0,0,0
  44.     .stabs    "unsigned long:t(0,8)=r(0,1);0;-1;",0x80,0,0,0
  45.     .stabs    "signed char:t(0,9)=r(0,1);-128;127;",0x80,0,0,0
  46.     .stabs    "signed short:t(0,10)=r(0,1);-32768;32767;",0x80,0,0,0
  47.     .stabs    "signed int:t(0,11)=r(0,1);-2147483648;2147483647;",0x80,0,0,0
  48.     .stabs    "signed long:t(0,12)=r(0,1);-2147483648;2147483647;",0x80,0,0,0
  49.     .stabs    "float:t(0,13)=r(0,1);4;0;",0x80,0,0,0
  50.     .stabs    "double:t(0,14)=r(0,1);8;0;",0x80,0,0,0
  51.     .stabs    "long double:t(0,15)=r(0,1);16;0;",0x80,0,0,0
  52.     .stabs    "void:t(0,16)=(0,16)",0x80,0,0,0
  53.     !.file    "tst.c"
  54.     .stabs    "main:F(0,1)",0x20,0,4,0
  55.     .seg    "data1"
  56.     .align    4
  57. L16:
  58.     .ascii    "%d %d %f\n\0"
  59.     .seg    "text"
  60.     .proc    04
  61.     .global    _main
  62.  
  63.     .align    4
  64. _main:
  65.     !#PROLOGUE# 0
  66.     sethi    %hi(LF12),%g1
  67.     add    %g1,%lo(LF12),%g1
  68.     save    %sp,%g1,%sp
  69.     !#PROLOGUE# 1
  70. L14:
  71.     .seg    "text"
  72.     .stabs    "argc:p(0,1)",0xa0,0,4,68
  73.     .stabs    "argv:p(0,17)=*(0,18)=*(0,2)",0xa0,0,4,72
  74.     .stabn    0300,0,1,LL1
  75. LL1:
  76.     .stabs    "i:(0,1)",0x80,0,4,-4
  77.     .stabn    0104,0,5,LL2
  78. LL2:
  79.     mov    0x7,%o0
  80.     st    %o0,[%fp+-0x4]
  81.     .stabs    "j:(0,1)",0x80,0,4,-8
  82.     .stabn    0104,0,5,LL3
  83. LL3:
  84.     mov    0x13,%o0
  85.     st    %o0,[%fp+-0x8]
  86.     .stabs    "x:(0,14)",0x80,0,8,-16
  87.     .stabn    0104,0,6,LL4
  88. LL4:
  89.     sethi    %hi(L2000000),%o0
  90.     ldd    [%o0+%lo(L2000000)],%f0
  91.     std    %f0,[%fp+-0x10]
  92.     .stabn    0104,0,8,LL5
  93. LL5:
  94.     .seg    "text"
  95.     set    L16,%o0
  96.     ld    [%fp+-0x4],%o1
  97.     ld    [%fp+-0x8],%o2
  98.     ldd    [%fp+-0x10],%o4
  99.     mov    %o4,%o3
  100.     mov    %o5,%o4
  101.     call    _printf,5
  102.     nop
  103.     .stabn    0104,0,9,LL6
  104. LL6:
  105.     call    _abort,0
  106.     nop
  107.     .stabn    0340,0,1,LL7
  108. LL7:
  109.     .stabn    0104,0,10,LL8
  110. LL8:
  111. LE12:
  112.     ret
  113.     restore
  114.     .optim    "-O~Q~R~S"
  115.        LF12 = -112
  116.     LP12 = 96
  117.     LST12 = 96
  118.     LT12 = 96
  119.     .seg    "data"
  120.     .align    8
  121. L2000000:    .word    0x40026666,0x66666666
  122.     !ident    "acomp: (CDS) SunOS5.0 IDR3.5 (H6.1) 11/01/90"
  123. kmongo_jr% /home/lang/acc -g tst.c -o tst
  124. kmongo_jr% gdb tst
  125. GDB is free software and you are welcome to distribute copies of it
  126.  under certain conditions; type "show copying" to see the conditions.
  127. There is absolutely no warranty for GDB; type "show warranty" for details.
  128. GDB 4.6, Copyright 1992 Free Software Foundation, Inc...
  129. (gdb) break main
  130. Segmentation fault (core dumped)
  131. kmongo_jr% gdb gdb core
  132. GDB is free software and you are welcome to distribute copies of it
  133.  under certain conditions; type "show copying" to see the conditions.
  134. There is absolutely no warranty for GDB; type "show warranty" for details.
  135. GDB 4.6, Copyright 1992 Free Software Foundation, Inc...
  136. Core was generated by `gdb'.
  137. Program terminated with signal 11, Segmentation fault.
  138. #0  0x33670 in decode_line_1 (argptr=0xf7fff814, funfirstline=1, 
  139.     default_symtab=0x0, default_line=0) at symtab.c:1803
  140. 1803          pc = BLOCK_START (SYMBOL_BLOCK_VALUE (sym)) + FUNCTION_START_OFFSET;
  141. (gdb) list
  142. 1798      if (sym != NULL)
  143. 1799        {
  144. 1800          if (SYMBOL_CLASS (sym) == LOC_BLOCK)
  145. 1801        {
  146. 1802          /* Arg is the name of a function */
  147. 1803          pc = BLOCK_START (SYMBOL_BLOCK_VALUE (sym)) + FUNCTION_START_OFFSET;
  148. 1804          if (funfirstline)
  149. 1805            SKIP_PROLOGUE (pc);
  150. 1806          val = find_pc_line (pc, 0);
  151. 1807    #ifdef PROLOGUE_FIRSTLINE_OVERLAP
  152. (gdb) print sym
  153. $1 = (struct symbol *) 0x158408
  154. (gdb) print *sym
  155. $2 = {name = 0x158428 "main", namespace = VAR_NAMESPACE, class = LOC_BLOCK, 
  156.   type = 0x1593a0, line = 0, value = {value = 0, block = 0x0, bytes = 0x0, 
  157.     address = 0, chain = 0x0}, aux_value = {basereg = {regno_valid = 0, 
  158.       regno = 0}}}
  159. (gdb) print *sym->type
  160. $3 = {code = TYPE_CODE_FUNC, name = 0x0, length = 1, objfile = 0x156f08, 
  161.   target_type = 0x159078, pointer_type = 0x0, reference_type = 0x0, 
  162.   function_type = 0x0, flags = 0, nfields = 0, fields = 0x0, 
  163.   vptr_basetype = 0x0, vptr_fieldno = -1, type_specific = {arg_types = 0x0, 
  164.     cplus_stuff = 0x0}}
  165. (gdb) quit
  166. kmongo_jr% exit
  167. kmongo_jr% 
  168. script done on Tue Aug 25 09:17:30 1992
  169.  
  170.  
  171. If you need more info, contact me at
  172. dir@lookout.uswest.com
  173. 303/595-2854
  174.  
  175. Thanx
  176.  
  177.