[gdb/testsuite] Fix g0 search in gdb.arch/i386-sse-stack-align.exp

When running test-case gdb.arch/i386-sse-stack-align.exp on target board
unix/-m32, I run into:
...
(gdb) print (int) g0 ()^M
Invalid data type for function to be called.^M
(gdb) FAIL: gdb.arch/i386-sse-stack-align.exp: print (int) g0 ()
...

Gdb is supposed to use minimal symbol g0:
...
$ nm i386-sse-stack-align | grep g0
08049194 t g0
...
but instead it finds a g0 symbol in the debug info of libm, specifically in
./sysdeps/ieee754/ldbl-96/e_lgammal_r.c.

Fix this by renaming g[0-4] to test_g[0-4].

Tested on x86_64-linux.

gdb/testsuite/ChangeLog:

2021-01-28  Tom de Vries  <tdevries@suse.de>

	* gdb.arch/i386-sse-stack-align.S: Rename g[0-4] to test_g[0-4].
	* gdb.arch/i386-sse-stack-align.c: Same.
	* gdb.arch/i386-sse-stack-align.exp: Same.
This commit is contained in:
Tom de Vries
2021-01-28 17:39:32 +01:00
parent 8ee511afd8
commit c47b145e1a
4 changed files with 34 additions and 27 deletions

View File

@ -1,3 +1,9 @@
2021-01-28 Tom de Vries <tdevries@suse.de>
* gdb.arch/i386-sse-stack-align.S: Rename g[0-4] to test_g[0-4].
* gdb.arch/i386-sse-stack-align.c: Same.
* gdb.arch/i386-sse-stack-align.exp: Same.
2021-01-28 Andrew Burgess <andrew.burgess@embecosm.com> 2021-01-28 Andrew Burgess <andrew.burgess@embecosm.com>
* lib/gdb.exp (default_gdb_init): Unset XDG_CONFIG_HOME. * lib/gdb.exp (default_gdb_init): Unset XDG_CONFIG_HOME.

View File

@ -70,8 +70,8 @@ f:
.cfi_endproc .cfi_endproc
.LFE1: .LFE1:
.size f, .-f .size f, .-f
.type g0, @function .type test_g0, @function
g0: test_g0:
.LFB2: .LFB2:
.cfi_startproc .cfi_startproc
pushl %ebp pushl %ebp
@ -87,9 +87,9 @@ g0:
ret ret
.cfi_endproc .cfi_endproc
.LFE2: .LFE2:
.size g0, .-g0 .size test_g0, .-test_g0
.type g1, @function .type test_g1, @function
g1: test_g1:
.LFB3: .LFB3:
.cfi_startproc .cfi_startproc
pushl %ebp pushl %ebp
@ -105,9 +105,9 @@ g1:
ret ret
.cfi_endproc .cfi_endproc
.LFE3: .LFE3:
.size g1, .-g1 .size test_g1, .-test_g1
.type g2, @function .type test_g2, @function
g2: test_g2:
.LFB4: .LFB4:
.cfi_startproc .cfi_startproc
pushl %ebp pushl %ebp
@ -123,9 +123,9 @@ g2:
ret ret
.cfi_endproc .cfi_endproc
.LFE4: .LFE4:
.size g2, .-g2 .size test_g2, .-test_g2
.type g3, @function .type test_g3, @function
g3: test_g3:
.LFB5: .LFB5:
.cfi_startproc .cfi_startproc
pushl %ebp pushl %ebp
@ -141,9 +141,9 @@ g3:
ret ret
.cfi_endproc .cfi_endproc
.LFE5: .LFE5:
.size g3, .-g3 .size test_g3, .-test_g3
.type g4, @function .type test_g4, @function
g4: test_g4:
.LFB6: .LFB6:
.cfi_startproc .cfi_startproc
pushl %ebp pushl %ebp
@ -159,7 +159,7 @@ g4:
ret ret
.cfi_endproc .cfi_endproc
.LFE6: .LFE6:
.size g4, .-g4 .size test_g4, .-test_g4
.globl main .globl main
.type main, @function .type main, @function
main: main:
@ -174,25 +174,25 @@ main:
andl $-16, %esp andl $-16, %esp
subl $16, %esp subl $16, %esp
.cfi_offset 3, -12 .cfi_offset 3, -12
call g0 call test_g0
movl %eax, %ebx movl %eax, %ebx
movl $1, (%esp) movl $1, (%esp)
call g1 call test_g1
addl %eax, %ebx addl %eax, %ebx
movl $2, 4(%esp) movl $2, 4(%esp)
movl $1, (%esp) movl $1, (%esp)
call g2 call test_g2
addl %eax, %ebx addl %eax, %ebx
movl $3, 8(%esp) movl $3, 8(%esp)
movl $2, 4(%esp) movl $2, 4(%esp)
movl $1, (%esp) movl $1, (%esp)
call g3 call test_g3
addl %eax, %ebx addl %eax, %ebx
movl $4, 12(%esp) movl $4, 12(%esp)
movl $3, 8(%esp) movl $3, 8(%esp)
movl $2, 4(%esp) movl $2, 4(%esp)
movl $1, (%esp) movl $1, (%esp)
call g4 call test_g4
addl %ebx, %eax addl %ebx, %eax
movl -4(%ebp), %ebx movl -4(%ebp), %ebx
leave leave

View File

@ -34,31 +34,31 @@ f (void)
} }
static __attribute__((noinline, noclone)) int static __attribute__((noinline, noclone)) int
g0 (void) test_g0 (void)
{ {
return f (); return f ();
} }
static __attribute__((noinline, noclone)) int static __attribute__((noinline, noclone)) int
g1 (int p1) test_g1 (int p1)
{ {
return f (); return f ();
} }
static __attribute__((noinline, noclone)) int static __attribute__((noinline, noclone)) int
g2 (int p1, int p2) test_g2 (int p1, int p2)
{ {
return f (); return f ();
} }
static __attribute__((noinline, noclone)) int static __attribute__((noinline, noclone)) int
g3 (int p1, int p2, int p3) test_g3 (int p1, int p2, int p3)
{ {
return f (); return f ();
} }
static __attribute__((noinline, noclone)) int static __attribute__((noinline, noclone)) int
g4 (int p1, int p2, int p3, int p4) test_g4 (int p1, int p2, int p3, int p4)
{ {
return f (); return f ();
} }
@ -66,5 +66,6 @@ g4 (int p1, int p2, int p3, int p4)
int int
main (void) main (void)
{ {
return g0 () + g1 (1) + g2 (1, 2) + g3 (1, 2, 3) + g4 (1, 2, 3, 4); return (test_g0 () + test_g1 (1) + test_g2 (1, 2) + test_g3 (1, 2, 3)
+ test_g4 (1, 2, 3, 4);
} }

View File

@ -43,7 +43,7 @@ if ![runto_main] then {
set args "" set args ""
foreach i {0 1 2 3 4} { foreach i {0 1 2 3 4} {
set test "print (int) g$i ($args)" set test "print (int) test_g$i ($args)"
gdb_test_multiple $test $test { gdb_test_multiple $test $test {
-re " = 2\r\n$gdb_prompt $" { -re " = 2\r\n$gdb_prompt $" {
pass $test pass $test