aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2020-12-08 09:29:40 +0100
committerTom de Vries <tdevries@suse.de>2020-12-08 09:29:40 +0100
commit8439f446a1f2cbb69bb09535e99d166f94a7fdb4 (patch)
treedae03b2e1667d58039fc7912aa46a3f35074a438 /gdb
parent28e36bf89069fbf630a5aaf1251d21ebd11b5f77 (diff)
downloadgdb-8439f446a1f2cbb69bb09535e99d166f94a7fdb4.zip
gdb-8439f446a1f2cbb69bb09535e99d166f94a7fdb4.tar.gz
gdb-8439f446a1f2cbb69bb09535e99d166f94a7fdb4.tar.bz2
[gdb/testsuite] Fix gdb.ada/mi_task_arg.exp for -m32
When running test-case gdb.ada/mi_task_arg.exp with target board unix/-m32, I run into: ... (gdb) ^M Expecting: ^(-stack-list-arguments 1[^M ]+)?(\^done,stack-args=\[ \ frame={level="0",args=\[\]}, \ frame={level="1",args=\[{name="<_task>",value="0x[0-9A-Fa-f]+"}\]}, \ frame={level="2",args=\[({name="self_id",value="0x[0-9A-Fa-f]+"})?\]},.*[^M ]+[(]gdb[)] ^M [ ]*) -stack-list-arguments 1^M ^done,stack-args=[ \ frame={level="0",args=[]}, \ frame={level="1",args=[{name="<_task>",value="0x808abf0"}]}, \ frame={level="2",args=[{name="self_id",value="<optimized out>"}]}, \ frame={level="3",args=[]},frame={level="4",args=[]}]^M (gdb) ^M FAIL: gdb.ada/mi_task_arg.exp: -stack-list-arguments 1 (unexpected output) ... The problem is that we're expecting a $hex for the value of self_id, but instead get <optimized out>. Looking at the debug info for self_id: ... <1><12a1f>: Abbrev Number: 84 (DW_TAG_subprogram) <12a20> DW_AT_name : system__tasking__stages__task_wrapper ... <2><12a35>: Abbrev Number: 61 (DW_TAG_formal_parameter) <12a36> DW_AT_name : self_id <12a40> DW_AT_location : 0x459e (location list) ... it refers to location information here: ... 0000459e 08053060 080531ac (DW_OP_fbreg: 0) 000045aa 0805327c 080532a5 (DW_OP_fbreg: 0) 000045b6 08053320 08053324 (DW_OP_fbreg: 0) ... while the pc used to retrieve the location information is 0x080531c5: ... $ gdb -batch outputs/gdb.ada/mi_task_arg/task_switch \ -ex "break 57" -ex run -ex bt ... #0 task_switch.break_me () at task_switch.adb:57 #1 0x0804aaae in task_switch.caller (<_task>=0x808abf0) \ at task_switch.adb:51 #2 0x080531c5 in system.tasking.stages.task_wrapper \ (self_id=<optimized out>) at s-tassta.adb:1295 ... which indeed falls outside of the ranges listed in the location info. Fix this by accepting <optimized out> as valid value of self_id. Tested on x86_64-linux. gdb/testsuite/ChangeLog: 2020-12-08 Tom de Vries <tdevries@suse.de> * gdb.ada/mi_task_arg.exp: Accept <optimized out> as valid value of self_id.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/testsuite/ChangeLog5
-rw-r--r--gdb/testsuite/gdb.ada/mi_task_arg.exp6
2 files changed, 9 insertions, 2 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 3b7deaf..2cf25a4 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2020-12-08 Tom de Vries <tdevries@suse.de>
+
+ * gdb.ada/mi_task_arg.exp: Accept <optimized out> as valid value of
+ self_id.
+
2020-12-07 Pedro Alves <pedro@palves.net>
* gdb.base/break-on-linker-gcd-function.exp: Remove unused
diff --git a/gdb/testsuite/gdb.ada/mi_task_arg.exp b/gdb/testsuite/gdb.ada/mi_task_arg.exp
index 2a4038d..ace808c 100644
--- a/gdb/testsuite/gdb.ada/mi_task_arg.exp
+++ b/gdb/testsuite/gdb.ada/mi_task_arg.exp
@@ -49,9 +49,11 @@ if ![mi_runto "task_switch.break_me"] then {
# Frame for task_switch.break_me
set frame0 "frame=\{level=\"0\",args=\\\[\\\]\}"
# Frame for task_switch.caller
-set frame1 "frame=\{level=\"1\",args=\\\[\{name=\"<_task>\",value=\"$hex\"\}\\\]\}"
+set frame1_args "\{name=\"<_task>\",value=\"$hex\"\}"
+set frame1 "frame=\{level=\"1\",args=\\\[$frame1_args\\\]\}"
# Frame for system.tasking.stages.task_wrapper
-set frame2 "frame=\{level=\"2\",args=\\\[(\{name=\"self_id\",value=\"$hex\"\})?\\\]\}"
+set frame2_args "(\{name=\"self_id\",value=\"($hex|<optimized out>)\"\})?"
+set frame2 "frame=\{level=\"2\",args=\\\[$frame2_args\\\]\}"
mi_gdb_test "-stack-list-arguments 1" \
"\\^done,stack-args=\\\[$frame0,$frame1,$frame2,.*" \
"-stack-list-arguments 1"