Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* Re: [PATCH: gdb/mi] -stack-list-locals testcase
@ 2004-01-07 21:06 Michael Elizabeth Chastain
  2004-01-07 23:47 ` Nick Roberts
  0 siblings, 1 reply; 8+ messages in thread
From: Michael Elizabeth Chastain @ 2004-01-07 21:06 UTC (permalink / raw)
  To: cagney, kettenis; +Cc: gdb-patches, nick

mark> I think it would be useful if Nick could post the output from "objdump
mark> --stabs" on the generated binary.  The output of "gcc -g -S" on the
mark> relevant source file would be even more useful.

Right.  Generally, the name and version of the compiler is essential
information here.  (The compiler used to build the test program,
not the compiler used to build gdb!)

Michael C


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

* Re: [PATCH: gdb/mi] -stack-list-locals testcase
  2004-01-07 21:06 [PATCH: gdb/mi] -stack-list-locals testcase Michael Elizabeth Chastain
@ 2004-01-07 23:47 ` Nick Roberts
  0 siblings, 0 replies; 8+ messages in thread
From: Nick Roberts @ 2004-01-07 23:47 UTC (permalink / raw)
  To: cagney, Michael Elizabeth Chastain, kettenis; +Cc: gdb-patches


> Nick, what's your exact system?  On amd64 and i386 GNU/Linux systems 
> (RHEL 3, dwarf 2, gcc 2.3.2 based) mi-stack.exp I'm also seeing this 
> pass (puzzled).

gcc 2.3.2?

nick:{nick}44: uname -a
Linux nick.uklinux.net 2.4.19-16mdk #1 Fri Sep 20 18:15:05 CEST 2002 i586 unknown

(Mandrake 9, dwarf-2, gcc 3.2)

 > mark> I think it would be useful if Nick could post the output from "objdump
 > mark> --stabs" on the generated binary...

