From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27897 invoked by alias); 16 Jan 2008 18:48:47 -0000 Received: (qmail 27883 invoked by uid 22791); 16 Jan 2008 18:48:46 -0000 X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 16 Jan 2008 18:48:07 +0000 Received: (qmail 3262 invoked from network); 16 Jan 2008 18:48:03 -0000 Received: from unknown (HELO ?192.168.65.128?) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 16 Jan 2008 18:48:03 -0000 Message-ID: <478E35B5.5060608@codesourcery.com> Date: Wed, 16 Jan 2008 18:48:00 -0000 From: Pedro Alves User-Agent: Thunderbird 2.0.0.6 (X11/20071022) MIME-Version: 1.0 To: Nick Roberts , gdb-patches@sourceware.org Subject: Re: mi-var-child failures Content-Type: multipart/mixed; boundary="------------090606040102010307050001" Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-01/txt/msg00410.txt.bz2 This is a multi-part message in MIME format. --------------090606040102010307050001 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 466 [moving to gdb-patches] Nick wrote: >Vladimir wrote: >> This is not a problem with GDB -- it's acting right, so FAIL on embedded >> target is not indicative of a problem. I think we get to fix the testcase >> itself. >> >> Mind if I make the pointer point to valid memory on all systems? > >That seems sensible to me. Here is a patch to do that. Tested on i686-pc-linux-gnu, no changes; and arm-none-eabi, where it removes the failures. OK? -- Pedro Alves --------------090606040102010307050001 Content-Type: text/x-patch; name="mivarchild.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="mivarchild.diff" Content-length: 3941 2008-01-16 Pedro Alves * gdb.mi/mi-var-child.c (do_children_tests): Add 'dummy' integer and 'dummy_ptr' integer pointer. Initialize struct_declarations with dummy_ptr's address. * gdb.mi/var-cmd.c (do_children_tests): Likewise. * gdb.mi/mi-var-child.exp: int_ptr_ptr is now always "editable" on all targets. * gdb.mi/mi2-var-child.exp: Likewise. --- gdb/testsuite/gdb.mi/mi-var-child.c | 8 ++++++-- gdb/testsuite/gdb.mi/mi-var-child.exp | 4 ++-- gdb/testsuite/gdb.mi/mi2-var-child.exp | 4 ++-- gdb/testsuite/gdb.mi/var-cmd.c | 8 ++++++-- 4 files changed, 16 insertions(+), 8 deletions(-) Index: src/gdb/testsuite/gdb.mi/mi-var-child.c =================================================================== --- src.orig/gdb/testsuite/gdb.mi/mi-var-child.c 2008-01-16 10:48:35.000000000 -0500 +++ src/gdb/testsuite/gdb.mi/mi-var-child.c 2008-01-16 11:27:37.000000000 -0500 @@ -206,8 +206,12 @@ do_children_tests (void) int *foo; int bar; - struct _struct_decl struct_declarations; - memset (&struct_declarations, 0, sizeof (struct_declarations)); + /* Avoid pointing into NULL, as that is editable on some + systems. */ + int dummy; + int *dummy_ptr = &dummy; + + struct _struct_decl struct_declarations = { 0, 0, NULL, 0, &dummy_ptr }; weird = &struct_declarations; struct_declarations.integer = 123; Index: src/gdb/testsuite/gdb.mi/mi-var-child.exp =================================================================== --- src.orig/gdb/testsuite/gdb.mi/mi-var-child.exp 2008-01-16 10:48:35.000000000 -0500 +++ src/gdb/testsuite/gdb.mi/mi-var-child.exp 2008-01-16 10:50:44.000000000 -0500 @@ -682,13 +682,13 @@ mi_gdb_test "-var-show-attributes weird- # Test: c_variable-4.99 # Desc: is *(weird->int_ptr_ptr) editable mi_gdb_test "-var-show-attributes weird.int_ptr_ptr.*int_ptr_ptr" \ - "\\^done,attr=\"noneditable\"" \ + "\\^done,attr=\"editable\"" \ "is weird.int_ptr_ptr.*int_ptr_ptr editable" # Test: c_variable-4.100 # Desc: is *(*(weird->int_ptr_ptr)) editable mi_gdb_test "-var-show-attributes weird.int_ptr_ptr.*int_ptr_ptr.**int_ptr_ptr" \ - "\\^done,attr=\"noneditable\"" \ + "\\^done,attr=\"editable\"" \ "is weird.int_ptr_ptr.*int_ptr_ptr.**int_ptr_ptr editable" # Test: c_variable-4.101 Index: src/gdb/testsuite/gdb.mi/mi2-var-child.exp =================================================================== --- src.orig/gdb/testsuite/gdb.mi/mi2-var-child.exp 2008-01-16 11:23:13.000000000 -0500 +++ src/gdb/testsuite/gdb.mi/mi2-var-child.exp 2008-01-16 11:26:27.000000000 -0500 @@ -681,13 +681,13 @@ mi_gdb_test "-var-show-attributes weird- # Test: c_variable-4.99 # Desc: is *(weird->int_ptr_ptr) editable mi_gdb_test "-var-show-attributes weird.int_ptr_ptr.*int_ptr_ptr" \ - "\\^done,attr=\"noneditable\"" \ + "\\^done,attr=\"editable\"" \ "is weird.int_ptr_ptr.*int_ptr_ptr editable" # Test: c_variable-4.100 # Desc: is *(*(weird->int_ptr_ptr)) editable mi_gdb_test "-var-show-attributes weird.int_ptr_ptr.*int_ptr_ptr.**int_ptr_ptr" \ - "\\^done,attr=\"noneditable\"" \ + "\\^done,attr=\"editable\"" \ "is weird.int_ptr_ptr.*int_ptr_ptr.**int_ptr_ptr editable" # Test: c_variable-4.101 Index: src/gdb/testsuite/gdb.mi/var-cmd.c =================================================================== --- src.orig/gdb/testsuite/gdb.mi/var-cmd.c 2008-01-16 11:24:32.000000000 -0500 +++ src/gdb/testsuite/gdb.mi/var-cmd.c 2008-01-16 11:27:17.000000000 -0500 @@ -210,8 +210,12 @@ do_children_tests (void) int *foo; int bar; - struct _struct_decl struct_declarations; - memset (&struct_declarations, 0, sizeof (struct_declarations)); + /* Avoid pointing into NULL, as that is editable on some + systems. */ + int dummy; + int *dummy_ptr = &dummy; + + struct _struct_decl struct_declarations = { 0, 0, NULL, 0, &dummy_ptr }; weird = &struct_declarations; struct_declarations.integer = 123; --------------090606040102010307050001--