]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
[gdb/testsuite] Complete 64-bit port of gdb.dwarf2/dw2-skip-prologue.exp
authorTom de Vries <tdevries@suse.de>
Sat, 23 May 2026 08:16:57 +0000 (10:16 +0200)
committerTom de Vries <tdevries@suse.de>
Sat, 23 May 2026 08:16:57 +0000 (10:16 +0200)
Test-source gdb.dwarf2/dw2-skip-prologue.S was generated using 32-bit, and
subsequently ported to 64-bit using macro PTRBYTE.

When using 64-bit, there are some readelf -w warnings because the port to
64-bit is not complete.  Fix these warnings.

Likewise in gdb.dwarf/dw2-const.exp.

Approved-By: Tom Tromey <tom@tromey.com>
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=34157

gdb/testsuite/gdb.dwarf2/dw2-const.S
gdb/testsuite/gdb.dwarf2/dw2-const.exp
gdb/testsuite/gdb.dwarf2/dw2-skip-prologue.S

index 94cf1acbed60cfc41d996190cd2c5b9bd93dda24..1161633f1818c2df2e872799a27e56331fa9c460 100644 (file)
    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 PTRBITS == 64
+# define PTRBYTE .8byte
+# define PTRBYTES 8
+#elif PTRBITS == 32
+# define PTRBYTE .4byte
+# define PTRBYTES 4
+#else
+# error "Unsupported pointer size"
+#endif
+
 /* Dummy function to provide debug information for.  */
 
        .text
@@ -228,9 +238,9 @@ func_cu1:
 
 .Lline1_lines:
        .byte           0       /* DW_LNE_set_address */
-       .uleb128        5
+       .uleb128        1 + PTRBYTES
        .byte           2
-       .4byte          .Lbegin_func_cu1
+       PTRBYTE         .Lbegin_func_cu1
 
        .byte           3       /* DW_LNS_advance_line */
        .sleb128        3       /* ... to 4 */
@@ -240,9 +250,9 @@ func_cu1:
        .byte           1       /* DW_LNS_copy (second time as an end-of-prologue marker) */
 
        .byte           0       /* DW_LNE_set_address */
-       .uleb128        5
+       .uleb128        1 + PTRBYTES
        .byte           2
-       .4byte          .Lend_func_cu1
+       PTRBYTE         .Lend_func_cu1
 
        .byte           0       /* DW_LNE_end_of_sequence */
        .uleb128        1
index 93ddfaa0f2ff20ed3727d57e3c54c95ebae0de3a..f855659f8bdfcbb126a013e013e6254dc985cea9 100644 (file)
@@ -19,8 +19,18 @@ require dwarf2_support
 
 standard_testfile .S
 
+if {[is_ilp32_target]} {
+    set ptrbits 32
+} else {
+    set ptrbits 64
+}
+
+set srcfile_opts {}
+lappend srcfile_opts nodebug
+lappend srcfile_opts additional_flags=-DPTRBITS=$ptrbits
+
 if {[prepare_for_testing_full "failed to prepare" \
-        [list $testfile debug main.c debug $srcfile nodebug]]} {
+        [list $testfile debug main.c debug  $srcfile $srcfile_opts]]} {
     return
 }
 
index 19165a513a4b1afcd913838f87b770530b80e08f..11d794bc412329092692e3eb889a6bc9e3f16136 100644 (file)
 
 #if PTRBITS == 64
 # define PTRBYTE .8byte
+# define PTRBYTES 8
 #elif PTRBITS == 32
 # define PTRBYTE .4byte
+# define PTRBYTES 4
 #else
 # error "Unsupported pointer size"
 #endif
@@ -130,7 +132,7 @@ loclist:
 1:     .byte           0x50    /* DW_OP_reg0 */
 2:
        /* Location list end.  */
-       .4byte  0, 0
+       PTRBYTE         0, 0
 
 /* Abbrev table */
        .section .debug_abbrev
