0

I want to know the contents of a Map while debugging a c++ program. I am using command line dbx.

I have pointer to the map.

Is there a way in which i can get the data printed.

--

Edit: p *dataMap will give me this::

 p *dataMap
*dataMap = {
    __t = {
        __buffer_size   = 32U
        __buffer_list   = {
            __data_ = 0x3ba2b8
        }
        __free_list     = (nil)
        __next_avail    = 0x474660
        __last          = 0x474840
        __header        = 0x3b97b8
        __node_count    = 76U
        __insert_always = false
        __key_compare   = {
/* try using "print -r" to see any inherited members */
        }
    }
}

Thanks

Alok Kr.

Kumar Alok
  • 2,512
  • 8
  • 26
  • 36

1 Answers1

0

you need to write a ksh function to pretty print map, here is an example :

put following line in .dbxrc

source /ksh_STL_map

in dbx, use ppp to call ksh function that define in ksh_STL_map:

(dbx) ppp k

k = 2 elems {343, 0x301f8; 565, 0x30208}

I tried to post content of ksh_STL_map here, but this editor format will mess up the content, it's better that you post your email, then I can send ksh_STL_map directly to you.

chihin ko
  • 1
  • 1