public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug mi/28201] New: Unable to show children and to string pretty-printer values at the same time.
@ 2021-08-06 14:38 yerimyah1 at gmail dot com
  2021-08-06 16:07 ` [Bug mi/28201] " tromey at sourceware dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: yerimyah1 at gmail dot com @ 2021-08-06 14:38 UTC (permalink / raw)
  To: gdb-prs

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

            Bug ID: 28201
           Summary: Unable to show children and to string pretty-printer
                    values at the same time.
           Product: gdb
           Version: 10.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: mi
          Assignee: unassigned at sourceware dot org
          Reporter: yerimyah1 at gmail dot com
  Target Milestone: ---

For example if i create a vector; 

```
std::vector<std::string> aVector { "this", "is", "a", "standard", "list"}

```

in the normal gdb command line i would get 


```
p aVector 
$1 = std::vector of length 5, capacity 5 = {"this", "is ", "a", "standard",
"list"}

```
however in GDB/MI


``` 
-var-create - * "aVector"

--
result-class: done
name: var21
numchild: 0
value: {...}
type: std::vector<std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char,
std::char_traits<char>, std::allocator<char> > > >
thread-id: 1
displayhint: array
dynamic: 1
has_more: 1

```

the to_string value of the std::vector pretty printer is gone and replaced by
"{...}"

the values is meant to show the size of the vector and very valuable when
debugging.

with the help of my mentor i was able to get the relevant part that it is
hardcoded to return `{...}` (there may be other parts) that may be relevant.

here

https://sourceware.org/git/?p=binutils-gdb.git;a=blob;f=gdb/c-varobj.c;h=f6db3a5d1ba77ad86e7d36a2cd94ef5fdc26069b;hb=refs/heads/master#l478

https://sourceware.org/git/?p=binutils-gdb.git;a=blob;f=gdb/varobj.c;h=d0c857a69060644b225f3072b96c90a44b6d1548;hb=refs/heads/master#l2162


thanks

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

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

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

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-06 14:38 [Bug mi/28201] New: Unable to show children and to string pretty-printer values at the same time yerimyah1 at gmail dot com
2021-08-06 16:07 ` [Bug mi/28201] " tromey at sourceware dot org
2021-08-06 17:53 ` tromey at sourceware dot org
2021-08-15 19:56 ` yerimyah1 at gmail dot com
2022-05-25 18:24 ` 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).