@@ -283,7 +285,7 @@ loclist:
 
 .Lline1_lines:
        .byte           0       /* DW_LNE_set_address */
-       .uleb128        5
+       .uleb128        1 + PTRBYTES
        .byte           2
        PTRBYTE         func_start
        .byte           3       /* DW_LNS_advance_line */
@@ -291,7 +293,7 @@ loclist:
        .byte           1       /* DW_LNS_copy */
 
        .byte           0       /* DW_LNE_set_address */
-       .uleb128        5
+       .uleb128        1 + PTRBYTES
        .byte           2
        PTRBYTE         func0
        .byte           4       /* DW_LNS_set_file */
@@ -301,7 +303,7 @@ loclist:
        .byte           1       /* DW_LNS_copy */
 
        .byte           0       /* DW_LNE_set_address */
-       .uleb128        5
+       .uleb128        1 + PTRBYTES
        .byte           2
        PTRBYTE         func1
        .byte           4       /* DW_LNS_set_file */
@@ -311,7 +313,7 @@ loclist:
        .byte           1       /* DW_LNS_copy */
 
        .byte           0       /* DW_LNE_set_address */
-       .uleb128        5
+       .uleb128        1 + PTRBYTES
        .byte           2
        PTRBYTE         func2
        .byte           4       /* DW_LNS_set_file */
@@ -321,7 +323,7 @@ loclist:
        .byte           1       /* DW_LNS_copy */
 
        .byte           0       /* DW_LNE_set_address */
-       .uleb128        5
+       .uleb128        1 + PTRBYTES
        .byte           2
        PTRBYTE         func3
        .byte           4       /* DW_LNS_set_file */
@@ -331,14 +333,14 @@ loclist:
        .byte           1       /* DW_LNS_copy */
 
        .byte           0       /* DW_LNE_set_address */
-       .uleb128        5
+       .uleb128        1 + PTRBYTES
        .byte           2
        PTRBYTE         func_end
 
 /* Equivalent copy but renamed s/func/fund/.  */
 
        .byte           0       /* DW_LNE_set_address */
-       .uleb128        5
+       .uleb128        1 + PTRBYTES
        .byte           2
        PTRBYTE         fund_start
        .byte           3       /* DW_LNS_advance_line */
@@ -346,7 +348,7 @@ loclist:
        .byte           1       /* DW_LNS_copy */
 
        .byte           0       /* DW_LNE_set_address */
-       .uleb128        5
+       .uleb128        1 + PTRBYTES
        .byte           2
        PTRBYTE         fund0
        .byte           4       /* DW_LNS_set_file */
@@ -356,7 +358,7 @@ loclist:
        .byte           1       /* DW_LNS_copy */
 
        .byte           0       /* DW_LNE_set_address */
-       .uleb128        5
+       .uleb128        1 + PTRBYTES
        .byte           2
        PTRBYTE         fund1
        .byte           4       /* DW_LNS_set_file */
@@ -366,7 +368,7 @@ loclist:
        .byte           1       /* DW_LNS_copy */
 
        .byte           0       /* DW_LNE_set_address */
-       .uleb128        5
+       .uleb128        1 + PTRBYTES
        .byte           2
        PTRBYTE         fund2
        .byte           4       /* DW_LNS_set_file */
@@ -376,7 +378,7 @@ loclist:
        .byte           1       /* DW_LNS_copy */
 
        .byte           0       /* DW_LNE_set_address */
-       .uleb128        5
+       .uleb128        1 + PTRBYTES
        .byte           2
        PTRBYTE         fund3
        .byte           4       /* DW_LNS_set_file */
@@ -386,7 +388,7 @@ loclist:
        .byte           1       /* DW_LNS_copy */
 
        .byte           0       /* DW_LNE_set_address */
-       .uleb128        5
+       .uleb128        1 + PTRBYTES
        .byte           2
        PTRBYTE         fund_end