This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug mi/21381] New: Invalid -var-info-path-expression result with anonymous union in std::string


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

            Bug ID: 21381
           Summary: Invalid -var-info-path-expression result with
                    anonymous union in std::string
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: mi
          Assignee: unassigned at sourceware dot org
          Reporter: simon.marchi at ericsson dot com
  Target Milestone: ---

This is rather specific, but it's probably possible to create a smaller test
case.

Test source:

---- 8< ----
#include <string>

int
main ()
{
  std::string s;
  s = "foo";

  return 0;
}
---- >8 ----

compilation line: g++ test.cpp -g3 -O0 -o test
gdb command line: gdb -i mi -nx test

MI commands used:

start
-var-create - * s
-var-list-children var1
-var-list-children var1.private
-var-list-children var1.private.2_anonymous
-var-list-children var1.private.2_anonymous.public
-var-list-children var1.private.2_anonymous.public._M_local_buf

So far everything is fine, it just creates all the variable object children. 
Now we try to use -var-info-path-expression on the last one:

-var-info-path-expression var1.private.2_anonymous.public._M_local_buf
^done,path_expr="(()._M_local_buf)"

The returned expression is not valid.  It should have been
"((s)._M_local_buf)".

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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]