Files
gdb/fix-gdb.dap-step-out.exp-on-s390x.patch
Tom de Vries f61a679e8e - Maintenance script qa.sh:
* Fix 16.0 handling.
- Patches added:
  * gdb-testsuite-fix-gdb.python-py-format-string.exp-wi.patch
  * gdb-testsuite-fix-gdb.python-py-mi-cmd.exp-with-pyth.patch
  * gdb-testsuite-fix-gdb.ada-mi_task_arg.exp-on-arm-lin.patch
  * gdb-testsuite-fix-regexp-in-gdb.ada-mi_var_access.ex.patch
  * gdb-testsuite-check-gnatmake-version-in-gdb.ada-scal.patch
  * gdb-testsuite-fix-gdb.arch-arm-pseudo-unwind.exp-wit.patch
  * gdb-symtab-fix-target-type-of-complex-long-double-on.patch
  * gdb-testsuite-don-t-use-set-auto-solib-add-off.patch
  * gdb-tdep-fix-arm-thumb2-hw-breakpoint.patch
  * gdb-testsuite-fix-gdb.cp-m-static.exp-on-arm.patch
  * gdb-testsuite-fix-gdb.dwarf2-dw2-fixed-point.exp-on-.patch
  * gdb-testsuite-fix-gdb.dwarf2-dw2-lines.exp-on-arm-li.patch
  * gdb-exp-fix-gdb.fortran-intrinsics.exp-fail-on-arm.patch
  * gdb-tdep-handle-sycall-statx-for-arm-linux.patch
  * gdb-tdep-fix-recording-of-t1-push.patch
  * gdb-tdep-handle-syscall-clock_gettime64-for-arm-linu.patch
  * fix-gdb.dwarf2-shortpiece.exp-on-s390x.patch
  * handle-address-class-annotation-for-s390x-in-some-te.patch
  * fix-gdb.dap-step-out.exp-on-s390x.patch
  * use-setvariable-in-gdb.dap-scopes.exp.patch
  * fix-gdb.base-finish-pretty.exp-on-s390x.patch
  * fix-gdb.base-readnever.exp-on-s390x.patch
  * add-dwarf_expr_piece.op.patch
  * add-gdbarch_dwarf2_reg_piece_offset-hook.patch
  * fix-gdb.base-store.exp-on-s390x.patch
  * fix-gdb.ada-o2_float_param.exp-on-s390x-linux.patch
  * gdb-testsuite-fix-gdb.base-branch-to-self.exp-on-arm.patch
  * gdb-tdep-fix-gdb.cp-non-trivial-retval.exp-on-riscv6.patch
  * gdb-testsuite-fix-gdb.cp-non-trivial-retval.exp-on-a.patch
  * gdb-testsuite-fix-gdb.rust-completion.exp-timeout-on.patch
  * gdb-testsuite-require-supports_process_record-in-gdb.patch
  * gdb-testsuite-fix-regexp-in-gdb.arch-i386-disp-step-.patch
  * gdb-testsuite-fix-gdb.arch-arm-single-step-kernel-he.patch
  * gdb-testsuite-fix-gdb.python-py-format-address.exp-o.patch
  * gdb-testsuite-fix-gdb.arch-riscv-tdesc-regs.exp.patch
  * gdb-testsuite-fix-gdb.base-list-dot-nodebug-and-make.patch
  * gdb-testsuite-fix-gdb.base-list-dot-nodebug.exp-on-o.patch
  * gdb-testsuite-fix-gdb.base-empty-host-env-vars.exp.patch
  * gdb-prune-inferior-after-switching-inferior.patch
  * gdb-testsuite-use-nostdlib-in-gdb.base-list-dot-node.patch
  * gdb-testsuite-fix-timeout-in-gdb.mi-mi-multi-command.patch
  * gdb-testsuite-require-can_spawn_for_attach-in-gdb.ba.patch
  * fixup-gdb-6.5-gcore-buffer-limit-test.patch
  * gdb-testsuite-fix-gdb.ada-big_packed_array.exp-on-s3.patch
  * gdb-testsuite-fix-gdb.ada-convvar_comp.exp-on-s390x-.patch
  * gdb-testsuite-fix-regexp-in-gdb.threads-stepi-over-c.patch

OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=437
2025-02-13 14:36:11 +00:00

98 lines
3.7 KiB
Diff

