public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* Re: Another script for building binutils
@ 1999-07-28 20:52 Mark E.
  1999-07-29 11:29 ` Ian Lance Taylor
  0 siblings, 1 reply; 4+ messages in thread
From: Mark E. @ 1999-07-28 20:52 UTC (permalink / raw)
  To: binutils

There definitely seems to be a problem with -g. Here's a sample program that shows 
the problem:

#include <stdio.h>
#include <io.h>

int main()
{
  int fd = 3;
  short dev_info;

  while (fd <= 20)
  {
    dev_info = _get_dev_info(fd);
    if (dev_info >= 0)
      printf ("%i ", fd);
    ++fd;
  }

  printf ("\n");

  return 0;
}

which generates with -g:
	.file	"main.c"
gcc2_compiled.:
___gnu_compiled_c:
.text
	.def	_va_list;	.scl	13;	.type	021;	.endef
	.def	_size_t;	.scl	13;	.type	017;	.endef
	.def	_.0fake;	.scl	10;	.type	010;	.size	32;	.endef
	.def	__cnt;	.val	0;	.scl	8;	.type	04;	.endef
	.def	__ptr;	.val	4;	.scl	8;	.type	022;	.endef
	.def	__base;	.val	8;	.scl	8;	.type	022;	.endef
	.def	__bufsiz;	.val	12;	.scl	8;	.type	04;	.endef
	.def	__flag;	.val	16;	.scl	8;	.type	04;	.endef
	.def	__file;	.val	20;	.scl	8;	.type	04;	.endef
	.def	__name_to_remove;	.val	24;	.scl	8;	.type	022;	.endef
	.def	__fillsize;	.val	28;	.scl	8;	.type	04;	.endef
	.def	.eos;	.val	32;	.scl	102;	.tag	_.0fake;	.size	32;	.endef
	.def	_FILE;	.scl	13;	.tag	_.0fake;	.size	32;	.type	010;	.endef
	.def	_fpos_t;	.scl	13;	.type	017;	.endef
	.def	_dev_t;	.scl	13;	.type	04;	.endef
	.def	_ino_t;	.scl	13;	.type	04;	.endef
	.def	_mode_t;	.scl	13;	.type	04;	.endef
	.def	_nlink_t;	.scl	13;	.type	04;	.endef
	.def	_gid_t;	.scl	13;	.type	04;	.endef
	.def	_off_t;	.scl	13;	.type	04;	.endef
	.def	_pid_t;	.scl	13;	.type	04;	.endef
	.def	_ssize_t;	.scl	13;	.type	04;	.endef
	.def	_uid_t;	.scl	13;	.type	04;	.endef
	.def	_fd_set;	.scl	10;	.type	010;	.size	32;	.endef
	.def	_fd_bits;	.val	0;	.scl	8;	.dim	32;	.size	32;	.type	074;	.endef
	.def	.eos;	.val	32;	.scl	102;	.tag	_fd_set;	.size	32;	.endef
	.def	_fd_set;	.scl	13;	.tag	_fd_set;	.size	32;	.type	010;	.endef
	.def	_time_t;	.scl	13;	.type	016;	.endef
LC0:
	.ascii "%i \0"
LC1:
	.ascii "\12\0"
	.p2align 2
	.def	_main;	.val	_main;	.scl	2;	.type	044;	.endef
.globl _main
_main:
	.def	.bf;	.val	.;	.scl	101;	.line	5;	.endef
	pushl %ebp
	movl %esp,%ebp
	subl $8,%esp
	.ln	2
	.def	_fd;	.val	-4;	.scl	1;	.type	04;	.endef
	.def	_dev_info;	.val	-6;	.scl	1;	.type	03;	.endef
	movl $3,-4(%ebp)
	.ln	5
	.p2align 2
L2:
	cmpl $20,-4(%ebp)
	jle L4
	jmp L3
	.p2align 2
L4:
	.ln	7
	movl -4(%ebp),%eax
	pushl %eax
	call __get_dev_info
	addl $4,%esp
	movl %eax,%eax
	movw %ax,-6(%ebp)
	.ln	8
	cmpw $0,-6(%ebp)
	jl L5
	.ln	9
	movl -4(%ebp),%eax
	pushl %eax
	pushl $LC0
	call _printf
	addl $8,%esp
L5:
	.ln	10
	incl -4(%ebp)
	.ln	11
	jmp L2
	.p2align 2
L3:
	.ln	13
	pushl $LC1
	call _printf
	addl $4,%esp
	.ln	15
	xorl %eax,%eax
	jmp L1
	.ln	16
	.p2align 2
L1:
	movl %ebp,%esp
	popl %ebp
	ret
	.def	.ef;	.val	.;	.scl	101;	.line	16;	.endef
	.def	_main;	.val	.;	.scl	-1;	.endef

Here's the objdump --debug-syms output for main1.o, generated by the Dec. 98 
snapshot version of as.exe:

main1.o:     file format coff-go32

SYMBOL TABLE:
[  0](sec -2)(fl 0x00)(ty   0)(scl 103) (nx 1) 0x00000000 main.c
File 
[  2](sec  1)(fl 0x00)(ty   0)(scl   6) (nx 0) 0x00000000 gcc2_compiled.
[  3](sec  1)(fl 0x00)(ty   0)(scl   6) (nx 0) 0x00000000 ___gnu_compiled_c
[  4](sec -2)(fl 0x00)(ty  11)(scl  13) (nx 0) 0x00000000 _va_list
[  5](sec -2)(fl 0x00)(ty   f)(scl  13) (nx 0) 0x00000000 _size_t
[  6](sec -2)(fl 0x00)(ty   8)(scl  10) (nx 1) 0x00000000 _.0fake
AUX lnno 0 size 0x20 tagndx 0 endndx 18
[  8](sec -1)(fl 0x00)(ty   4)(scl   8) (nx 0) 0x00000000 __cnt
[  9](sec -1)(fl 0x00)(ty  12)(scl   8) (nx 0) 0x00000004 __ptr
[ 10](sec -1)(fl 0x00)(ty  12)(scl   8) (nx 0) 0x00000008 __base
[ 11](sec -1)(fl 0x00)(ty   4)(scl   8) (nx 0) 0x0000000c __bufsiz
[ 12](sec -1)(fl 0x00)(ty   4)(scl   8) (nx 0) 0x00000010 __flag
[ 13](sec -1)(fl 0x00)(ty   4)(scl   8) (nx 0) 0x00000014 __file
[ 14](sec -1)(fl 0x00)(ty  12)(scl   8) (nx 0) 0x00000018 __name_to_remove
[ 15](sec -1)(fl 0x00)(ty   4)(scl   8) (nx 0) 0x0000001c __fillsize
[ 16](sec -1)(fl 0x00)(ty   0)(scl 102) (nx 1) 0x00000020 .eos
AUX lnno 0 size 0x20 tagndx 6
[ 18](sec -2)(fl 0x00)(ty   8)(scl  13) (nx 1) 0x00000000 _FILE
AUX lnno 0 size 0x20 tagndx 6
[ 20](sec -2)(fl 0x00)(ty   f)(scl  13) (nx 0) 0x00000000 _fpos_t
[ 21](sec -2)(fl 0x00)(ty   4)(scl  13) (nx 0) 0x00000000 _dev_t
[ 22](sec -2)(fl 0x00)(ty   4)(scl  13) (nx 0) 0x00000000 _ino_t
[ 23](sec -2)(fl 0x00)(ty   4)(scl  13) (nx 0) 0x00000000 _mode_t
[ 24](sec -2)(fl 0x00)(ty   4)(scl  13) (nx 0) 0x00000000 _nlink_t
[ 25](sec -2)(fl 0x00)(ty   4)(scl  13) (nx 0) 0x00000000 _gid_t
[ 26](sec -2)(fl 0x00)(ty   4)(scl  13) (nx 0) 0x00000000 _off_t
[ 27](sec -2)(fl 0x00)(ty   4)(scl  13) (nx 0) 0x00000000 _pid_t
[ 28](sec -2)(fl 0x00)(ty   4)(scl  13) (nx 0) 0x00000000 _ssize_t
[ 29](sec -2)(fl 0x00)(ty   4)(scl  13) (nx 0) 0x00000000 _uid_t
[ 30](sec -2)(fl 0x00)(ty   8)(scl  10) (nx 1) 0x00000000 _fd_set
AUX lnno 0 size 0x20 tagndx 0 endndx 36
[ 32](sec -1)(fl 0x00)(ty  3c)(scl   8) (nx 1) 0x00000000 _fd_bits
AUX lnno 0 size 0x20 tagndx 0
[ 34](sec -1)(fl 0x00)(ty   0)(scl 102) (nx 1) 0x00000020 .eos
AUX lnno 0 size 0x20 tagndx 30
[ 36](sec -2)(fl 0x00)(ty   8)(scl  13) (nx 1) 0x00000000 _fd_set
AUX lnno 0 size 0x20 tagndx 30
[ 38](sec -2)(fl 0x00)(ty   e)(scl  13) (nx 0) 0x00000000 _time_t
[ 39](sec  1)(fl 0x00)(ty  24)(scl   2) (nx 1) 0x00000008 _main
AUX lnno 96 size 0x0 tagndx 0 endndx 47
_main :
   2 : 0xe
   5 : 0x15
   7 : 0x20
   8 : 0x32
   9 : 0x39
  10 : 0x4a
  11 : 0x4d
  13 : 0x50
  15 : 0x5d
  16 : 0x61
[ 41](sec  1)(fl 0x00)(ty   0)(scl 101) (nx 1) 0x00000008 .bf
AUX lnno 5 size 0x0 tagndx 0
[ 43](sec -1)(fl 0x00)(ty   4)(scl   1) (nx 0) 0xfffffffc _fd
[ 44](sec -1)(fl 0x00)(ty   3)(scl   1) (nx 0) 0xfffffffa _dev_info
[ 45](sec  1)(fl 0x00)(ty   0)(scl 101) (nx 1) 0x00000068 .ef
AUX lnno 16 size 0x0 tagndx 0
[ 47](sec  1)(fl 0x00)(ty   0)(scl   3) (nx 1) 0x00000000 .text
AUX scnlen 0x68 nreloc 5 nlnno 11
[ 49](sec  2)(fl 0x00)(ty   0)(scl   3) (nx 1) 0x00000068 .data
AUX scnlen 0x0 nreloc 0 nlnno 0
[ 51](sec  3)(fl 0x00)(ty   0)(scl   3) (nx 1) 0x00000068 .bss
AUX scnlen 0x0 nreloc 0 nlnno 0
[ 53](sec  0)(fl 0x00)(ty   0)(scl   2) (nx 0) 0x00000000 __get_dev_info
[ 54](sec  0)(fl 0x00)(ty   0)(scl   2) (nx 0) 0x00000000 _printf


Now here is the objdump --debug-syms output for main21.o, generated by a very recent 
snapshot version of as.exe:

main2.o:     file format coff-go32

SYMBOL TABLE:
[  0](sec -2)(fl 0x00)(ty   0)(scl 103) (nx 1) 0x00000000 main.c
File 
[  2](sec  1)(fl 0x00)(ty   0)(scl   6) (nx 0) 0x00000000 gcc2_compiled.
[  3](sec  1)(fl 0x00)(ty   0)(scl   6) (nx 0) 0x00000000 ___gnu_compiled_c
[  4](sec -2)(fl 0x00)(ty  11)(scl  13) (nx 0) 0x00000000 _va_list
[  5](sec -2)(fl 0x00)(ty   f)(scl  13) (nx 0) 0x00000000 _size_t
[  6](sec -2)(fl 0x00)(ty   8)(scl  10) (nx 1) 0x00000000 _.0fake
AUX lnno 0 size 0x20 tagndx 0 endndx 18
[  8](sec -1)(fl 0x00)(ty   4)(scl   8) (nx 0) 0x00000000 __cnt
[  9](sec -1)(fl 0x00)(ty  12)(scl   8) (nx 0) 0x00000004 __ptr
[ 10](sec -1)(fl 0x00)(ty  12)(scl   8) (nx 0) 0x00000008 __base
[ 11](sec -1)(fl 0x00)(ty   4)(scl   8) (nx 0) 0x0000000c __bufsiz
[ 12](sec -1)(fl 0x00)(ty   4)(scl   8) (nx 0) 0x00000010 __flag
[ 13](sec -1)(fl 0x00)(ty   4)(scl   8) (nx 0) 0x00000014 __file
[ 14](sec -1)(fl 0x00)(ty  12)(scl   8) (nx 0) 0x00000018 __name_to_remove
[ 15](sec -1)(fl 0x00)(ty   4)(scl   8) (nx 0) 0x0000001c __fillsize
[ 16](sec -1)(fl 0x00)(ty   0)(scl 102) (nx 1) 0x00000020 .eos
AUX lnno 0 size 0x20 tagndx 6
[ 18](sec -2)(fl 0x00)(ty   8)(scl  13) (nx 1) 0x00000000 _FILE
AUX lnno 0 size 0x20 tagndx 6
[ 20](sec -2)(fl 0x00)(ty   f)(scl  13) (nx 0) 0x00000000 _fpos_t
[ 21](sec -2)(fl 0x00)(ty   4)(scl  13) (nx 0) 0x00000000 _dev_t
[ 22](sec -2)(fl 0x00)(ty   4)(scl  13) (nx 0) 0x00000000 _ino_t
[ 23](sec -2)(fl 0x00)(ty   4)(scl  13) (nx 0) 0x00000000 _mode_t
[ 24](sec -2)(fl 0x00)(ty   4)(scl  13) (nx 0) 0x00000000 _nlink_t
[ 25](sec -2)(fl 0x00)(ty   4)(scl  13) (nx 0) 0x00000000 _gid_t
[ 26](sec -2)(fl 0x00)(ty   4)(scl  13) (nx 0) 0x00000000 _off_t
[ 27](sec -2)(fl 0x00)(ty   4)(scl  13) (nx 0) 0x00000000 _pid_t
[ 28](sec -2)(fl 0x00)(ty   4)(scl  13) (nx 0) 0x00000000 _ssize_t
[ 29](sec -2)(fl 0x00)(ty   4)(scl  13) (nx 0) 0x00000000 _uid_t
[ 30](sec -2)(fl 0x00)(ty   8)(scl  10) (nx 1) 0x00000000 _fd_set
AUX lnno 0 size 0x20 tagndx 0 endndx 36
[ 32](sec -1)(fl 0x00)(ty  3c)(scl   8) (nx 1) 0x00000000 _fd_bits
AUX lnno 0 size 0x20 tagndx 0
[ 34](sec -1)(fl 0x00)(ty   0)(scl 102) (nx 1) 0x00000020 .eos
AUX lnno 0 size 0x20 tagndx 30
[ 36](sec -2)(fl 0x00)(ty   8)(scl  13) (nx 1) 0x00000000 _fd_set
AUX lnno 0 size 0x20 tagndx 30
[ 38](sec -2)(fl 0x00)(ty   e)(scl  13) (nx 0) 0x00000000 _time_t
[ 39](sec  1)(fl 0x00)(ty  24)(scl   2) (nx 1) 0x00000008 _main
AUX lnno 96 size 0x0 tagndx 0
_main :
   2 : 0xe
   5 : 0x15
   7 : 0x20
   8 : 0x32
   9 : 0x39
  10 : 0x4a
  11 : 0x4d
  13 : 0x50
  15 : 0x5d
  16 : 0x61
[ 41](sec  1)(fl 0x00)(ty   0)(scl 101) (nx 1) 0x00000008 .bf
AUX lnno 5 size 0x0 tagndx 0
[ 43](sec -2)(fl 0x00)(ty   4)(scl   1) (nx 0) 0xfffffffc _fd
[ 44](sec -2)(fl 0x00)(ty   3)(scl   1) (nx 0) 0xfffffffa _dev_info
[ 45](sec  1)(fl 0x00)(ty   0)(scl 101) (nx 1) 0x00000068 .ef
AUX lnno 5 size 0x0 tagndx 0
[ 47](sec  1)(fl 0x00)(ty   0)(scl   3) (nx 1) 0x00000000 .text
AUX scnlen 0x68 nreloc 5 nlnno 11
[ 49](sec  2)(fl 0x00)(ty   0)(scl   3) (nx 1) 0x00000000 .data
AUX scnlen 0x0 nreloc 0 nlnno 0
[ 51](sec  3)(fl 0x00)(ty   0)(scl   3) (nx 1) 0x00000000 .bss
AUX scnlen 0x0 nreloc 0 nlnno 0
[ 53](sec  0)(fl 0x00)(ty   0)(scl   2) (nx 0) 0x00000000 __get_dev_info
[ 54](sec  0)(fl 0x00)(ty   0)(scl   2) (nx 0) 0x00000000 _printf


and the differences between them:

--- out1.txt	Wed Jul 28 21:05:28 1999
+++ out2.txt	Wed Jul 28 21:05:32 1999
@@ -1,4 +1,4 @@
 
-main1.o:     file format coff-go32
+main2.o:     file format coff-go32
 
 SYMBOL TABLE:
@@ -43,5 +43,5 @@
 [ 38](sec -2)(fl 0x00)(ty   e)(scl  13) (nx 0) 0x00000000 _time_t
 [ 39](sec  1)(fl 0x00)(ty  24)(scl   2) (nx 1) 0x00000008 _main
-AUX lnno 96 size 0x0 tagndx 0 endndx 47
+AUX lnno 96 size 0x0 tagndx 0
 _main :
    2 : 0xe
@@ -57,13 +57,13 @@
 [ 41](sec  1)(fl 0x00)(ty   0)(scl 101) (nx 1) 0x00000008 .bf
 AUX lnno 5 size 0x0 tagndx 0
-[ 43](sec -1)(fl 0x00)(ty   4)(scl   1) (nx 0) 0xfffffffc _fd
-[ 44](sec -1)(fl 0x00)(ty   3)(scl   1) (nx 0) 0xfffffffa _dev_info
+[ 43](sec -2)(fl 0x00)(ty   4)(scl   1) (nx 0) 0xfffffffc _fd
+[ 44](sec -2)(fl 0x00)(ty   3)(scl   1) (nx 0) 0xfffffffa _dev_info
 [ 45](sec  1)(fl 0x00)(ty   0)(scl 101) (nx 1) 0x00000068 .ef
-AUX lnno 16 size 0x0 tagndx 0
+AUX lnno 5 size 0x0 tagndx 0
 [ 47](sec  1)(fl 0x00)(ty   0)(scl   3) (nx 1) 0x00000000 .text
 AUX scnlen 0x68 nreloc 5 nlnno 11
-[ 49](sec  2)(fl 0x00)(ty   0)(scl   3) (nx 1) 0x00000068 .data
+[ 49](sec  2)(fl 0x00)(ty   0)(scl   3) (nx 1) 0x00000000 .data
 AUX scnlen 0x0 nreloc 0 nlnno 0
-[ 51](sec  3)(fl 0x00)(ty   0)(scl   3) (nx 1) 0x00000068 .bss
+[ 51](sec  3)(fl 0x00)(ty   0)(scl   3) (nx 1) 0x00000000 .bss
 AUX scnlen 0x0 nreloc 0 nlnno 0
 [ 53](sec  0)(fl 0x00)(ty   0)(scl   2) (nx 0) 0x00000000 __get_dev_info

Is this enough to get started? If you need more, let me know.


--- 
Mark Elbrecht, snowball3@bigfoot.com
http://snowball.frogspace.net/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Another script for building binutils
  1999-07-28 20:52 Another script for building binutils Mark E.
@ 1999-07-29 11:29 ` Ian Lance Taylor
  0 siblings, 0 replies; 4+ messages in thread