I think my system uses dwarf-2 (whatever that is) by default. If I recompile
with `cc -gstabs -o basics basics.c', break callee4 still breaks on line 7
(which is an opening curly bracket, testsuite expects it to break on line 8).
Then:

nick:{nick}21: objdump --stabs basics


basics:     file format elf32-i386

Contents of .stab section:

Symnum n_type n_othr n_desc n_value  n_strx String

-1     HdrSym 0      62     00000397 1     
0      SO     0      0      0804833c 1      basics.c
1      OPT    0      0      00000000 10     gcc2_compiled.
2      LSYM   0      0      00000000 25     int:t(0,1)=r(0,1);-2147483648;2147483647;
3      LSYM   0      0      00000000 67     char:t(0,2)=r(0,2);0;127;
4      LSYM   0      0      00000000 93     long int:t(0,3)=r(0,3);-2147483648;2147483647;
5      LSYM   0      0      00000000 140    unsigned int:t(0,4)=r(0,4);0;-1;
6      LSYM   0      0      00000000 173    long unsigned int:t(0,5)=r(0,5);0;-1;
7      LSYM   0      0      00000000 211    long long int:t(0,6)=r(0,6);0;-1;
8      LSYM   0      0      00000000 245    long long unsigned int:t(0,7)=r(0,7);0;-1;
9      LSYM   0      0      00000000 288    short int:t(0,8)=r(0,8);-32768;32767;
10     LSYM   0      0      00000000 326    short unsigned int:t(0,9)=r(0,9);0;65535;
11     LSYM   0      0      00000000 368    signed char:t(0,10)=r(0,10);-128;127;
12     LSYM   0      0      00000000 406    unsigned char:t(0,11)=r(0,11);0;255;
13     LSYM   0      0      00000000 443    float:t(0,12)=r(0,1);4;0;
14     LSYM   0      0      00000000 469    double:t(0,13)=r(0,1);8;0;
15     LSYM   0      0      00000000 496    long double:t(0,14)=r(0,1);12;0;
16     LSYM   0      0      00000000 529    complex int:t(0,15)=s8real:(0,1),0,32;imag:(0,1),32,32;;
17     LSYM   0      0      00000000 586    complex float:t(0,16)=r(0,16);8;0;
18     LSYM   0      0      00000000 621    complex double:t(0,17)=r(0,17);16;0;
19     LSYM   0      0      00000000 658    complex long double:t(0,18)=r(0,18);24;0;
20     LSYM   0      0      00000000 700    __builtin_va_list:t(0,19)=*(0,2)
21     LSYM   0      0      00000000 733    _Bool:t(0,20)=eFalse:0,True:1,;
22     BINCL  0      0      00003137 1      basics.c
23     FUN    0      0      0804833c 765    callee4:F(0,1)
24     SLINE  0      7      00000000 0      
25     SLINE  0      8      00000003 0      
26     SLINE  0      9      0000000b 0      
27     SLINE  0      12     00000013 0      
28     SLINE  0      13     0000001e 0      
29     SLINE  0      14     00000023 0      
30     LSYM   0      0      00000008 780    A:(0,1)
31     LSYM   0      0      00000004 788    B:(0,1)
32     LSYM   0      0      00000000 796    C:(0,1)
33     LBRAC  0      0      00000000 0      
34     RBRAC  0      0      00000023 0      
35     FUN    0      0      08048364 804    callee3:F(0,1)
36     PSYM   0      0      00000008 819    strarg:p(0,19)
37     SLINE  0      16     00000000 0      
38     SLINE  0      17     00000006 0      
39     SLINE  0      18     0000000b 0      
40     FUN    0      0      08048372 834    callee2:F(0,1)
41     PSYM   0      0      00000008 849    intarg:p(0,1)
42     PSYM   0      0      0000000c 819    strarg:p(0,19)
43     SLINE  0      21     00000000 0      
44     SLINE  0      22     00000006 0      
45     SLINE  0      23     00000014 0      
46     FUN    0      0      08048388 863    callee1:F(0,1)
47     PSYM   0      0      00000008 849    intarg:p(0,1)
48     PSYM   0      0      0000000c 819    strarg:p(0,19)
49     PSYM   0      0      00000010 878    fltarg:p(0,13)
50     SLINE  0      26     00000000 0      
51     SLINE  0      27     00000012 0      
52     SLINE  0      28     00000023 0      
53     LSYM   0      0      fffffff8 893    fltarg:(0,13)
54     FUN    0      0      080483ae 907    main:F(0,1)
55     SLINE  0      31     00000000 0      
56     SLINE  0      32     00000010 0      
57     SLINE  0      33     00000026 0      
58     SLINE  0      35     0000003c 0      
59     SLINE  0      37     0000004c 0      
60     SLINE  0      38     00000051 0      
61     SO     0      0      08048401 0      


 > mark>                                  ...The output of "gcc -g -S" on the
 > mark> relevant source file would be even more useful.

see below (for stabs case).

 > Right.  Generally, the name and version of the compiler is essential
 > information here.  (The compiler used to build the test program,
 > not the compiler used to build gdb!)

nick:{nick}42: cc --version

cc (GCC) 3.2 (Mandrake Linux 9.0 3.2-1mdk)
Copyright (C) 2002 Free Software Foundation, Inc.




	.file	"basics.c"
	.file 1 "basics.c"
	.section	.debug_abbrev,"",@progbits
.Ldebug_abbrev0:
	.section	.debug_info,"",@progbits
.Ldebug_info0:
	.section	.debug_line,"",@progbits
.Ldebug_line0:
	.text
.Ltext0:
	.align 2
.globl callee4
	.type	callee4,@function
callee4:
.LFB1:
	.loc 1 7 0
.LBB2:
	subl	$12, %esp
.LCFI0:
	.loc 1 8 0
	movl	$1, 8(%esp)
	.loc 1 9 0
	movl	$2, 4(%esp)
	.loc 1 12 0
	movl	4(%esp), %eax
	addl	8(%esp), %eax
	movl	%eax, (%esp)
	.loc 1 13 0
	movl	$0, %eax
.LBE2:
	.loc 1 14 0
	addl	$12, %esp
.LCFI1:
	ret
.LFE1:
.Lfe1:
	.size	callee4,.Lfe1-callee4
	.align 2
.globl callee3
	.type	callee3,@function
callee3:
.LFB2:
	.loc 1 16 0
	pushl	%ebp
.LCFI2:
	movl	%esp, %ebp
.LCFI3:
	subl	$8, %esp
.LCFI4:
	.loc 1 17 0
	call	callee4
	.loc 1 18 0
	leave
	ret
.LFE2:
.Lfe2:
	.size	callee3,.Lfe2-callee3
	.align 2
.globl callee2
	.type	callee2,@function
callee2:
.LFB3:
	.loc 1 21 0
	pushl	%ebp
.LCFI5:
	movl	%esp, %ebp
.LCFI6:
	subl	$8, %esp
.LCFI7:
	.loc 1 22 0
	subl	$12, %esp
	pushl	12(%ebp)
.LCFI8:
	call	callee3
	addl	$16, %esp
	.loc 1 23 0
	leave
	ret
.LFE3:
.Lfe3:
	.size	callee2,.Lfe3-callee2
	.align 2
.globl callee1
	.type	callee1,@function
callee1:
.LFB4:
	.loc 1 26 0
	pushl	%ebp
.LCFI9:
	movl	%esp, %ebp
.LCFI10:
	subl	$8, %esp
.LCFI11:
	movl	16(%ebp), %eax
	movl	20(%ebp), %edx
	movl	%eax, -8(%ebp)
	movl	%edx, -4(%ebp)
	.loc 1 27 0
	subl	$8, %esp
	pushl	12(%ebp)
	pushl	8(%ebp)
.LCFI12:
	call	callee2
	addl	$16, %esp
	.loc 1 28 0
	leave
	ret
.LFE4:
.Lfe4:
	.size	callee1,.Lfe4-callee1
	.section	.rodata
.LC0:
	.string	"A string argument."
.LC1:
	.string	"Hello, World!"
	.text
	.align 2
.globl main
	.type	main,@function
main:
.LFB5:
	.loc 1 31 0
	pushl	%ebp
.LCFI13:
	movl	%esp, %ebp
.LCFI14:
	subl	$8, %esp
.LCFI15:
	andl	$-16, %esp
	movl	$0, %eax
	subl	%eax, %esp
	.loc 1 32 0
	pushl	$1074528256
	pushl	$0
	pushl	$.LC0
	pushl	$2
.LCFI16:
	call	callee1
	addl	$16, %esp
	.loc 1 33 0
	pushl	$1074528256
	pushl	$0
	pushl	$.LC0
	pushl	$2
	call	callee1
	addl	$16, %esp
	.loc 1 35 0
	subl	$12, %esp
	pushl	$.LC1
	call	printf
	addl	$16, %esp
	.loc 1 37 0
	movl	$0, %eax
	.loc 1 38 0
	leave
	ret
.LFE5:
.Lfe5:
	.size	main,.Lfe5-main
	.section	.debug_frame,"",@progbits
.Lframe0:
	.long	.LECIE0-.LSCIE0
.LSCIE0:
	.long	0xffffffff
	.byte	0x1
	.string	""
	.uleb128 0x1
	.sleb128 -4
	.byte	0x8
	.byte	0xc
	.uleb128 0x4
	.uleb128 0x4
	.byte	0x88
	.uleb128 0x1
	.align 4
.LECIE0:
.LSFDE0:
	.long	.LEFDE0-.LASFDE0
.LASFDE0:
	.long	.Lframe0
	.long	.LFB1
	.long	.LFE1-.LFB1
	.byte	0x4
	.long	.LCFI0-.LFB1
	.byte	0xe
	.uleb128 0x10
	.byte	0x4
	.long	.LCFI1-.LCFI0
	.byte	0xe
	.uleb128 0x4
	.align 4
.LEFDE0:
.LSFDE2:
	.long	.LEFDE2-.LASFDE2
.LASFDE2:
	.long	.Lframe0
	.long	.LFB2
	.long	.LFE2-.LFB2
	.byte	0x4
	.long	.LCFI2-.LFB2
	.byte	0xe
	.uleb128 0x8
	.byte	0x85
	.uleb128 0x2
	.byte	0x4
	.long	.LCFI3-.LCFI2
	.byte	0xd
	.uleb128 0x5
	.align 4
.LEFDE2:
.LSFDE4:
	.long	.LEFDE4-.LASFDE4
.LASFDE4:
	.long	.Lframe0
	.long	.LFB3
	.long	.LFE3-.LFB3
	.byte	0x4
	.long	.LCFI5-.LFB3
	.byte	0xe
	.uleb128 0x8
	.byte	0x85
	.uleb128 0x2
	.byte	0x4
	.long	.LCFI6-.LCFI5
	.byte	0xd
	.uleb128 0x5
	.byte	0x4
	.long	.LCFI8-.LCFI6
	.byte	0x2e
	.uleb128 0x10
	.align 4
.LEFDE4:
.LSFDE6:
	.long	.LEFDE6-.LASFDE6
.LASFDE6:
	.long	.Lframe0
	.long	.LFB4
	.long	.LFE4-.LFB4
	.byte	0x4
	.long	.LCFI9-.LFB4
	.byte	0xe
	.uleb128 0x8
	.byte	0x85
	.uleb128 0x2
	.byte	0x4
	.long	.LCFI10-.LCFI9
	.byte	0xd
	.uleb128 0x5
	.byte	0x4
	.long	.LCFI12-.LCFI10
	.byte	0x2e
	.uleb128 0x10
	.align 4
.LEFDE6:
.LSFDE8:
	.long	.LEFDE8-.LASFDE8
.LASFDE8:
	.long	.Lframe0
	.long	.LFB5
	.long	.LFE5-.LFB5
	.byte	0x4
	.long	.LCFI13-.LFB5
	.byte	0xe
	.uleb128 0x8
	.byte	0x85
	.uleb128 0x2
	.byte	0x4
	.long	.LCFI14-.LCFI13
	.byte	0xd
	.uleb128 0x5
	.byte	0x4
	.long	.LCFI16-.LCFI14
	.byte	0x2e
	.uleb128 0x10
	.align 4
.LEFDE8:
	.text
.Letext0:
	.section	.debug_info
	.long	0x13b
	.value	0x2
	.long	.Ldebug_abbrev0
	.byte	0x4
	.uleb128 0x1
	.long	.Ldebug_line0
	.long	.Letext0
	.long	.Ltext0
	.long	.LC11
	.long	.LC12
	.long	.LC13
	.byte	0x1
	.uleb128 0x2
	.long	0x65
	.byte	0x1
	.long	.LC2
	.byte	0x1
	.byte	0x7
	.byte	0x1
	.long	0x65
	.long	.LFB1
	.long	.LFE1
	.byte	0x1
	.byte	0x54
	.uleb128 0x3
	.string	"A"
	.byte	0x1
	.byte	0x8
	.long	0x65
	.byte	0x2
	.byte	0x91
	.sleb128 8
	.uleb128 0x3
	.string	"B"
	.byte	0x1
	.byte	0x9
	.long	0x65
	.byte	0x2
	.byte	0x91
	.sleb128 4
	.uleb128 0x3
	.string	"C"
	.byte	0x1
	.byte	0xa
	.long	0x65
	.byte	0x2
	.byte	0x91
	.sleb128 0
	.byte	0x0
	.uleb128 0x4
	.string	"int"
	.byte	0x4
	.byte	0x5
	.uleb128 0x2
	.long	0x96
	.byte	0x1
	.long	.LC3
	.byte	0x1
	.byte	0x10
	.byte	0x1
	.long	0x65
	.long	.LFB2
	.long	.LFE2
	.byte	0x1
	.byte	0x55
	.uleb128 0x5
	.long	.LC6
	.byte	0x1
	.byte	0xf
	.long	0x96
	.byte	0x2
	.byte	0x91
	.sleb128 8
	.byte	0x0
	.uleb128 0x6
	.byte	0x4
	.long	0x9c
	.uleb128 0x7
	.long	.LC4
	.byte	0x1
	.byte	0x6
	.uleb128 0x2
	.long	0xdb
	.byte	0x1
	.long	.LC5
	.byte	0x1
	.byte	0x15
	.byte	0x1
	.long	0x65
	.long	.LFB3
	.long	.LFE3
	.byte	0x1
	.byte	0x55
	.uleb128 0x5
	.long	.LC7
	.byte	0x1
	.byte	0x14
	.long	0x65
	.byte	0x2
	.byte	0x91
	.sleb128 8
	.uleb128 0x5
	.long	.LC6
	.byte	0x1
	.byte	0x14
	.long	0x96
	.byte	0x2
	.byte	0x91
	.sleb128 12
	.byte	0x0
	.uleb128 0x2
	.long	0x121
	.byte	0x1
	.long	.LC8
	.byte	0x1
	.byte	0x1a
	.byte	0x1
	.long	0x65
	.long	.LFB4
	.long	.LFE4
	.byte	0x1
	.byte	0x55
	.uleb128 0x5
	.long	.LC7
	.byte	0x1
	.byte	0x19
	.long	0x65
	.byte	0x2
	.byte	0x91
	.sleb128 8
	.uleb128 0x5
	.long	.LC6
	.byte	0x1
	.byte	0x19
	.long	0x96
	.byte	0x2
	.byte	0x91
	.sleb128 12
	.uleb128 0x5
	.long	.LC9
	.byte	0x1
	.byte	0x19
	.long	0x121
	.byte	0x2
	.byte	0x91
	.sleb128 -8
	.byte	0x0
	.uleb128 0x7
	.long	.LC10
	.byte	0x8
	.byte	0x4
	.uleb128 0x8
	.byte	0x1
	.long	.LC14
	.byte	0x1
	.byte	0x1f
	.long	0x65
	.long	.LFB5
	.long	.LFE5
	.byte	0x1
	.byte	0x55
	.byte	0x0
	.section	.debug_abbrev
	.uleb128 0x1
	.uleb128 0x11
	.byte	0x1
	.uleb128 0x10
	.uleb128 0x6
	.uleb128 0x12
	.uleb128 0x1
	.uleb128 0x11
	.uleb128 0x1
	.uleb128 0x3
	.uleb128 0xe
	.uleb128 0x1b
	.uleb128 0xe
	.uleb128 0x25
	.uleb128 0xe
	.uleb128 0x13
	.uleb128 0xb
	.byte	0x0
	.byte	0x0
	.uleb128 0x2
	.uleb128 0x2e
	.byte	0x1
	.uleb128 0x1
	.uleb128 0x13
	.uleb128 0x3f
	.uleb128 0xc
	.uleb128 0x3
	.uleb128 0xe
	.uleb128 0x3a
	.uleb128 0xb
	.uleb128 0x3b
	.uleb128 0xb
	.uleb128 0x27
	.uleb128 0xc
	.uleb128 0x49
	.uleb128 0x13
	.uleb128 0x11
	.uleb128 0x1
	.uleb128 0x12
	.uleb128 0x1
	.uleb128 0x40
	.uleb128 0xa
	.byte	0x0
	.byte	0x0
	.uleb128 0x3
	.uleb128 0x34
	.byte	0x0
	.uleb128 0x3
	.uleb128 0x8
	.uleb128 0x3a
	.uleb128 0xb
	.uleb128 0x3b
	.uleb128 0xb
	.uleb128 0x49
	.uleb128 0x13
	.uleb128 0x2
	.uleb128 0xa
	.byte	0x0
	.byte	0x0
	.uleb128 0x4
	.uleb128 0x24
	.byte	0x0
	.uleb128 0x3
	.uleb128 0x8
	.uleb128 0xb
	.uleb128 0xb
	.uleb128 0x3e
	.uleb128 0xb
	.byte	0x0
	.byte	0x0
	.uleb128 0x5
	.uleb128 0x5
	.byte	0x0
	.uleb128 0x3
	.uleb128 0xe
	.uleb128 0x3a
	.uleb128 0xb
	.uleb128 0x3b
	.uleb128 0xb
	.uleb128 0x49
	.uleb128 0x13
	.uleb128 0x2
	.uleb128 0xa
	.byte	0x0
	.byte	0x0
	.uleb128 0x6
	.uleb128 0xf
	.byte	0x0
	.uleb128 0xb
	.uleb128 0xb
	.uleb128 0x49
	.uleb128 0x13
	.byte	0x0
	.byte	0x0
	.uleb128 0x7
	.uleb128 0x24
	.byte	0x0
	.uleb128 0x3
	.uleb128 0xe
	.uleb128 0xb
	.uleb128 0xb
	.uleb128 0x3e
	.uleb128 0xb
	.byte	0x0
	.byte	0x0
	.uleb128 0x8
	.uleb128 0x2e
	.byte	0x0
	.uleb128 0x3f
	.uleb128 0xc
	.uleb128 0x3
	.uleb128 0xe
	.uleb128 0x3a
	.uleb128 0xb
	.uleb128 0x3b
	.uleb128 0xb
	.uleb128 0x49
	.uleb128 0x13
	.uleb128 0x11
	.uleb128 0x1
	.uleb128 0x12
	.uleb128 0x1
	.uleb128 0x40
	.uleb128 0xa
	.byte	0x0
	.byte	0x0
	.byte	0x0
	.section	.debug_pubnames,"",@progbits
	.long	0x47
	.value	0x2
	.long	.Ldebug_info0
	.long	0x13f
	.long	0x25
	.string	"callee4"
	.long	0x6c
	.string	"callee3"
	.long	0xa3
	.string	"callee2"
	.long	0xdb
	.string	"callee1"
	.long	0x128
	.string	"main"
	.long	0x0
	.section	.debug_aranges,"",@progbits
	.long	0x1c
	.value	0x2
	.long	.Ldebug_info0
	.byte	0x4
	.byte	0x0
	.value	0x0
	.value	0x0
	.long	.Ltext0
	.long	.Letext0-.Ltext0
	.long	0x0
	.long	0x0
	.section	.debug_str,"MS",@progbits,1
.LC13:
	.string	"GNU C 3.2 (Mandrake Linux 9.0 3.2-1mdk)"
.LC12:
	.string	"/home/nick"
.LC7:
	.string	"intarg"
.LC6:
	.string	"strarg"
.LC8:
	.string	"callee1"
.LC5:
	.string	"callee2"
.LC3:
	.string	"callee3"
.LC2:
	.string	"callee4"
.LC11:
	.string	"basics.c"
.LC14:
	.string	"main"
.LC4:
	.string	"char"
.LC9:
	.string	"fltarg"
.LC10:
	.string	"double"
	.ident	"GCC: (GNU) 3.2 (Mandrake Linux 9.0 3.2-1mdk)"


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

* Re: [PATCH: gdb/mi] -stack-list-locals testcase
  2004-01-07 17:34                       ` Mark Kettenis
