From fef8a650d0248ba4cb1ba7bd36ce099cd8169510 Mon Sep 17 00:00:00 2001 From: Daniel Jacobowitz Date: Mon, 1 Oct 2007 14:07:46 +0000 Subject: [PATCH] * gdb.mi/var-cmd.c (do_locals_tests): Define lcharacter as a two-char array. * gdb.mi/mi-var-cmd.exp, gdb.mi/mi2-var-cmd.exp: Use lcharacter[0]. --- gdb/testsuite/ChangeLog | 6 ++++++ gdb/testsuite/gdb.mi/mi-var-cmd.exp | 2 +- gdb/testsuite/gdb.mi/mi2-var-cmd.exp | 2 +- gdb/testsuite/gdb.mi/var-cmd.c | 10 +++++----- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index f4882ef7aa3..63d998dc1c2 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2007-10-01 Daniel Jacobowitz + + * gdb.mi/var-cmd.c (do_locals_tests): Define lcharacter as a + two-char array. + * gdb.mi/mi-var-cmd.exp, gdb.mi/mi2-var-cmd.exp: Use lcharacter[0]. + 2007-09-30 Daniel Jacobowitz * gdb.threads/watchthreads.c (thread_function): Sleep between diff --git a/gdb/testsuite/gdb.mi/mi-var-cmd.exp b/gdb/testsuite/gdb.mi/mi-var-cmd.exp index d33422272bd..f5102fb63a4 100644 --- a/gdb/testsuite/gdb.mi/mi-var-cmd.exp +++ b/gdb/testsuite/gdb.mi/mi-var-cmd.exp @@ -86,7 +86,7 @@ mi_gdb_test "-var-create lpinteger * lpinteger" \ "\\^done,name=\"lpinteger\",numchild=\"1\",value=\"$hex\",type=\"int \\*\"" \ "create local variable lpinteger" -mi_gdb_test "-var-create lcharacter * lcharacter" \ +mi_gdb_test "-var-create lcharacter * lcharacter\[0\]" \ "\\^done,name=\"lcharacter\",numchild=\"0\",value=\".*\",type=\"char\"" \ "create local variable lcharacter " diff --git a/gdb/testsuite/gdb.mi/mi2-var-cmd.exp b/gdb/testsuite/gdb.mi/mi2-var-cmd.exp index 474246506f6..bd721842cee 100644 --- a/gdb/testsuite/gdb.mi/mi2-var-cmd.exp +++ b/gdb/testsuite/gdb.mi/mi2-var-cmd.exp @@ -86,7 +86,7 @@ mi_gdb_test "-var-create lpinteger * lpinteger" \ "\\^done,name=\"lpinteger\",numchild=\"1\",value=\"$hex\",type=\"int \\*\"" \ "create local variable lpinteger" -mi_gdb_test "-var-create lcharacter * lcharacter" \ +mi_gdb_test "-var-create lcharacter * lcharacter\[0\]" \ "\\^done,name=\"lcharacter\",numchild=\"0\",value=\".*\",type=\"char\"" \ "create local variable lcharacter " diff --git a/gdb/testsuite/gdb.mi/var-cmd.c b/gdb/testsuite/gdb.mi/var-cmd.c index 60a5b7b3af7..e59d3982fa5 100644 --- a/gdb/testsuite/gdb.mi/var-cmd.c +++ b/gdb/testsuite/gdb.mi/var-cmd.c @@ -114,7 +114,7 @@ do_locals_tests () { int linteger = 0; int *lpinteger = 0; - char lcharacter = 0; + char lcharacter[2] = { 0, 0 }; char *lpcharacter = 0; long llong = 0; long *lplong = 0; @@ -129,8 +129,8 @@ do_locals_tests () /* Simple assignments */ linteger = 1234; lpinteger = &linteger; - lcharacter = 'a'; - lpcharacter = &lcharacter; + lcharacter[0] = 'a'; + lpcharacter = lcharacter; llong = 2121L; lplong = &llong; lfloat = 2.1; @@ -141,13 +141,13 @@ do_locals_tests () lsimple.unsigned_integer = 255; lsimple.character = 'a'; lsimple.signed_character = 21; - lsimple.char_ptr = &lcharacter; + lsimple.char_ptr = lcharacter; lpsimple = &lsimple; func = nothing; /* Check pointers */ linteger = 4321; - lcharacter = 'b'; + lcharacter[0] = 'b'; llong = 1212L; lfloat = 1.2; ldouble = 5.498548281828172; -- 2.30.2