🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gdb.bug
Article #390

gdb-4.6 vs Sun's acc

#390
From: Daniel I. Rosenblatt
Date: Tue, 25 Aug 1992 03:22
163 lines
5513 bytes
Both gcc (2.2.2) and Sun's standard cc work fine with gdb-4.6.
Sun's acc generates somewhat different symbol table info which causes
gdb-4.6 to abort.  My configuration is a Sun 4/670 running SunOS 4.1.2.
I built gdb-4.6 with gcc-2.2.2 and 'configure sparc'.  Here is a session
demonstrating the problem:
------------------------------------------------------------------------
Script started on Tue Aug 25 09:15:14 1992
kmongo_jr% cat tst.c
main(argc, argv)
int argc;
char *argv[];
{
	int i = 7, j = 19;
	double x = 2.3;

	printf("%d %d %f\n", i, j, x);
	abort();
}
kmongo_jr% /home/lang/acc -g -S tst.c
kmongo_jr% cat tst.s
	.stabs	"/home/dir/gdb-4.6/",0x64,0,0,LL0
	.stabs	"tst.c",0x64,0,0,LL0
LL0:
	.seg	"data"
	.stabs	"int:t(0,1)=r(0,1);-2147483648;2147483647;",0x80,0,0,0
	.stabs	"char:t(0,2)=r(0,2);0;127;",0x80,0,0,0
	.stabs	"short:t(0,3)=r(0,1);-32768;32767;",0x80,0,0,0
	.stabs	"long:t(0,4)=r(0,1);-2147483648;2147483647;",0x80,0,0,0
	.stabs	"unsigned char:t(0,5)=r(0,1);0;255;",0x80,0,0,0
	.stabs	"unsigned short:t(0,6)=r(0,1);0;65535;",0x80,0,0,0
	.stabs	"unsigned int:t(0,7)=r(0,1);0;-1;",0x80,0,0,0
	.stabs	"unsigned long:t(0,8)=r(0,1);0;-1;",0x80,0,0,0
	.stabs	"signed char:t(0,9)=r(0,1);-128;127;",0x80,0,0,0
	.stabs	"signed short:t(0,10)=r(0,1);-32768;32767;",0x80,0,0,0
	.stabs	"signed int:t(0,11)=r(0,1);-2147483648;2147483647;",0x80,0,0,0
	.stabs	"signed long:t(0,12)=r(0,1);-2147483648;2147483647;",0x80,0,0,0
	.stabs	"float:t(0,13)=r(0,1);4;0;",0x80,0,0,0
	.stabs	"double:t(0,14)=r(0,1);8;0;",0x80,0,0,0
	.stabs	"long double:t(0,15)=r(0,1);16;0;",0x80,0,0,0
	.stabs	"void:t(0,16)=(0,16)",0x80,0,0,0
	!.file	"tst.c"
	.stabs	"main:F(0,1)",0x20,0,4,0
	.seg	"data1"
	.align	4
L16:
	.ascii	"%d %d %f\n\0"
	.seg	"text"
	.proc	04
	.global	_main

	.align	4
_main:
	!#PROLOGUE# 0
	sethi	%hi(LF12),%g1
	add	%g1,%lo(LF12),%g1
	save	%sp,%g1,%sp
	!#PROLOGUE# 1
L14:
	.seg	"text"
	.stabs	"argc:p(0,1)",0xa0,0,4,68
	.stabs	"argv:p(0,17)=*(0,18)=*(0,2)",0xa0,0,4,72
	.stabn	0300,0,1,LL1
LL1:
	.stabs	"i:(0,1)",0x80,0,4,-4
	.stabn	0104,0,5,LL2
LL2:
	mov	0x7,%o0
	st	%o0,[%fp+-0x4]
	.stabs	"j:(0,1)",0x80,0,4,-8
	.stabn	0104,0,5,LL3
LL3:
	mov	0x13,%o0
	st	%o0,[%fp+-0x8]
	.stabs	"x:(0,14)",0x80,0,8,-16
	.stabn	0104,0,6,LL4
LL4:
	sethi	%hi(L2000000),%o0
	ldd	[%o0+%lo(L2000000)],%f0
	std	%f0,[%fp+-0x10]
	.stabn	0104,0,8,LL5
