From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6665 invoked by alias); 10 Jan 2008 22:05:47 -0000 Received: (qmail 6654 invoked by uid 22791); 10 Jan 2008 22:05:45 -0000 X-Spam-Check-By: sourceware.org Received: from qnxmail.qnx.com (HELO nimbus.ott.qnx.com) (209.226.137.76) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 10 Jan 2008 22:05:28 +0000 Received: by nimbus.ott.qnx.com with Internet Mail Service (5.5.2653.19) id ; Thu, 10 Jan 2008 17:05:25 -0500 Message-ID: <2F6320727174C448A52CEB63D85D11F40A8C@nova.ott.qnx.com> From: Aleksandar Ristovski To: gdb-patches@sourceware.org Cc: Ryan Mansfield Subject: [patch] Fix for varobj.c assertions. Date: Thu, 10 Jan 2008 22:05:00 -0000 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: multipart/mixed; boundary="----_=_NextPart_000_01C853D4.E39428A8" X-IsSubscribed: yes 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/msg00250.txt.bz2 This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. ------_=_NextPart_000_01C853D4.E39428A8 Content-Type: text/plain Content-length: 242 When listing children of a variable, if variable was not initialized we will ignore return value from gdb_value_ind. This patch fixes this situation. Fixes at least one problem from PR 2309. --- Aleksandar Ristovski QNX Software Systems ------_=_NextPart_000_01C853D4.E39428A8 Content-Type: text/plain; name="ChangeLog.txt" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="ChangeLog.txt" Content-length: 228 2008-01-10 Aleksandar Ristovski * varobj (adjust_value_for_child_access): Added checking for=20 returned value from gdb_value_ind. (c_describe_child): Likewise. (cplus_describe_child): Fixed a typo. ------_=_NextPart_000_01C853D4.E39428A8 Content-Type: application/octet-stream; name="varobj.c.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="varobj.c.patch" Content-length: 1711 Index: gdb/varobj.c=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= RCS file: /cvs/src/src/gdb/varobj.c,v=0A= retrieving revision 1.99=0A= diff -u -p -r1.99 varobj.c=0A= --- gdb/varobj.c 1 Jan 2008 22:53:13 -0000 1.99=0A= +++ gdb/varobj.c 10 Jan 2008 21:59:04 -0000=0A= @@ -1920,7 +1920,11 @@ adjust_value_for_child_access (struct va=0A= || TYPE_CODE (target_type) =3D=3D TYPE_CODE_UNION)=0A= {=0A= if (value && *value)=0A= - gdb_value_ind (*value, value);=09=20=20=0A= + {=0A= + int success =3D gdb_value_ind (*value, value);=09=20=20=0A= + if (!success)=0A= + *value =3D NULL;=0A= + }=0A= *type =3D target_type;=0A= if (was_ptr)=0A= *was_ptr =3D 1;=0A= @@ -2114,7 +2118,11 @@ c_describe_child (struct varobj *parent,=0A= *cname =3D xstrprintf ("*%s", parent->name);=0A= =20=0A= if (cvalue && value)=0A= - gdb_value_ind (value, cvalue);=0A= + {=0A= + int success =3D gdb_value_ind (value, cvalue);=0A= + if (!success)=0A= + *cvalue =3D NULL;=0A= + }=0A= =20=0A= /* Don't use get_target_type because it calls=0A= check_typedef and here, we want to show the true=0A= @@ -2415,7 +2423,7 @@ cplus_describe_child (struct varobj *par=0A= adjust_value_for_child_access (&value, &type, &was_ptr);=0A= =20=0A= if (TYPE_CODE (type) =3D=3D TYPE_CODE_STRUCT=0A= - || TYPE_CODE (type) =3D=3D TYPE_CODE_STRUCT)=0A= + || TYPE_CODE (type) =3D=3D TYPE_CODE_UNION)=0A= {=0A= char *join =3D was_ptr ? "->" : ".";=0A= if (CPLUS_FAKE_CHILD (parent))=0A= ------_=_NextPart_000_01C853D4.E39428A8--