[1/2] gdb: Minor cleanup in some gdb.arch/* tests
Commit Message
A small number of tests incorrectly tried to pass -Wa,-g through to
GCC as an extra compile time flag, either to gdb_compile or
prepare_for_testing.
There were two mistakes, first, the 'debug' flag was already being
passed, this will cause GCC to add a suitable -g flag, which should
then be propagated to the assembler. Secondly, in order to pass
additional compiler flags, the syntax would be
'additional_flags=-Wa,-g'. As it was, the flag was just being
ignored.
Given that all these tests pass 'debug', and the invalid flag has been
ignored for some time, I'm just removing the flags in this commit.
There should be no change in the test results after this commit.
gdb/testsuite/ChangeLog:
* gdb.arch/amd64-disp-step-avx.exp: Remove unneeded assembler
flag option, syntax was wrong anyway.
* gdb.arch/amd64-disp-step.exp: Likewise.
* gdb.arch/arm-disp-step.exp: Likewise.
* gdb.arch/i386-disp-step.exp: Likewise.
* gdb.arch/sparc64-regs.exp: Likewise.
---
gdb/testsuite/ChangeLog | 9 +++++++++
gdb/testsuite/gdb.arch/amd64-disp-step-avx.exp | 4 +---
gdb/testsuite/gdb.arch/amd64-disp-step.exp | 4 +---
gdb/testsuite/gdb.arch/arm-disp-step.exp | 4 +---
gdb/testsuite/gdb.arch/i386-disp-step.exp | 5 ++---
gdb/testsuite/gdb.arch/sparc64-regs.exp | 4 +---
6 files changed, 15 insertions(+), 15 deletions(-)
Comments
On 03/22/2018 12:57 PM, Andrew Burgess wrote:
> A small number of tests incorrectly tried to pass -Wa,-g through to
> GCC as an extra compile time flag, either to gdb_compile or
> prepare_for_testing.
>
> There were two mistakes, first, the 'debug' flag was already being
> passed, this will cause GCC to add a suitable -g flag, which should
> then be propagated to the assembler. Secondly, in order to pass
> additional compiler flags, the syntax would be
> 'additional_flags=-Wa,-g'. As it was, the flag was just being
> ignored.
>
> Given that all these tests pass 'debug', and the invalid flag has been
> ignored for some time, I'm just removing the flags in this commit.
>
> There should be no change in the test results after this commit.
OK.
> -
> if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} \
> - [list debug $additional_flags]] } {
> + [list debug]] } {
> return -1
Note you could make these {debug} instead now. "[list ...]" was only
necessary because of variable expansion. (Don't know whether that
shortens the lines enough to avoid wrapping). Actually, "debug" is
the default, so you could just remove them completely:
proc prepare_for_testing { testname executable {sources ""} {options {debug}}} {
Thanks,
Pedro Alves
@@ -25,10 +25,8 @@ if { ![istarget x86_64-*-* ] || ![is_lp64_target] } {
standard_testfile .S
-set additional_flags "-Wa,-g"
-
if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} \
- [list debug $additional_flags]] } {
+ [list debug]] } {
return -1
}
@@ -27,9 +27,7 @@ set newline "\[\r\n\]*"
standard_testfile .S
-set additional_flags "-Wa,-g"
-
-if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug $additional_flags]] != "" } {
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug]] != "" } {
untested "failed to compile"
return -1
}
@@ -24,9 +24,7 @@ if {![is_aarch32_target]} then {
standard_testfile .S
-set additional_flags "-Wa,-g"
-
-if { [prepare_for_testing "failed to prepare" $testfile $srcfile [list debug $additional_flags]] } {
+if { [prepare_for_testing "failed to prepare" $testfile $srcfile [list debug]] } {
return -1
}
@@ -25,9 +25,8 @@ if { ![is_x86_like_target] } then {
standard_testfile .S
-set additional_flags "-Wa,-g"
-
-if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug $additional_flags]] != "" } {
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" \
+ executable [list debug]] != "" } {
untested "failed to compile"
return -1
}
@@ -25,10 +25,8 @@ if ![istarget "sparc64*-*-linux*"] then {
standard_testfile .S
-set additional_flags "-Wa,-g"
-
if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} \
- [list debug $additional_flags]] } {
+ [list debug]] } {
return -1
}