LL5:
	.seg	"text"
	set	L16,%o0
	ld	[%fp+-0x4],%o1
	ld	[%fp+-0x8],%o2
	ldd	[%fp+-0x10],%o4
	mov	%o4,%o3
	mov	%o5,%o4
	call	_printf,5
	nop
	.stabn	0104,0,9,LL6
LL6:
	call	_abort,0
	nop
	.stabn	0340,0,1,LL7
LL7:
	.stabn	0104,0,10,LL8
LL8:
LE12:
	ret
	restore
	.optim	"-O~Q~R~S"
       LF12 = -112
	LP12 = 96
	LST12 = 96
	LT12 = 96
	.seg	"data"
	.align	8
L2000000:	.word	0x40026666,0x66666666
	!ident	"acomp: (CDS) SunOS5.0 IDR3.5 (H6.1) 11/01/90"
kmongo_jr% /home/lang/acc -g tst.c -o tst
kmongo_jr% gdb tst
GDB is free software and you are welcome to distribute copies of it
 under certain conditions; type "show copying" to see the conditions.
There is absolutely no warranty for GDB; type "show warranty" for details.
GDB 4.6, Copyright 1992 Free Software Foundation, Inc...
(gdb) break main
Segmentation fault (core dumped)
kmongo_jr% gdb gdb core
GDB is free software and you are welcome to distribute copies of it
 under certain conditions; type "show copying" to see the conditions.
There is absolutely no warranty for GDB; type "show warranty" for details.
GDB 4.6, Copyright 1992 Free Software Foundation, Inc...
Core was generated by `gdb'.
Program terminated with signal 11, Segmentation fault.
#0  0x33670 in decode_line_1 (argptr=0xf7fff814, funfirstline=1, 
    default_symtab=0x0, default_line=0) at symtab.c:1803
1803		  pc = BLOCK_START (SYMBOL_BLOCK_VALUE (sym)) + FUNCTION_START_OFFSET;
(gdb) list
1798	  if (sym != NULL)
1799	    {
1800	      if (SYMBOL_CLASS (sym) == LOC_BLOCK)
1801		{
1802		  /* Arg is the name of a function */
1803		  pc = BLOCK_START (SYMBOL_BLOCK_VALUE (sym)) + FUNCTION_START_OFFSET;
1804		  if (funfirstline)
1805		    SKIP_PROLOGUE (pc);
1806		  val = find_pc_line (pc, 0);
1807	#ifdef PROLOGUE_FIRSTLINE_OVERLAP
(gdb) print sym
$1 = (struct symbol *) 0x158408
(gdb) print *sym
$2 = {name = 0x158428 "main", namespace = VAR_NAMESPACE, class = LOC_BLOCK, 
  type = 0x1593a0, line = 0, value = {value = 0, block = 0x0, bytes = 0x0, 
    address = 0, chain = 0x0}, aux_value = {basereg = {regno_valid = 0, 
      regno = 0}}}
(gdb) print *sym->type
$3 = {code = TYPE_CODE_FUNC, name = 0x0, length = 1, objfile = 0x156f08, 
  target_type = 0x159078, pointer_type = 0x0, reference_type = 0x0, 
  function_type = 0x0, flags = 0, nfields = 0, fields = 0x0, 
  vptr_basetype = 0x0, vptr_fieldno = -1, type_specific = {arg_types = 0x0, 
    cplus_stuff = 0x0}}
(gdb) quit
kmongo_jr% exit
kmongo_jr% 
script done on Tue Aug 25 09:17:30 1992


If you need more info, contact me at
dir@lookout.uswest.com
303/595-2854

Thanx
Technical Details
Message-ID: <199208251522.AA06678@lookout.it.uswc.uswest.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!convex!darwin.sura.net!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!lookout.IT.USwc.USwest.COM!dir

Show Full Headers
Complete Article Headers
Newsgroups: gnu.gdb.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!convex!darwin.sura.net!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!lookout.IT.USwc.USwest.COM!dir
From: dir@lookout.IT.USwc.USwest.COM (Daniel I. Rosenblatt)
Subject: gdb-4.6 vs Sun's acc
Message-ID: <199208251522.AA06678@lookout.it.uswc.uswest.com>
Sender: gnulists@ai.mit.edu
Organization: GNUs Not Usenet
Distribution: gnu
Date: Tue, 25 Aug 1992 03:22:47 GMT
Approved: bug-gdb@prep.ai.mit.edu
Lines: 164