public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug mi/18993] New: gdb-mi variable object not found with std::vector
@ 2015-09-23 10:26 xdegaye at gmail dot com
  2022-05-25 17:50 ` [Bug mi/18993] " tromey at sourceware dot org
  0 siblings, 1 reply; 2+ messages in thread
From: xdegaye at gmail dot com @ 2015-09-23 10:26 UTC (permalink / raw)
  To: gdb-prs

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

            Bug ID: 18993
           Summary: gdb-mi variable object not found with std::vector
           Product: gdb
           Version: 7.10
            Status: NEW
          Severity: normal
          Priority: P2
         Component: mi
          Assignee: unassigned at sourceware dot org
          Reporter: xdegaye at gmail dot com
  Target Milestone: ---

gdb-mi sets the name of a 'var1' varobj child to 'var1.std::_Vector_base<int,
std::allocator<int> >' but does not recognize this name when it is used in a
'-var-list-children' command.

The debugged source code:

#include <vector>
std::vector<int> testVec;
int main()
{
}

The debugging session:

$ gdb --interpreter=mi a.out
=thread-group-added,id="i1"
~"GNU gdb (GDB) 7.10\n"
~"Copyright (C) 2015 Free Software Foundation, Inc.\n"
~"License GPLv3+: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>\nThis is free software: you are free to
change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by
law.  Type \"show copying\"\nand \"show warranty\" for details.\n"
~"This GDB was configured as \"x86_64-unknown-linux-gnu\".\nType \"show
configuration\" for configuration details."
~"\nFor bug reporting instructions, please see:\n"
~"<http://www.gnu.org/software/gdb/bugs/>.\n"
~"Find the GDB manual and other documentation resources online
at:\n<http://www.gnu.org/software/gdb/documentation/>.\n"
~"For help, type \"help\".\n"
~"Type \"apropos word\" to search for commands related to \"word\"...\n"
=cmd-param-changed,param="history
filename",value="/home/xavier/etc/.gdb_history"
=cmd-param-changed,param="history save",value="on"
=cmd-param-changed,param="auto-load safe-path",value="/"
~"Reading symbols from a.out..."
~"done.\n"
(gdb) 
break main
&"break main\n"
~"Breakpoint 1 at 0x40073a: file foo.cc, line 7.\n"
=breakpoint-created,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x000000000040073a",func="main()",file="foo.cc",fullname="foo.cc",line="7",thread-groups=["i1"],times="0",original-location="main"}
^done
(gdb) 
run
&"run\n"
~"Starting program: a.out \n"
=thread-group-started,id="i1",pid="1687"
=thread-created,id="1",group-id="i1"
=library-loaded,id="/lib64/ld-linux-x86-64.so.2",target-name="/lib64/ld-linux-x86-64.so.2",host-name="/lib64/ld-linux-x86-64.so.2",symbols-loaded="0",thread-group="i1"
^running
*running,thread-id="all"
(gdb) 
=library-loaded,id="/usr/lib/libstdc++.so.6",target-name="/usr/lib/libstdc++.so.6",host-name="/usr/lib/libstdc++.so.6",symbols-loaded="0",thread-group="i1"
=library-loaded,id="/usr/lib/libm.so.6",target-name="/usr/lib/libm.so.6",host-name="/usr/lib/libm.so.6",symbols-loaded="0",thread-group="i1"
=library-loaded,id="/usr/lib/libgcc_s.so.1",target-name="/usr/lib/libgcc_s.so.1",host-name="/usr/lib/libgcc_s.so.1",symbols-loaded="0",thread-group="i1"
=library-loaded,id="/usr/lib/libc.so.6",target-name="/usr/lib/libc.so.6",host-name="/usr/lib/libc.so.6",symbols-loaded="0",thread-group="i1"
=breakpoint-modified,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x000000000040073a",func="main()",file="foo.cc",fullname="foo.cc",line="7",thread-groups=["i1"],times="1",original-location="main"}
~"\nBreakpoint "
~"1, main () at foo.cc:7\n"
~"7\t}\n"
*stopped,reason="breakpoint-hit",disp="keep",bkptno="1",frame={addr="0x000000000040073a",func="main",args=[],file="foo.cc",fullname="foo.cc",line="7"},thread-id="1",stopped-threads="all",core="1"
(gdb) 
-var-create var1 * "testVec"
^done,name="var1",numchild="1",value="{...}",type="std::vector<int,
std::allocator<int> >",has_more="0"
(gdb) 
-var-list-children --all-values var1
^done,numchild="1",children=[child={name="var1.std::_Vector_base<int,
std::allocator<int> >",exp="std::_Vector_base<int, std::allocator<int>
>",numchild="1",value="{...}",type="std::_Vector_base<int, std::allocator<int>
>"}],has_more="0"
(gdb) 
-var-list-children --all-values var1.std::_Vector_base<int, std::allocator<int>
>
^error,msg="Variable object not found"
(gdb)

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


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

* [Bug mi/18993] gdb-mi variable object not found with std::vector
  2015-09-23 10:26 [Bug mi/18993] New: gdb-mi variable object not found with std::vector xdegaye at gmail dot com
@ 2022-05-25 17:50 ` tromey at sourceware dot org
  0 siblings, 0 replies; 2+ messages in thread
From: tromey at sourceware dot org @ 2022-05-25 17:50 UTC (permalink / raw)
  To: gdb-prs

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

Tom Tromey <tromey at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |INVALID
                 CC|                            |tromey at sourceware dot org

--- Comment #2 from Tom Tromey <tromey at sourceware dot org> ---
Yeah, quotes are the way to go here.
I believe the input syntax is documented as well,
so I suspect there's nothing to fix here.

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

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

end of thread, other threads:[~2022-05-25 17:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-23 10:26 [Bug mi/18993] New: gdb-mi variable object not found with std::vector xdegaye at gmail dot com
2022-05-25 17:50 ` [Bug mi/18993] " tromey at sourceware dot org

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).