Chromium Code Reviews
Help | Chromium Project | Gerrit Changes | Sign in
(6)

Issue 2897573004: Add a GDB pretty printer for base::flat_map. (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
2 months ago by brettw
Modified:
2 months ago
Reviewers:
danakj
CC:
chromium-reviews
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Add a GDB pretty printer for base::flat_map. This improves the output somewhat. As explained in the added comment, it's not ideal but I had trouble figuring out how to work with the vector inside of the flat_map without hardcoding internals of how std::vector is implemented. This also adds some hints about debugging the printers at the top of the file. Before for base::flat_map<std::string, int>: (gdb) print qwer $2 = {<base::internal::flat_tree<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, int>, base::internal::GetKeyFromValuePairFirst<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, int>, std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >> = { impl_ = {<base::internal::flat_tree<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, int>, base::internal::GetKeyFromValuePairFirst<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, int>, std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >::value_compare> = {<std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >> = {<std::binary_function<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool>> = {<No data fields>}, <No data fields>}, <No data fields>}, body_ = std::__debug::vector of length 3, capacity 4 = {{ first = "a", second = 1}, {first = "nonsense", second = 9}, { first = "zebra", second = 1123123}}}}, <No data fields>} After: base: :flat_map with std::__debug::vector of length 3, capacity 4 = {{first = "a", second = 1}, {first = "nonsense", second = 9}, {first = "zebra", second = 1123123}} Review-Url: https://codereview.chromium.org/2897573004 Cr-Commit-Position: refs/heads/master@{#473286} Committed: https://chromium.googlesource.com/chromium/src/+/462b7cae8824b4eb54e028b42da50f25ab4b0615

Patch Set 1 #

Messages

Total messages: 15 (9 generated)
brettw
Context for this is I just wrote a pretty printer for base::Value (which is almost ...
2 months ago (2017-05-19 16:50:32 UTC) #2
danakj
It'd be cool to see before/after in the CL description. LGTM
2 months ago (2017-05-19 19:10:11 UTC) #7
brettw
Description updated.
2 months ago (2017-05-19 19:39:59 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2897573004/1
2 months ago (2017-05-19 19:41:15 UTC) #11
danakj
Nice!
2 months ago (2017-05-19 19:41:22 UTC) #12
commit-bot: I haz the power
2 months ago (2017-05-19 19:47:18 UTC) #15
Message was sent while issue was closed.
Committed patchset #1 (id:1) as
https://chromium.googlesource.com/chromium/src/+/462b7cae8824b4eb54e028b42da5...
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld 25c286973