From: Ian Lance Taylor @ 1999-07-29 11:29 UTC (permalink / raw)
  To: snowball; +Cc: binutils

   From: "Mark E." <snowball@snowball.frogspace.net>
   Date: Wed, 28 Jul 1999 23:52:37 -0400

   There definitely seems to be a problem with -g. Here's a sample program that shows 
   the problem:

Thanks for the test case and the output.

I'm not seeing what you're seeing.  I'm using the target
i386-pc-msdosdjgpp with current sources from the CVS repository.  My
results are identical to those you show from the December '98 version
of gas.

What target are you using?  How did you run configure?  Do you have
any patches at all against the CVS repository?

Your results make me think that you may have configured with
--enable-bfd-assembler.  Is that so?  That option has been tested for
cygwin, but as far as I know it has not been tested for any straight
i386 COFF target.

Ian

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Another script for building binutils
  1999-07-28 17:27 ` Mark E.
@ 1999-07-28 22:13   ` Ian Lance Taylor
  0 siblings, 0 replies; 4+ messages in thread
From: Ian Lance Taylor @ 1999-07-28 22:13 UTC (permalink / raw)
  To: snowball3; +Cc: djgpp-workers, binutils

   From: "Mark E." <snowball3@bigfoot.com>
   Date: Wed, 28 Jul 1999 20:27:45 -0400

   I then generated another .s file using 'gcc -g -S main.c' and repeated 
   the generation of the two .o files. I could debug the main.exe derived 
   from the Dec. '98 as.exe generated .o file. However, I could only step 
   one line into the main.exe derived from the Jul. 26th generated .o file.

