public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug mi/16084] New: -var-info-path-expression fails for nested structs
@ 2013-10-25 11:47 m.maghoerndl at bachmann dot info
  2013-10-25 11:52 ` [Bug mi/16084] " m.maghoerndl at bachmann dot info
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: m.maghoerndl at bachmann dot info @ 2013-10-25 11:47 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=16084

            Bug ID: 16084
           Summary: -var-info-path-expression fails for nested structs
           Product: gdb
           Version: 7.6
            Status: NEW
          Severity: normal
          Priority: P2
         Component: mi
          Assignee: unassigned at sourceware dot org
          Reporter: m.maghoerndl at bachmann dot info

-var-info-path-expression does not take into account the type tag of a nested
struct.

Environment:
GDB 7.6 "--host=i686-pc-mingw32 --target=i386-wrs-vxworks".
No Python

Code to reproduce:
struct
{
    int a;
    struct _B
    {
         int b [4];
     } B;
} A[] = {1, { 2,3,4,5 } };

MI log from a CDT Session:
105,320 44-var-create --thread 3 --frame 0 - * A
105,323 44^done,name="var1",numchild="1",value="[1]",type="struct {...}
[1]",has_more="0"
105,323 (gdb) 
105,324 45-var-create --thread 3 --frame 0 - * &(A)
105,333 45^done,name="var2",numchild="1",value="0x35ff4ec <A>",type="struct
{...} (*)[1]",has_more="\
0"
105,333 (gdb) 
109,995 46-var-create --thread 3 --frame 0 - * A[0]
110,003 46^done,name="var3",numchild="2",value="{...}",type="struct
{...}",has_more="0"
110,003 (gdb) 
112,040 47-var-list-children var3
112,069
47^done,numchild="2",children=[child={name="var3.a",exp="a",numchild="0",type="int"},child={\
name="var3.B",exp="B",numchild="1",type="struct _B"}],has_more="0"
112,082 (gdb) 
112,083 48-var-info-path-expression var3.a
112,083 49-var-info-path-expression var3.B
112,084 48^done,path_expr="(A[0]).a"
112,084 (gdb) 
112,084 49^done,path_expr="(A[0]).B"
112,084 (gdb) 
112,087 50-var-evaluate-expression var3.a
112,094 50^done,value="1"
112,094 (gdb) 
113,344 51-var-list-children var3.B
113,354
51^done,numchild="1",children=[child={name="var3.B.b",exp="b",numchild="4",type="char
[4]"}]\
,has_more="0"
113,354 (gdb) 
113,355 52-var-info-path-expression var3.B.b
113,364 52^done,path_expr="(A[0]).b"
113,364 (gdb) 
113,368 53-var-create --thread 3 --frame 0 - * &((A[0]).b)
113,374 53^error,msg="Type struct {...} has no component named b."
113,374 (gdb) 


Expected Behaviour:
-var-info-path-expression var3.B.b should return the following(full path):
52^done,path_expr="((A[0]).B).b"

The following Patch fixes that behaviour, but I don't know what it might cause
for sideefects:

Index: varobj.c
===================================================================
--- varobj.c    (revision 43031)
+++ varobj.c    (working copy)
@@ -1385,7 +1385,7 @@
   /* Anonymous unions and structs are also not path_expr parents.  */
   return !((TYPE_CODE (type) == TYPE_CODE_STRUCT
         || TYPE_CODE (type) == TYPE_CODE_UNION)
-       && TYPE_NAME (type) == NULL);
+       && TYPE_NAME (type) == NULL && TYPE_TAG_NAME (type) == NULL);
 }

 /* Return the path expression parent for VAR.  */

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug mi/16084] -var-info-path-expression fails for nested structs
  2013-10-25 11:47 [Bug mi/16084] New: -var-info-path-expression fails for nested structs m.maghoerndl at bachmann dot info
@ 2013-10-25 11:52 ` m.maghoerndl at bachmann dot info
  2014-07-16 17:52 ` marc.khouzam at ericsson dot com
  2014-10-31 19:13 ` marc.khouzam at ericsson dot com
  2 siblings, 0 replies; 4+ messages in thread
From: m.maghoerndl at bachmann dot info @ 2013-10-25 11:52 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=16084

markus maghörndl <m.maghoerndl at bachmann dot info> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |m.maghoerndl at bachmann dot info

