mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-12-09 04:21:49 +08:00
[gdb/testsuite] Detect change instead of init in gdb.mi/mi-var-block.exp
On openSUSE Tumbleweed with target board unix/-m32, I run into: ... PASS: gdb.mi/mi-var-block.exp: step at do_block_test 2 Expecting: ^(-var-update \*[^M ]+)?(\^done,changelist=\[{name="foo",in_scope="true",type_changed="false",has_more="0"}, {name="cb",in_scope="true",type_changed="false",has_more="0"}\][^M ]+[(]gdb[)] ^M [ ]*) -var-update *^M ^done,changelist=[{name="foo",in_scope="true",type_changed="false",has_more="0"}]^M (gdb) ^M FAIL: gdb.mi/mi-var-block.exp: update all vars: cb foo changed (unexpected output) ... The problem is that the test-case attempts to detect a change in the cb variable caused by this initialization: ... void do_block_tests () { int cb = 12; ... but that only works if the stack location happens to be unequal to 12 before the initialization. Fix this by first initializing to 0, and then changing the value to 12: ... - int cb = 12; + int cb = 0; + cb = 12; ... and detecting that change. Tested on x86_64-linux. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=29195
This commit is contained in:
parent
0c8cd1de90
commit
bb785a92a8
@ -40,6 +40,11 @@ mi_gdb_load ${binfile}
|
||||
|
||||
mi_runto do_block_tests
|
||||
|
||||
# step to "cb = 12;"
|
||||
mi_step_to "do_block_tests" "" "var-cmd.c" \
|
||||
[gdb_get_line_number "cb = 12;"] \
|
||||
"step at do_block_test 0"
|
||||
|
||||
# Test: c_variable-3.2
|
||||
# Desc: create cb and foo
|
||||
mi_create_varobj "cb" "cb" "create local variable cb"
|
||||
|
@ -207,7 +207,8 @@ subroutine1 (int i, long *l)
|
||||
void
|
||||
do_block_tests ()
|
||||
{
|
||||
int cb = 12;
|
||||
int cb = 0;
|
||||
cb = 12;
|
||||
|
||||
{
|
||||
int foo;
|
||||
|
Loading…
Reference in New Issue
Block a user