public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Andrew Burgess <aburgess@redhat.com>
To: gdb-patches@sourceware.org
Cc: Andrew Burgess <aburgess@redhat.com>
Subject: [PATCH] gdb/testsuite: handle long filenames in gdb.base/startup-with-shell.exp
Date: Wed, 17 Jan 2024 09:58:28 +0000	[thread overview]
Message-ID: <8be51f9325a83a446404cf595bbe60b330af79e0.1705485491.git.aburgess@redhat.com> (raw)

I got a report of a failure from Linaro's CI testing for the test
gdb.base/startup-with-shell.exp.

Looking at the log I see this:

  (gdb) PASS: gdb.base/startup-with-shell.exp: startup_with_shell = on; run_args = *.unique-extension: inferior started
  print argv[1]
  $1 = 0xfffed978 "/home/tcwg-build/workspace/tcwg_gnu_4/abe/builds/armv8l-unknown-linux-gnueabihf/armv8l-unknown-linux-gnueabihf/gdb-gdb.git~master/gdb/testsuite/outputs/gdb.base/startup-with-shell/unique-file.unique-e"...
  (gdb) FAIL: gdb.base/startup-with-shell.exp: startup_with_shell = on; run_args = *.unique-extension: first argument expanded

Notice that the value of $1 was truncated (indicated by the trailing
ellipses), and as a result it isn't going to match the expected output
pattern.

Avoid this by adding a call to 'set print characters unlimited' which
allows GDB to print strings of any length.
---
 gdb/testsuite/gdb.base/startup-with-shell.exp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gdb/testsuite/gdb.base/startup-with-shell.exp b/gdb/testsuite/gdb.base/startup-with-shell.exp
index b73d5d740f5..d5ec503dceb 100644
--- a/gdb/testsuite/gdb.base/startup-with-shell.exp
+++ b/gdb/testsuite/gdb.base/startup-with-shell.exp
@@ -59,6 +59,7 @@ proc initial_setup_simple { startup_with_shell run_args } {
 
 with_test_prefix "startup_with_shell = on; run_args = *.unique-extension" {
     initial_setup_simple "on" "$unique_file_dir/*.unique-extension"
+    gdb_test_no_output "set print characters unlimited"
     gdb_test "print argv\[1\]" "\\\$$decimal = $hex \"$unique_file\"" \
 	"first argument expanded"
 }

base-commit: 1b346e50485ee450e8103e4b1704b43f61bc39f7
-- 
2.25.4


             reply	other threads:[~2024-01-17  9:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-17  9:58 Andrew Burgess [this message]
2024-01-17 11:24 ` Tom de Vries
2024-01-17 15:32   ` Andrew Burgess
2024-01-17 16:01     ` Tom de Vries

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8be51f9325a83a446404cf595bbe60b330af79e0.1705485491.git.aburgess@redhat.com \
    --to=aburgess@redhat.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).