From 6775ce3f5e936a50d883abfb60cafa80f8b76cf6 Mon Sep 17 00:00:00 2001
From: Tom de Vries <tdevries@suse.de>
Date: Tue, 10 Dec 2024 11:53:31 +0100
Subject: [PATCH 19/46] Fix gdb.dap/step-out.exp on s390x
With test-case gdb.dap/step-out.exp on s390x-linux, I get:
...
>>> {"seq": 7, "type": "request", "command": "scopes", "arguments": {"frameId": 0}}
Content-Length: 569^M
^M
{"request_seq": 7, "type": "response", "command": "scopes", "body": {"scopes": [{"variablesReference": 1, "name": "Locals", "presentationHint": "locals", "expensive": false, "namedVariables": 1, "line": 35, "source": {"name": "step-out.c", "path": "/home/vries/gdb/src/gdb/testsuite/gdb.dap/step-out.c"}}, {"variablesReference": 2, "name": "Registers", "presentationHint": "registers", "expensive": false, "namedVariables": 114, "line": 35, "source": {"name": "step-out.c", "path": "/home/vries/gdb/src/gdb/testsuite/gdb.dap/step-out.c"}}]}, "success": true, "seq": 21}PASS: gdb.dap/step-out.exp: get scopes success
FAIL: gdb.dap/step-out.exp: three scopes
...
The problem is that the test-case expects three scopes:
...
lassign $scopes scope reg_scope return_scope
...
but the return_scope is missing because this doesn't work:
...
$ gdb -q -batch outputs/gdb.dap/step-out/step-out \
-ex "b function_breakpoint_here" \
-ex run \
-ex finish
...
Value returned has type: struct result. Cannot determine contents
...
This is likely caused by a problem in gdb, but there's nothing wrong the DAP
support.
Fix this by:
- allowing two scopes, and
- declaring the tests of return_scope unsupported.
Tested on s390x-linux.
Approved-By: Tom Tromey <tom@tromey.com>
---
gdb/testsuite/gdb.dap/step-out.exp | 42 ++++++++++++++++--------------
1 file changed, 23 insertions(+), 19 deletions(-)
diff --git a/gdb/testsuite/gdb.dap/step-out.exp b/gdb/testsuite/gdb.dap/step-out.exp
index 757f4ebdaca..491eaf71197 100644
--- a/gdb/testsuite/gdb.dap/step-out.exp
+++ b/gdb/testsuite/gdb.dap/step-out.exp
@@ -59,24 +59,28 @@ set scopes [dap_check_request_and_response "get scopes" scopes \
[format {o frameId [i %d]} $frame_id]]
set scopes [dict get [lindex $scopes 0] body scopes]
-gdb_assert {[llength $scopes] == 2} "two scopes"
-
-lassign $scopes scope reg_scope
-gdb_assert {[dict get $scope name] == "Locals"} "scope is locals"
-gdb_assert {[dict get $scope presentationHint] == "locals"} \
- "locals presentation hint"
-gdb_assert {[dict get $scope namedVariables] == 2} "two vars in scope"
-
-set num [dict get $scope variablesReference]
-set refs [lindex [dap_check_request_and_response "fetch arguments" \
- "variables" \
- [format {o variablesReference [i %d]} $num]] \
- 0]
-set varlist [lindex [dict get $refs body variables] 0]
-
-gdb_assert {[dict get $varlist variablesReference] > 0} \
- "variable has children"
-gdb_assert {[dict get $varlist name] == "(return)"} \
- "variable is return value"
+gdb_assert {[llength $scopes] == 2 || [llength $scopes] == 3} "two or three scopes"
+lassign $scopes scope reg_scope return_scope
+
+set test "scope is locals"
+if { $return_scope == "" } {
+ unsupported $test
+} else {
+ gdb_assert {[dict get $scope presentationHint] == "locals"} \
+ "locals presentation hint"
+ gdb_assert {[dict get $scope namedVariables] == 2} "two vars in scope"
+
+ set num [dict get $scope variablesReference]
+ set refs [lindex [dap_check_request_and_response "fetch arguments" \
+ "variables" \
+ [format {o variablesReference [i %d]} $num]] \
+ 0]
+ set varlist [lindex [dict get $refs body variables] 0]
+
+ gdb_assert {[dict get $varlist variablesReference] > 0} \
+ "variable has children"
+ gdb_assert {[dict get $varlist name] == "(return)"} \
+ "variable is return value"
+}
dap_shutdown
--
2.43.0