@ 2004-01-07 17:40                         ` Daniel Jacobowitz
  0 siblings, 0 replies; 8+ messages in thread
From: Daniel Jacobowitz @ 2004-01-07 17:40 UTC (permalink / raw)
  To: gdb-patches

On Wed, Jan 07, 2004 at 06:34:13PM +0100, Mark Kettenis wrote:
>    Date: Wed, 07 Jan 2004 11:31:54 -0500
>    From: Andrew Cagney <cagney@gnu.org>
> 
>    > *** mi-stack.exp.~1.10.~    2002-11-05 15:43:18.000000000 +0000
>    > --- mi-stack.exp    2004-01-05 23:38:27.000000000 +0000
>    > ***************
>    > *** 57,63 ****
>    >       # -stack-list-frames 1 3
>    >         mi_gdb_test "231-stack-list-frames" \
>    > !         "231\\^done,stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"callee4\",file=\".*basics.c\",line=\"8\"\},frame=\{level=\"1\",addr=\"$hex\",func=\"callee3\",.*\},frame=\{level=\"2\",addr=\"$hex\",func=\"callee2\",.*\},frame=\{level=\"3\",addr=\"$hex\",func=\"callee1\",.*\},frame=\{level=\"4\",addr=\"$hex\",func=\"main\",.*\}\\\]" \
>    >                   "stack frame listing"
>    >       mi_gdb_test "232-stack-list-frames 1 1" \
>    >           "232\\^done,stack=\\\[frame=\{level=\"1\",addr=\"$hex\",func=\"callee3\",.*\}\\\]" \
>    > --- 57,63 ----
>    >       # -stack-list-frames 1 3
>    >         mi_gdb_test "231-stack-list-frames" \
>    > !         "231\\^done,stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"callee4\",file=\".*basics.c\",line=\"7\"\},frame=\{level=\"1\",addr=\"$hex\",func=\"callee3\",.*\},frame=\{level=\"2\",addr=\"$hex\",func=\"callee2\",.*\},frame=\{level=\"3\",addr=\"$hex\",func=\"callee1\",.*\},frame=\{level=\"4\",addr=\"$hex\",func=\"main\",.*\}\\\]" \
>    >                   "stack frame listing"
>    >       mi_gdb_test "232-stack-list-frames 1 1" \
>    >           "232\\^done,stack=\\\[frame=\{level=\"1\",addr=\"$hex\",func=\"callee3\",.*\}\\\]" \
>    > 
>    > This test (and the rest of mi-stack.exp) is passing on a PPC/NetBSD gcc 2.96 stabs system.  We'll need to look at it more carefully (or check michaelc's test matrix) to see why there's a failure.  MI is more strict  with its test results. 
> 
>    Nick, what's your exact system?  On amd64 and i386 GNU/Linux systems 
>    (RHEL 3, dwarf 2, gcc 2.3.2 based) mi-stack.exp I'm also seeing this 
>    pass (puzzled).
> 
> I think it would be useful if Nick could post the output from "objdump
> --stabs" on the generated binary.  The output of "gcc -g -S" on the
> relevant source file would be even more useful.
> 
> I know for a fact that there are serious problems with the way GDB
> reads line numbers for stabs.  In order to work around the bad
> line-number info generated by GCC 2.95.3, we relocate the first
> N_SLINE stab, which leads to incorrect behaviour, such as skipping the
> first line of a function, with other compilers (such as Sun's) and
> when debugging optimized code.  It's not unlikely that it influences
> non-IA-32 platforms too.
> 
> I'll post a more detailed explanation in the near future.

*sigh* it may be time to remove that hack.  I went to a lot of trouble
to get it to work, but lately a number of legitimate inputs have been
getting confused by it.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer


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

* Re: [PATCH: gdb/mi] -stack-list-locals testcase
  2004-01-07 16:31                     ` Andrew Cagney
