]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
[gdb/testsuite] Fix gdb.tui/tui-layout-asm-short-prog.exp on cygwin
authorTom de Vries <tdevries@suse.de>
Wed, 24 Sep 2025 07:57:25 +0000 (09:57 +0200)
committerTom de Vries <tdevries@suse.de>
Wed, 24 Sep 2025 07:57:25 +0000 (09:57 +0200)
On x86_64-cygwin, I run into:
...
 Running tui-layout-asm-short-prog.exp ...
 gdb compile failed, tui-layout-asm-short-prog.S: Assembler messages:
 tui-layout-asm-short-prog.S:26: Error: \
   junk at end of line, first unrecognized character is `-'

                 === gdb Summary ===

 # of untested testcases         1
...

This is due to this note in gdb.tui/tui-layout-asm-short-prog.S:
...
        .section        .note.GNU-stack,"",@progbits
...

The note can be easily skipped for cygwin, but after doing so, we run into a
fail.

The problem is that while the test-case tries to generate 5 nops:
...
  .rept 5
  nop
  .endr
...
in fact 16 nops are generated.

The fail is not specific to x86_64-cygwin, if we do ".rept 16" on
x86_64-linux, we get the same fail.

Fix this by increasing the "large" scroll amounts from 13 to 15.

Tested on x86_64-cygwin and x86_64-linux.

gdb/testsuite/gdb.tui/tui-layout-asm-short-prog.S
gdb/testsuite/gdb.tui/tui-layout-asm-short-prog.exp

index 9d6923602f7f81fa9534a6f13f2bad4d6fb5495a..6e36152db988c06ccb4a928b2ddcfcd5e0a78e3c 100644 (file)
@@ -20,8 +20,11 @@ _start:
        .rept 5
        nop
        .endr
+
+#ifndef __CYGWIN__
 #ifdef __arm__
        .section        .note.GNU-stack,"",%progbits
 #else
        .section        .note.GNU-stack,"",@progbits
 #endif
+#endif
index 23adbb03bb54d32fd8317ba81185b880f71e7102..e21914b86b5efc31882c6aa70c2349fce6196ad4 100644 (file)
@@ -57,7 +57,7 @@ gdb_assert { [string match "|___0x*" $first_line] } \
 
 # Scroll forward a large amount, this should take us to the last
 # instruction in the program.
-Term::command "+ 13"
+Term::command "+ 15"
 Term::check_box_contents "check asm box contents again" 0 0 80 15 \
     [multi_line \
         "^___$hex\[^\r\n\]+" \
@@ -65,6 +65,6 @@ Term::check_box_contents "check asm box contents again" 0 0 80 15 \
 
 # Now scroll backward again, we should return to the start of the
 # program.
-Term::command "- 13"
+Term::command "- 15"
 gdb_assert {[string eq "$first_line" [Term::get_line 1]]} \
     "check first line is back"