Run objdump -xs on both files, and see what changed.

Ian

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Another script for building binutils
       [not found] <B0000096305@stargate.astr.lu.lv>
@ 1999-07-28 17:27 ` Mark E.
  1999-07-28 22:13   ` Ian Lance Taylor
  0 siblings, 1 reply; 4+ messages in thread
From: Mark E. @ 1999-07-28 17:27 UTC (permalink / raw)
  To: djgpp-workers, binutils

> Last test were done with binutils snapshots (990727 appears to be 
> bad: broken debug info, so I'll perhaps return to 990710 which I 
> used for some time).

Hi Andris,
I'm also sending this to binutils so perhaps we can get some help. I 
did some testing and found that compiling with -g (for COFF 
debugging) doesn't work properly while using -gstabs+ will work with 
my sample C program.

How I tested:
I compiled a small C program to an .s file using 'gcc -gstabs+ -S 
main.c'. I then used the as.exe from Dec '98 to generate a .o file and an 
as.exe from July 26th to do the same but with a different filename. I 
was able to step through the generated executables derived from both 
.o files with rhgdb.exe.

I then generated another .s file using 'gcc -g -S main.c' and repeated 
the generation of the two .o files. I could debug the main.exe derived 
from the Dec. '98 as.exe generated .o file. However, I could only step 
one line into the main.exe derived from the Jul. 26th generated .o file.

Andris, is this something like what you found?

If this is something that only happened very recently, the cause should 
be easily traceable.

BTW, I made sure to disable long section support and my alignment 
patch #2 before testing.

Mark
--- 
Mark Elbrecht, snowball3@bigfoot.com
http://snowball.frogspace.net/

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~1999-07-29 11:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-07-28 20:52 Another script for building binutils Mark E.
1999-07-29 11:29 ` Ian Lance Taylor
     [not found] <B0000096305@stargate.astr.lu.lv>
1999-07-28 17:27 ` Mark E.
1999-07-28 22:13   ` Ian Lance Taylor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).