@ 2004-01-07 17:34                       ` Mark Kettenis
  2004-01-07 17:40                         ` Daniel Jacobowitz
  0 siblings, 1 reply; 8+ messages in thread
From: Mark Kettenis @ 2004-01-07 17:34 UTC (permalink / raw)
  To: cagney; +Cc: nick, gdb-patches

   Date: Wed, 07 Jan 2004 11:31:54 -0500
   From: Andrew Cagney <cagney@gnu.org>

   > *** mi-stack.exp.~1.10.~    2002-11-05 15:43:18.000000000 +0000
   > --- mi-stack.exp    2004-01-05 23:38:27.000000000 +0000
   > ***************
   > *** 57,63 ****
   >       # -stack-list-frames 1 3
   >         mi_gdb_test "231-stack-list-frames" \
   > !         "231\\^done,stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"callee4\",file=\".*basics.c\",line=\"8\"\},frame=\{level=\"1\",addr=\"$hex\",func=\"callee3\",.*\},frame=\{level=\"2\",addr=\"$hex\",func=\"callee2\",.*\},frame=\{level=\"3\",addr=\"$hex\",func=\"callee1\",.*\},frame=\{level=\"4\",addr=\"$hex\",func=\"main\",.*\}\\\]" \
   >                   "stack frame listing"
   >       mi_gdb_test "232-stack-list-frames 1 1" \
   >           "232\\^done,stack=\\\[frame=\{level=\"1\",addr=\"$hex\",func=\"callee3\",.*\}\\\]" \
   > --- 57,63 ----
   >       # -stack-list-frames 1 3
   >         mi_gdb_test "231-stack-list-frames" \
   > !         "231\\^done,stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"callee4\",file=\".*basics.c\",line=\"7\"\},frame=\{level=\"1\",addr=\"$hex\",func=\"callee3\",.*\},frame=\{level=\"2\",addr=\"$hex\",func=\"callee2\",.*\},frame=\{level=\"3\",addr=\"$hex\",func=\"callee1\",.*\},frame=\{level=\"4\",addr=\"$hex\",func=\"main\",.*\}\\\]" \
   >                   "stack frame listing"
   >       mi_gdb_test "232-stack-list-frames 1 1" \
   >           "232\\^done,stack=\\\[frame=\{level=\"1\",addr=\"$hex\",func=\"callee3\",.*\}\\\]" \
   > 
   > This test (and the rest of mi-stack.exp) is passing on a PPC/NetBSD gcc 2.96 stabs system.  We'll need to look at it more carefully (or check michaelc's test matrix) to see why there's a failure.  MI is more strict  with its test results. 

   Nick, what's your exact system?  On amd64 and i386 GNU/Linux systems 
   (RHEL 3, dwarf 2, gcc 2.3.2 based) mi-stack.exp I'm also seeing this 
   pass (puzzled).