-- 
You are receiving this mail because:
You are on the CC list for the bug.
>From gdb-prs-return-14482-listarch-gdb-prs=sources.redhat.com@sourceware.org Fri Oct 25 13:49:32 2013
Return-Path: <gdb-prs-return-14482-listarch-gdb-prs=sources.redhat.com@sourceware.org>
Delivered-To: listarch-gdb-prs@sources.redhat.com
Received: (qmail 20404 invoked by alias); 25 Oct 2013 13:49:32 -0000
Mailing-List: contact gdb-prs-help@sourceware.org; run by ezmlm
Precedence: bulk
List-Id: <gdb-prs.sourceware.org>
List-Subscribe: <mailto:gdb-prs-subscribe@sourceware.org>
List-Archive: <http://sourceware.org/ml/gdb-prs/>
List-Post: <mailto:gdb-prs@sourceware.org>
List-Help: <mailto:gdb-prs-help@sourceware.org>, <http://sourceware.org/lists.html#faqs>
Sender: gdb-prs-owner@sourceware.org
Delivered-To: mailing list gdb-prs@sourceware.org
Received: (qmail 20379 invoked by uid 48); 25 Oct 2013 13:49:31 -0000
From: "forum at emblocks dot org" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug gdb/16086] New: MI data-evaluate-expression wrong repeat counts
Date: Fri, 25 Oct 2013 13:49:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: new
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gdb
X-Bugzilla-Component: gdb
X-Bugzilla-Version: 7.6
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: forum at emblocks dot org
X-Bugzilla-Status: NEW
X-Bugzilla-Priority: P2
X-Bugzilla-Assigned-To: unassigned at sourceware dot org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status
 bug_severity priority component assigned_to reporter
Message-ID: <bug-16086-4717@http.sourceware.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://sourceware.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2013-q4/txt/msg00108.txt.bz2
Content-length: 902

https://sourceware.org/bugzilla/show_bug.cgi?id\x16086

            Bug ID: 16086
           Summary: MI data-evaluate-expression wrong repeat counts
           Product: gdb
           Version: 7.6
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: forum at emblocks dot org

If I have a char[512] and every thing is cleared I get

value="'\\000' <repeats 511 times>"

So the "\\000' also counts.

Now I make member char[100] = 1 and now I get:

value="'\\000' <repeats 100 times>, \"\\001\", '\\000' <repeats 410 times>"

Which will give us

          1  + 100             +         1 +       1 +   410 = 513

The first <repeats 100 times> should be 99 or the last should be 411.

This is not to parse.

--
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug mi/16084] -var-info-path-expression fails for nested structs
  2013-10-25 11:47 [Bug mi/16084] New: -var-info-path-expression fails for nested structs m.maghoerndl at bachmann dot info
  2013-10-25 11:52 ` [Bug mi/16084] " m.maghoerndl at bachmann dot info
@ 2014-07-16 17:52 ` marc.khouzam at ericsson dot com
  2014-10-31 19:13 ` marc.khouzam at ericsson dot com
  2 siblings, 0 replies; 4+ messages in thread
From: marc.khouzam at ericsson dot com @ 2014-07-16 17:52 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=16084

Marc Khouzam <marc.khouzam at ericsson dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |marc.khouzam at ericsson dot com
         Resolution|---                         |FIXED
           Assignee|unassigned at sourceware dot org   |aburgess at broadcom dot com

--- Comment #1 from Marc Khouzam <marc.khouzam at ericsson dot com> ---
Looks like this was fixed by:
https://sourceware.org/ml/gdb-patches/2014-05/msg00383.html

committed July 7th to master:

https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=9a9a76082919371f4ceb571f6c9892325b80a2e0

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug mi/16084] -var-info-path-expression fails for nested structs
  2013-10-25 11:47 [Bug mi/16084] New: -var-info-path-expression fails for nested structs m.maghoerndl at bachmann dot info
  2013-10-25 11:52 ` [Bug mi/16084] " m.maghoerndl at bachmann dot info
  2014-07-16 17:52 ` marc.khouzam at ericsson dot com
@ 2014-10-31 19:13 ` marc.khouzam at ericsson dot com
  2 siblings, 0 replies; 4+ messages in thread
From: marc.khouzam at ericsson dot com @ 2014-10-31 19:13 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=16084

Marc Khouzam <marc.khouzam at ericsson dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |7.9

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-10-31 19:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-25 11:47 [Bug mi/16084] New: -var-info-path-expression fails for nested structs m.maghoerndl at bachmann dot info
2013-10-25 11:52 ` [Bug mi/16084] " m.maghoerndl at bachmann dot info
2014-07-16 17:52 ` marc.khouzam at ericsson dot com
2014-10-31 19:13 ` marc.khouzam at ericsson dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).