[gdb/testsuite] Fix error message for cmd with trailing newline
authorTom de Vries <tdevries@suse.de>
Mon, 10 Oct 2022 12:44:40 +0000 (14:44 +0200)
committerTom de Vries <tdevries@suse.de>
Mon, 10 Oct 2022 12:44:40 +0000 (14:44 +0200)
commited6cd15957b80502410b771e080a88b2e4c949dd
tree1a13d3fffc9bfa1a726641cb7e5b3e2494d92cf6
parent66984afd29ea9bad2155ed21098437a71208a106
[gdb/testsuite] Fix error message for cmd with trailing newline

I noticed that the error message in gdb_test_multiple about trailing newline
in a command does not mention the offending command, nor the word command:
...
    if [string match "*\[\r\n\]" $command] {
        error "Invalid trailing newline in \"$message\" test"
    }
...

Fix this by using instead:
...
        error "Invalid trailing newline in \"$command\" command"
...

Also add a test-case to trigger this: gdb.testsuite/gdb-test.exp.

Tested on x86_64-linux.
gdb/testsuite/gdb.testsuite/gdb-test.exp [new file with mode: 0644]
gdb/testsuite/lib/gdb.exp