I think it would be useful if Nick could post the output from "objdump
--stabs" on the generated binary.  The output of "gcc -g -S" on the
relevant source file would be even more useful.

I know for a fact that there are serious problems with the way GDB
reads line numbers for stabs.  In order to work around the bad
line-number info generated by GCC 2.95.3, we relocate the first
N_SLINE stab, which leads to incorrect behaviour, such as skipping the
first line of a function, with other compilers (such as Sun's) and
when debugging optimized code.  It's not unlikely that it influences
non-IA-32 platforms too.

I'll post a more detailed explanation in the near future.

Mark


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

* Re: [PATCH: gdb/mi] -stack-list-locals testcase
  2004-01-06  1:07                   ` Andrew Cagney
@ 2004-01-07 16:31                     ` Andrew Cagney
  2004-01-07 17:34                       ` Mark Kettenis
  0 siblings, 1 reply; 8+ messages in thread
From: Andrew Cagney @ 2004-01-07 16:31 UTC (permalink / raw)
  To: Nick Roberts; +Cc: gdb-patches

> *** mi-stack.exp.~1.10.~    2002-11-05 15:43:18.000000000 +0000
> --- mi-stack.exp    2004-01-05 23:38:27.000000000 +0000
> ***************
> *** 57,63 ****
>       # -stack-list-frames 1 3
>         mi_gdb_test "231-stack-list-frames" \
> !         "231\\^done,stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"callee4\",file=\".*basics.c\",line=\"8\"\},frame=\{level=\"1\",addr=\"$hex\",func=\"callee3\",.*\},frame=\{level=\"2\",addr=\"$hex\",func=\"callee2\",.*\},frame=\{level=\"3\",addr=\"$hex\",func=\"callee1\",.*\},frame=\{level=\"4\",addr=\"$hex\",func=\"main\",.*\}\\\]" \
>                   "stack frame listing"
>       mi_gdb_test "232-stack-list-frames 1 1" \
>           "232\\^done,stack=\\\[frame=\{level=\"1\",addr=\"$hex\",func=\"callee3\",.*\}\\\]" \
> --- 57,63 ----
>       # -stack-list-frames 1 3
>         mi_gdb_test "231-stack-list-frames" \
> !         "231\\^done,stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"callee4\",file=\".*basics.c\",line=\"7\"\},frame=\{level=\"1\",addr=\"$hex\",func=\"callee3\",.*\},frame=\{level=\"2\",addr=\"$hex\",func=\"callee2\",.*\},frame=\{level=\"3\",addr=\"$hex\",func=\"callee1\",.*\},frame=\{level=\"4\",addr=\"$hex\",func=\"main\",.*\}\\\]" \
>                   "stack frame listing"
>       mi_gdb_test "232-stack-list-frames 1 1" \
>           "232\\^done,stack=\\\[frame=\{level=\"1\",addr=\"$hex\",func=\"callee3\",.*\}\\\]" \
> 
> This test (and the rest of mi-stack.exp) is passing on a PPC/NetBSD gcc 2.96 stabs system.  We'll need to look at it more carefully (or check michaelc's test matrix) to see why there's a failure.  MI is more strict  with its test results. 

Nick, what's your exact system?  On amd64 and i386 GNU/Linux systems 
(RHEL 3, dwarf 2, gcc 2.3.2 based) mi-stack.exp I'm also seeing this 
pass (puzzled).

Andrew


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

* Re: [PATCH: gdb/mi] -stack-list-locals testcase
@ 2004-01-06  1:12 Michael Elizabeth Chastain
  0 siblings, 0 replies; 8+ messages in thread
From: Michael Elizabeth Chastain @ 2004-01-06  1:12 UTC (permalink / raw)
  To: cagney, nick; +Cc: gdb-patches

Line number differences say that gdb stopped on a different line.
Sometimes this is legal gdb behavior, and sometimes it indicates
a problem in gdb or in the debug output of gcc or in the interface
between the two.

Someone has to look closely at the gdb.log and decide which line
number(s) are legal to stop on.  If gdb stops on a different line
number than it's supposed to, that is a bug, and it gets a FAIL
or a KFAIL or an XFAIL.

Michael C


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

* Re: [PATCH: gdb/mi] -stack-list-locals testcase
  2004-01-06  0:14                 ` [PATCH: gdb/mi] -stack-list-locals testcase Nick Roberts
@ 2004-01-06  1:07                   ` Andrew Cagney
  2004-01-07 16:31                     ` Andrew Cagney
  0 siblings, 1 reply; 8+ messages in thread
From: Andrew Cagney @ 2004-01-06  1:07 UTC (permalink / raw)
  To: Nick Roberts; +Cc: gdb-patches

>  > Nick, just the testcase is missing.  Suggest tweaking "mi-stack.exp" 
>  > (you do not need to tweak mi[12]-stack.exp since they test older protocols).
> 
> mi-stack.exp had three fails to start with. Replacing line=\"7\" with
> line=\"8\" and "-exec-next 3" with "-exec-next 4" removed them.
> 
> I have added one simple test for `-stack-list-locals 2' that seems to
> work. It does not test complex data types but this would require changing
> basics.c, which is probably not worth it.
> 
> Andrew, if you tell me that this patch does the right thing, then I'll do one
> for -var-list-children.
> 
> Nick
> 
> 
> *** mi-stack.exp.~1.10.~	2002-11-05 15:43:18.000000000 +0000
> --- mi-stack.exp	2004-01-05 23:38:27.000000000 +0000
> ***************
> *** 57,63 ****
>       # -stack-list-frames 1 3
>   
>       mi_gdb_test "231-stack-list-frames" \
> ! 	    "231\\^done,stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"callee4\",file=\".*basics.c\",line=\"8\"\},frame=\{level=\"1\",addr=\"$hex\",func=\"callee3\",.*\},frame=\{level=\"2\",addr=\"$hex\",func=\"callee2\",.*\},frame=\{level=\"3\",addr=\"$hex\",func=\"callee1\",.*\},frame=\{level=\"4\",addr=\"$hex\",func=\"main\",.*\}\\\]" \
>                   "stack frame listing"
>       mi_gdb_test "232-stack-list-frames 1 1" \
>   	    "232\\^done,stack=\\\[frame=\{level=\"1\",addr=\"$hex\",func=\"callee3\",.*\}\\\]" \
> --- 57,63 ----
>       # -stack-list-frames 1 3
>   
>       mi_gdb_test "231-stack-list-frames" \
> ! 	    "231\\^done,stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"callee4\",file=\".*basics.c\",line=\"7\"\},frame=\{level=\"1\",addr=\"$hex\",func=\"callee3\",.*\},frame=\{level=\"2\",addr=\"$hex\",func=\"callee2\",.*\},frame=\{level=\"3\",addr=\"$hex\",func=\"callee1\",.*\},frame=\{level=\"4\",addr=\"$hex\",func=\"main\",.*\}\\\]" \
>                   "stack frame listing"
>       mi_gdb_test "232-stack-list-frames 1 1" \
>   	    "232\\^done,stack=\\\[frame=\{level=\"1\",addr=\"$hex\",func=\"callee3\",.*\}\\\]" \

This test (and the rest of mi-stack.exp) is passing on a PPC/NetBSD gcc 
2.96 stabs system.  We'll need to look at it more carefully (or check 
michaelc's test matrix) to see why there's a failure.  MI is more strict 
  with its test results.

> ***************
> *** 156,162 ****
>                   "stack locals listing 0"
>   
>   # step until A, B, C, have some reasonable values.
> ! send_gdb "-exec-next 3\n"
>   gdb_expect {
>       -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"callee4\",args=\\\[\\\],file=\".*basics.c\",line=\"13\"\}\r\n$mi_gdb_prompt$" {
>   	pass "next's in callee4"
> --- 156,162 ----
>                   "stack locals listing 0"
>   
>   # step until A, B, C, have some reasonable values.
> ! send_gdb "-exec-next 4\n"
>   gdb_expect {
>       -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"callee4\",args=\\\[\\\],file=\".*basics.c\",line=\"13\"\}\r\n$mi_gdb_prompt$" {
>   	pass "next's in callee4"
> ***************
> *** 168,173 ****
> --- 168,177 ----
>   	    "232\\^done,locals=\\\[\{name=\"A\",value=\"1\"\},\{name=\"B\",value=\"2\"\},\{name=\"C\",value=\"3\"\}\\\]" \
>                   "stack locals listing 1"
>   
> +     mi_gdb_test "232-stack-list-locals 2" \
> + 	    "232\\^done,locals=\\\[\{name=\"A\",type=\"int\",value=\"1\"\},\{name=\"B\",type=\"int\",value=\"2\"\},\{name=\"C\",type=\"int\",value=\"3\"\}\\\]" \
> +                 "stack locals listing 2"
> + 

Yes, just like that.

Andrew


>       mi_gdb_test "234-stack-list-locals" \
>   	    "234\\^error,msg=\"mi_cmd_stack_list_locals: Usage.*PRINT_VALUES.*\"" \
>   	    "stack locals listing wrong"
> 



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

* Re: [PATCH: gdb/mi] -stack-list-locals testcase
  2004-01-05 21:43               ` Andrew Cagney
@ 2004-01-06  0:14                 ` Nick Roberts
  2004-01-06  1:07                   ` Andrew Cagney
  0 siblings, 1 reply; 8+ messages in thread
From: Nick Roberts @ 2004-01-06  0:14 UTC (permalink / raw)
  To: Andrew Cagney; +Cc: gdb-patches


 > Nick, just the testcase is missing.  Suggest tweaking "mi-stack.exp" 
 > (you do not need to tweak mi[12]-stack.exp since they test older protocols).

mi-stack.exp had three fails to start with. Replacing line=\"7\" with
line=\"8\" and "-exec-next 3" with "-exec-next 4" removed them.

I have added one simple test for `-stack-list-locals 2' that seems to
work. It does not test complex data types but this would require changing
basics.c, which is probably not worth it.

Andrew, if you tell me that this patch does the right thing, then I'll do one
for -var-list-children.

Nick


*** mi-stack.exp.~1.10.~	2002-11-05 15:43:18.000000000 +0000
--- mi-stack.exp	2004-01-05 23:38:27.000000000 +0000
***************
*** 57,63 ****
      # -stack-list-frames 1 3
  
      mi_gdb_test "231-stack-list-frames" \
! 	    "231\\^done,stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"callee4\",file=\".*basics.c\",line=\"8\"\},frame=\{level=\"1\",addr=\"$hex\",func=\"callee3\",.*\},frame=\{level=\"2\",addr=\"$hex\",func=\"callee2\",.*\},frame=\{level=\"3\",addr=\"$hex\",func=\"callee1\",.*\},frame=\{level=\"4\",addr=\"$hex\",func=\"main\",.*\}\\\]" \
                  "stack frame listing"
      mi_gdb_test "232-stack-list-frames 1 1" \
  	    "232\\^done,stack=\\\[frame=\{level=\"1\",addr=\"$hex\",func=\"callee3\",.*\}\\\]" \
--- 57,63 ----
      # -stack-list-frames 1 3
  
      mi_gdb_test "231-stack-list-frames" \
! 	    "231\\^done,stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"callee4\",file=\".*basics.c\",line=\"7\"\},frame=\{level=\"1\",addr=\"$hex\",func=\"callee3\",.*\},frame=\{level=\"2\",addr=\"$hex\",func=\"callee2\",.*\},frame=\{level=\"3\",addr=\"$hex\",func=\"callee1\",.*\},frame=\{level=\"4\",addr=\"$hex\",func=\"main\",.*\}\\\]" \
                  "stack frame listing"
      mi_gdb_test "232-stack-list-frames 1 1" \
  	    "232\\^done,stack=\\\[frame=\{level=\"1\",addr=\"$hex\",func=\"callee3\",.*\}\\\]" \
***************
*** 156,162 ****
                  "stack locals listing 0"
  
  # step until A, B, C, have some reasonable values.
! send_gdb "-exec-next 3\n"
  gdb_expect {
      -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"callee4\",args=\\\[\\\],file=\".*basics.c\",line=\"13\"\}\r\n$mi_gdb_prompt$" {
  	pass "next's in callee4"
--- 156,162 ----
                  "stack locals listing 0"
  
  # step until A, B, C, have some reasonable values.
! send_gdb "-exec-next 4\n"
  gdb_expect {
      -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"callee4\",args=\\\[\\\],file=\".*basics.c\",line=\"13\"\}\r\n$mi_gdb_prompt$" {
  	pass "next's in callee4"
***************
*** 168,173 ****
--- 168,177 ----
  	    "232\\^done,locals=\\\[\{name=\"A\",value=\"1\"\},\{name=\"B\",value=\"2\"\},\{name=\"C\",value=\"3\"\}\\\]" \
                  "stack locals listing 1"
  
+     mi_gdb_test "232-stack-list-locals 2" \
+ 	    "232\\^done,locals=\\\[\{name=\"A\",type=\"int\",value=\"1\"\},\{name=\"B\",type=\"int\",value=\"2\"\},\{name=\"C\",type=\"int\",value=\"3\"\}\\\]" \
+                 "stack locals listing 2"
+ 
      mi_gdb_test "234-stack-list-locals" \
  	    "234\\^error,msg=\"mi_cmd_stack_list_locals: Usage.*PRINT_VALUES.*\"" \
  	    "stack locals listing wrong"


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

end of thread, other threads:[~2004-01-07 23:47 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-01-07 21:06 [PATCH: gdb/mi] -stack-list-locals testcase Michael Elizabeth Chastain
2004-01-07 23:47 ` Nick Roberts
  -- strict thread matches above, loose matches on Subject: below --
2004-01-06  1:12 Michael Elizabeth Chastain
2003-11-23  0:16 RFC (gdb/mi): -stack-list-locals Nick Roberts
2003-11-26  0:48 ` Andrew Cagney
2003-12-02  3:14   ` RFC (gdb/mi): -stack-list-locals + PATCH Nick Roberts
2003-12-09  2:42     ` RFC (gdb/mi): -stack-list-locals + REVISED PATCH Nick Roberts
2003-12-10 17:56       ` Andrew Cagney
2003-12-12 20:51         ` RFC (gdb/mi): -stack-list-locals Nick Roberts
2003-12-12 21:09           ` David Carlton
2003-12-17  2:29             ` [PATCH: gdb/mi + doco] -stack-list-locals and -var-list-children Nick Roberts
2004-01-05 21:43               ` Andrew Cagney
2004-01-06  0:14                 ` [PATCH: gdb/mi] -stack-list-locals testcase Nick Roberts
2004-01-06  1:07                   ` Andrew Cagney
2004-01-07 16:31                     ` Andrew Cagney
2004-01-07 17:34                       ` Mark Kettenis
2004-01-07 17:40                         ` Daniel Jacobowitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox