Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 793285
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T22:07:37+00:00 2026-05-14T22:07:37+00:00

recently I’ve started to use the excellent boost::unordered_map on my system, but got one

  • 0

recently I’ve started to use the excellent boost::unordered_map on my system, but got one drawback: I couldn’t figure how to inspect its contents. Printing it on gdb gives me a table_ and a buckets_, but haven’t found where are the items. Anyone has a clue about this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T22:07:37+00:00Added an answer on May 14, 2026 at 10:07 pm

    For the ones that wanted a printer, I’ve managed to create one. Here is Code:

    class BoostUnorderedMapPrinter:
        "prints a boost::unordered_map"
    
        class _iterator:
            def __init__ (self, fields):
                type_1 = fields.val.type.template_argument(0)
                type_2 = fields.val.type.template_argument(1)
                self.buckets = fields.val['table_']['buckets_']
                self.bucket_count = fields.val['table_']['bucket_count_']
                self.current_bucket = 0
                pair = "std::pair<%s const, %s>" % (type_1, type_2)
                self.pair_pointer = gdb.lookup_type(pair).pointer()
                self.base_pointer = gdb.lookup_type("boost::unordered_detail::value_base< %s >" % pair).pointer()
                self.node_pointer = gdb.lookup_type("boost::unordered_detail::hash_node<std::allocator< %s >, boost::unordered_detail::ungrouped>" % pair).pointer()
                self.node = self.buckets[self.current_bucket]['next_']
    
            def __iter__(self):
                return self
    
            def next(self):
                while not self.node:
                    self.current_bucket = self.current_bucket + 1
                    if self.current_bucket >= self.bucket_count:
                        raise StopIteration
                    self.node = self.buckets[self.current_bucket]['next_']
    
                iterator = self.node.cast(self.node_pointer).cast(self.base_pointer).cast(self.pair_pointer).dereference()   
                self.node = self.node['next_']
    
                return ('%s' % iterator['first'], iterator['second'])
    
        def __init__(self, val):
            self.val = val
    
        def children(self):
            return self._iterator(self)
    
        def to_string(self):
            return "boost::unordered_map"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Recently, I started changing some of our applications to support MS SQL Server as
Recently we got a new server at the office purely for testing purposes. It
recently I started using storyboard and I've the following situation: I want to set
Recently two users of our software from the same company started experiencing random closures
Recently i am making an app on facebook. So i have use facebook api.
Recently,I am handling a solution for WebPart internationalization,but I am not familiar with the
Recently, I'm trying to solve all the exercises in CLRS. but there are some
Recently, I am going to make a instant-notification system for my website. I heard
Recently I started reading (just a bit) the current draft for the future C++11
Recently I took a test at brainbench and got not a bad result (something

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.