* [PATCH 0/4] [gdb/testsuite] Test-case fixes with local-remote-board
@ 2022-10-18 13:33 Tom de Vries
2022-10-18 13:33 ` [PATCH 1/4] [gdb/testsuite] Fix gdb.server/file-transfer.exp with local-remote-host.exp Tom de Vries
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: Tom de Vries @ 2022-10-18 13:33 UTC (permalink / raw)
To: gdb-patches
Fix some test-case fails with host board local-remote-board.exp, some
without and some with the tentative fix for PR29697: Removing procs
${board}_file and ${board}_download from local-remote-board.exp.
Tom de Vries (4):
[gdb/testsuite] Fix gdb.server/file-transfer.exp with
local-remote-host.exp
[gdb/testsuite] Fix gdb.base/return-nodebug.exp with
local-remote-host.exp
[gdb/testsuite] Fix gdb.server/no-thread-db.exp with
local-remote-host.exp
[gdb/testsuite] Handle header files with local-remote-host.exp
gdb/testsuite/gdb.base/included.exp | 6 +++++-
gdb/testsuite/gdb.base/large-frame.exp | 4 ++++
gdb/testsuite/gdb.base/line-symtabs.exp | 4 ++++
gdb/testsuite/gdb.base/return-nodebug.c | 8 ++++++++
gdb/testsuite/gdb.base/return-nodebug.exp | 18 ++++++++++++------
gdb/testsuite/gdb.base/return-nodebug1.c | 8 ++++++++
gdb/testsuite/gdb.base/sep.exp | 4 ++++
gdb/testsuite/gdb.base/shlib-call.exp | 4 ++++
gdb/testsuite/gdb.server/file-transfer.exp | 8 ++++++--
gdb/testsuite/gdb.server/no-thread-db.exp | 3 ++-
10 files changed, 57 insertions(+), 10 deletions(-)
base-commit: 53273099b81ab4bd137efdb9f038e5bf4b5be9bc
--
2.35.3
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/4] [gdb/testsuite] Fix gdb.server/file-transfer.exp with local-remote-host.exp
2022-10-18 13:33 [PATCH 0/4] [gdb/testsuite] Test-case fixes with local-remote-board Tom de Vries
@ 2022-10-18 13:33 ` Tom de Vries
2022-10-18 13:33 ` [PATCH 2/4] [gdb/testsuite] Fix gdb.base/return-nodebug.exp " Tom de Vries
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Tom de Vries @ 2022-10-18 13:33 UTC (permalink / raw)
To: gdb-patches
When running test-case gdb.server/file-transfer.exp with host
board local-remote-host.exp, I get:
...
Executing on host: cmp -s $outputs/gdb.server/file-transfer/file-transfer \
down-server (timeout = 300)
builtin_spawn [open ...]^M
XYZ2ZYX
FAIL: gdb.server/file-transfer.exp: compare intermediate binary file
...
The remote host and remote target cases are handled here together here in proc
test_file_transfer:
...
if {![is_remote host] && ![is_remote target]} {
set up_server [standard_output_file $up_server]
set down_server [standard_output_file $down_server]
}
...
Fix this by handling them separately.
Tested on x86_64-linux.
---
gdb/testsuite/gdb.server/file-transfer.exp | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/gdb/testsuite/gdb.server/file-transfer.exp b/gdb/testsuite/gdb.server/file-transfer.exp
index 80d61a0f506..310effd44b6 100644
--- a/gdb/testsuite/gdb.server/file-transfer.exp
+++ b/gdb/testsuite/gdb.server/file-transfer.exp
@@ -37,11 +37,15 @@ gdbserver_run ""
proc test_file_transfer { filename description } {
set up_server up-server
set down_server down-server
- if {![is_remote host] && ![is_remote target]} {
- set up_server [standard_output_file $up_server]
+
+ if {![is_remote target]} {
set down_server [standard_output_file $down_server]
}
+ if {![is_remote host]} {
+ set up_server [standard_output_file $up_server]
+ }
+
gdb_test "remote put \"$filename\" $down_server" \
"Successfully sent .*" "put $description"
gdb_test "remote get $down_server $up_server" \
--
2.35.3
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 2/4] [gdb/testsuite] Fix gdb.base/return-nodebug.exp with local-remote-host.exp
2022-10-18 13:33 [PATCH 0/4] [gdb/testsuite] Test-case fixes with local-remote-board Tom de Vries
2022-10-18 13:33 ` [PATCH 1/4] [gdb/testsuite] Fix gdb.server/file-transfer.exp with local-remote-host.exp Tom de Vries
@ 2022-10-18 13:33 ` Tom de Vries
2022-10-18 13:33 ` [PATCH 3/4] [gdb/testsuite] Fix gdb.server/no-thread-db.exp " Tom de Vries
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Tom de Vries @ 2022-10-18 13:33 UTC (permalink / raw)
To: gdb-patches
With host board local-remote-host.exp and test-case
gdb.base/return-nodebug.exp, I run into:
...
Executing on host: gcc -fno-stack-protector -fdiagnostics-color=never \
-DTYPE=signed\ char -c -g -o return-nodebug-signed-char0.o \
/home/vries/gdb_versions/devel/src/gdb/testsuite/gdb.base/return-nodebug.c \
(timeout = 300)
builtin_spawn [open ...]^M
gcc: error: char: No such file or directory
...
Avoid the quoting problem by not using spaces in the define.
Tested on x86_64-linux.
---
gdb/testsuite/gdb.base/return-nodebug.c | 8 ++++++++
gdb/testsuite/gdb.base/return-nodebug.exp | 18 ++++++++++++------
gdb/testsuite/gdb.base/return-nodebug1.c | 8 ++++++++
3 files changed, 28 insertions(+), 6 deletions(-)
diff --git a/gdb/testsuite/gdb.base/return-nodebug.c b/gdb/testsuite/gdb.base/return-nodebug.c
index a5ec060207a..358323aa2dd 100644
--- a/gdb/testsuite/gdb.base/return-nodebug.c
+++ b/gdb/testsuite/gdb.base/return-nodebug.c
@@ -15,6 +15,14 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+#ifdef TYPE_NOSPACE_long_long
+#define TYPE long long
+#elif defined TYPE_NOSPACE_signed_char
+#define TYPE signed char
+#else
+#define TYPE TYPE_NOSPACE
+#endif
+
extern TYPE func (void);
static void
diff --git a/gdb/testsuite/gdb.base/return-nodebug.exp b/gdb/testsuite/gdb.base/return-nodebug.exp
index 1cce09d2fc4..331375d89f8 100644
--- a/gdb/testsuite/gdb.base/return-nodebug.exp
+++ b/gdb/testsuite/gdb.base/return-nodebug.exp
@@ -52,17 +52,23 @@ foreach type {{signed char} {short} {int} {long} {long long} {float} {double}} {
if { $skip_float_test && ($type == "float" || $type == "double") } {
continue
}
- set typeesc [string map {{ } {\ }} $type]
- set typenospace [string map {{ } -} $type]
+ set typenospace_dash \
+ [string map {{ } -} $type]
+ set typenospace_underscore \
+ [string map {{ } _} $type]
standard_testfile .c return-nodebug1.c
- set additional_flags "additional_flags=-DTYPE=$typeesc"
+ set additional_flags {}
+ lappend additional_flags \
+ additional_flags=-DTYPE_NOSPACE=$typenospace_underscore
+ lappend additional_flags \
+ additional_flags=-DTYPE_NOSPACE_$typenospace_underscore
if {[prepare_for_testing_full "failed to prepare" \
- [list ${testfile}-${typenospace} debug \
- $srcfile [list debug $additional_flags] \
- $srcfile2 [list $additional_flags]]]} {
+ [list ${testfile}-${typenospace_dash} debug \
+ $srcfile [concat {debug} $additional_flags] \
+ $srcfile2 $additional_flags]]} {
continue
}
diff --git a/gdb/testsuite/gdb.base/return-nodebug1.c b/gdb/testsuite/gdb.base/return-nodebug1.c
index bd32fc45d74..f2269e0dd2f 100644
--- a/gdb/testsuite/gdb.base/return-nodebug1.c
+++ b/gdb/testsuite/gdb.base/return-nodebug1.c
@@ -15,6 +15,14 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+#ifdef TYPE_NOSPACE_long_long
+#define TYPE long long
+#elif defined TYPE_NOSPACE_signed_char
+#define TYPE signed char
+#else
+#define TYPE TYPE_NOSPACE
+#endif
+
TYPE
func (void)
{
--
2.35.3
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 3/4] [gdb/testsuite] Fix gdb.server/no-thread-db.exp with local-remote-host.exp
2022-10-18 13:33 [PATCH 0/4] [gdb/testsuite] Test-case fixes with local-remote-board Tom de Vries
2022-10-18 13:33 ` [PATCH 1/4] [gdb/testsuite] Fix gdb.server/file-transfer.exp with local-remote-host.exp Tom de Vries
2022-10-18 13:33 ` [PATCH 2/4] [gdb/testsuite] Fix gdb.base/return-nodebug.exp " Tom de Vries
@ 2022-10-18 13:33 ` Tom de Vries
2022-10-18 13:33 ` [PATCH 4/4] [gdb/testsuite] Handle header files " Tom de Vries
2022-10-18 13:36 ` [pushed 0/4] [gdb/testsuite] Test-case fixes with local-remote-board Tom de Vries
4 siblings, 0 replies; 6+ messages in thread
From: Tom de Vries @ 2022-10-18 13:33 UTC (permalink / raw)
To: gdb-patches
With test-case gdb.server/no-thread-db.exp and host board local-remote-host.exp
with a tentative fix for PR29697 I run into:
...
(gdb) print foo^M
Cannot find thread-local storage for Thread 29613.29613, executable file \
$HOME/no-thread-db:^M
Remote target failed to process qGetTLSAddr request^M
(gdb) FAIL: gdb.server/no-thread-db.exp: print foo
...
The regexp in the test-case expects the full $binfile pathname, but we have
instead $HOME/no-thread-db.
Fix this by making the regexp less strict.
Tested on x86_64-linux.
---
gdb/testsuite/gdb.server/no-thread-db.exp | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/gdb/testsuite/gdb.server/no-thread-db.exp b/gdb/testsuite/gdb.server/no-thread-db.exp
index db61c61ccbc..16c1a0d9ca1 100644
--- a/gdb/testsuite/gdb.server/no-thread-db.exp
+++ b/gdb/testsuite/gdb.server/no-thread-db.exp
@@ -59,5 +59,6 @@ gdb_breakpoint ${srcfile}:[gdb_get_line_number "after tls assignment"]
gdb_continue_to_breakpoint "after tls assignment"
# Printing a tls variable should fail gracefully without a libthread_db.
+set re_exec "\[^\r\n\]*[file tail $binfile]"
gdb_test "print foo" \
- "Cannot find thread-local storage for Thread \[^,\]+, executable file ${binfile}:\[\r\n\]+Remote target failed to process qGetTLSAddr request"
+ "Cannot find thread-local storage for Thread \[^,\]+, executable file $re_exec:\[\r\n\]+Remote target failed to process qGetTLSAddr request"
--
2.35.3
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 4/4] [gdb/testsuite] Handle header files with local-remote-host.exp
2022-10-18 13:33 [PATCH 0/4] [gdb/testsuite] Test-case fixes with local-remote-board Tom de Vries
` (2 preceding siblings ...)
2022-10-18 13:33 ` [PATCH 3/4] [gdb/testsuite] Fix gdb.server/no-thread-db.exp " Tom de Vries
@ 2022-10-18 13:33 ` Tom de Vries
2022-10-18 13:36 ` [pushed 0/4] [gdb/testsuite] Test-case fixes with local-remote-board Tom de Vries
4 siblings, 0 replies; 6+ messages in thread
From: Tom de Vries @ 2022-10-18 13:33 UTC (permalink / raw)
To: gdb-patches
With test-case gdb.base/included.exp and host board local-remote-host.exp with
tentative fix for PR29697 I run into:
...
included.c:18:10: fatal error: included.h: No such file or directory
#include "included.h"
^~~~~~~~~~~~
compilation terminated.
...
Fix this by adding the missing gdb_remote_download calls.
Likewise in a few other test-cases.
Tested on x86_64-linux.
---
gdb/testsuite/gdb.base/included.exp | 6 +++++-
gdb/testsuite/gdb.base/large-frame.exp | 4 ++++
gdb/testsuite/gdb.base/line-symtabs.exp | 4 ++++
gdb/testsuite/gdb.base/sep.exp | 4 ++++
gdb/testsuite/gdb.base/shlib-call.exp | 4 ++++
5 files changed, 21 insertions(+), 1 deletion(-)
diff --git a/gdb/testsuite/gdb.base/included.exp b/gdb/testsuite/gdb.base/included.exp
index 336eb636ceb..a4e195b3dc1 100644
--- a/gdb/testsuite/gdb.base/included.exp
+++ b/gdb/testsuite/gdb.base/included.exp
@@ -13,6 +13,10 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
+if { [is_remote host] } {
+ gdb_remote_download host $srcdir/$subdir/included.h
+}
+
standard_testfile
if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
return -1
@@ -33,4 +37,4 @@ gdb_test "ptype integer" "type = int"
# We should report that integer comes from the header file.
if { $non_dwarf } { setup_xfail *-*-* }
-gdb_test "info variables integer" "\r\nFile \[^\r\n\]*/${subdir}/${testfile}.h:\r\n.*\tint integer;"
+gdb_test "info variables integer" "\r\nFile \[^\r\n\]*${testfile}.h:\r\n.*\tint integer;"
diff --git a/gdb/testsuite/gdb.base/large-frame.exp b/gdb/testsuite/gdb.base/large-frame.exp
index bb33dc8880e..b58a43f81a3 100644
--- a/gdb/testsuite/gdb.base/large-frame.exp
+++ b/gdb/testsuite/gdb.base/large-frame.exp
@@ -15,6 +15,10 @@
#
# This file is part of the gdb testsuite.
+if { [is_remote host] } {
+ gdb_remote_download host $srcdir/$subdir/large-frame.h
+}
+
# This test was added to test GDB's ability to backtrace over a large
# stack frame for which there is no debug information. This should
# test the non-DWARF stack unwinder.
diff --git a/gdb/testsuite/gdb.base/line-symtabs.exp b/gdb/testsuite/gdb.base/line-symtabs.exp
index aec2d5a8c0f..c5be941695b 100644
--- a/gdb/testsuite/gdb.base/line-symtabs.exp
+++ b/gdb/testsuite/gdb.base/line-symtabs.exp
@@ -16,6 +16,10 @@
standard_testfile .c line-symtabs.h
+if { [is_remote host] } {
+ gdb_remote_download host $srcdir/$subdir/$srcfile2
+}
+
if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
return -1
}
diff --git a/gdb/testsuite/gdb.base/sep.exp b/gdb/testsuite/gdb.base/sep.exp
index d8b9ef7d5df..52a62a252fc 100644
--- a/gdb/testsuite/gdb.base/sep.exp
+++ b/gdb/testsuite/gdb.base/sep.exp
@@ -13,6 +13,10 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
+if { [is_remote host] } {
+ gdb_remote_download host $srcdir/$subdir/sep-proc.c
+}
+
standard_testfile .c
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug nowarnings}] != "" } {
diff --git a/gdb/testsuite/gdb.base/shlib-call.exp b/gdb/testsuite/gdb.base/shlib-call.exp
index ceef308380e..c6925709676 100644
--- a/gdb/testsuite/gdb.base/shlib-call.exp
+++ b/gdb/testsuite/gdb.base/shlib-call.exp
@@ -33,6 +33,10 @@ if {[skip_shlib_tests]} {
return 0
}
+if { [is_remote host] } {
+ gdb_remote_download host $srcdir/$subdir/ss.h
+}
+
standard_testfile shmain.c shr1.c shr2.c
set srcfile ${srcdir}/${subdir}/${srcfile}
set lib1src ${srcdir}/${subdir}/${srcfile2}
--
2.35.3
^ permalink raw reply [flat|nested] 6+ messages in thread
* [pushed 0/4] [gdb/testsuite] Test-case fixes with local-remote-board
2022-10-18 13:33 [PATCH 0/4] [gdb/testsuite] Test-case fixes with local-remote-board Tom de Vries
` (3 preceding siblings ...)
2022-10-18 13:33 ` [PATCH 4/4] [gdb/testsuite] Handle header files " Tom de Vries
@ 2022-10-18 13:36 ` Tom de Vries
4 siblings, 0 replies; 6+ messages in thread
From: Tom de Vries @ 2022-10-18 13:36 UTC (permalink / raw)
To: gdb-patches
On 10/18/22 15:33, Tom de Vries via Gdb-patches wrote:
> Fix some test-case fails with host board local-remote-board.exp, some
> without and some with the tentative fix for PR29697: Removing procs
> ${board}_file and ${board}_download from local-remote-board.exp.
And forgot to mention: committed.
Thanks,
- Tom
> Tom de Vries (4):
> [gdb/testsuite] Fix gdb.server/file-transfer.exp with
> local-remote-host.exp
> [gdb/testsuite] Fix gdb.base/return-nodebug.exp with
> local-remote-host.exp
> [gdb/testsuite] Fix gdb.server/no-thread-db.exp with
> local-remote-host.exp
> [gdb/testsuite] Handle header files with local-remote-host.exp
>
> gdb/testsuite/gdb.base/included.exp | 6 +++++-
> gdb/testsuite/gdb.base/large-frame.exp | 4 ++++
> gdb/testsuite/gdb.base/line-symtabs.exp | 4 ++++
> gdb/testsuite/gdb.base/return-nodebug.c | 8 ++++++++
> gdb/testsuite/gdb.base/return-nodebug.exp | 18 ++++++++++++------
> gdb/testsuite/gdb.base/return-nodebug1.c | 8 ++++++++
> gdb/testsuite/gdb.base/sep.exp | 4 ++++
> gdb/testsuite/gdb.base/shlib-call.exp | 4 ++++
> gdb/testsuite/gdb.server/file-transfer.exp | 8 ++++++--
> gdb/testsuite/gdb.server/no-thread-db.exp | 3 ++-
> 10 files changed, 57 insertions(+), 10 deletions(-)
>
>
> base-commit: 53273099b81ab4bd137efdb9f038e5bf4b5be9bc
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2022-10-18 13:36 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-18 13:33 [PATCH 0/4] [gdb/testsuite] Test-case fixes with local-remote-board Tom de Vries
2022-10-18 13:33 ` [PATCH 1/4] [gdb/testsuite] Fix gdb.server/file-transfer.exp with local-remote-host.exp Tom de Vries
2022-10-18 13:33 ` [PATCH 2/4] [gdb/testsuite] Fix gdb.base/return-nodebug.exp " Tom de Vries
2022-10-18 13:33 ` [PATCH 3/4] [gdb/testsuite] Fix gdb.server/no-thread-db.exp " Tom de Vries
2022-10-18 13:33 ` [PATCH 4/4] [gdb/testsuite] Handle header files " Tom de Vries
2022-10-18 13:36 ` [pushed 0/4] [gdb/testsuite] Test-case fixes with local-remote-board Tom de Vries
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).