[Bug libstdc++/55649] New: libstdcxx gdb python pretty printer for tr1 not working

2012-12-11 Thread david.simmonds at igmarkets dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55649



 Bug #: 55649

   Summary: libstdcxx gdb python pretty printer for tr1 not

working

Classification: Unclassified

   Product: gcc

   Version: 4.7.2

Status: UNCONFIRMED

  Severity: normal

  Priority: P3

 Component: libstdc++

AssignedTo: unassig...@gcc.gnu.org

ReportedBy: david.simmo...@igmarkets.com





The Tr1UnorderedMapPrinter pretty printer, and other tr1 pretty printers look

for variables starting with _M_, the actual variable names start with m_

For example, should be m_element_count rather than _M_element_count


[Bug libstdc++/55649] libstdcxx gdb python pretty printer for tr1 not working

2012-12-11 Thread david.simmonds at igmarkets dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55649



--- Comment #1 from Dave Simmonds  
2012-12-11 16:19:09 UTC ---

(gdb) print g_epicmap->m_Map

$1 = Traceback (most recent call last):

  File "/usr/share/gdb/python/libstdcxx/v6/printers.py", line 536, in to_string

return '%s with %d elements' % (self.typename,

self.val['_M_element_count'])

RuntimeError: There is no member or method named _M_element_count.

Traceback (most recent call last):

  File "/usr/share/gdb/python/libstdcxx/v6/printers.py", line 555, in children

data = self.flatten (itertools.imap (self.format_one, Tr1HashtableIterator

(self.val)))

  File "/usr/share/gdb/python/libstdcxx/v6/printers.py", line 477, in __init__

self.n_buckets = hash['_M_element_count']

RuntimeError: There is no member or method named _M_element_count.



(gdb) print /r g_epicmap->m_Map

$2 = {

   >, std::allocator > >, Internal::extract1st > >, _ConstCharPtrCmp, _ConstCharHash,

Internal::mod_range_hashing, Internal::default_ranged_hash,

Internal::prime_rehash_policy, false, false, true>> = {

 >, std::allocator > >, Internal::extract1st > >, _ConstCharPtrCmp, _ConstCharHash,

Internal::mod_range_hashing, Internal::default_ranged_hash,

Internal::prime_rehash_policy, false, false, true> >> = {},

 >, Internal::extract1st > >, _ConstCharPtrCmp, _ConstCharHash,

Internal::mod_range_hashing, Internal::default_ranged_hash, false>> = {

  m_extract = {},

  m_eq = {},

  m_h1 = {},

  m_h2 = {}

},

 >, Internal::extract1st > >, true, std::tr1::hashtable >,

std::allocator > >,

Internal::extract1st > >, _ConstCharPtrCmp, _ConstCharHash,

Internal::mod_range_hashing, Internal::default_ranged_hash,

Internal::prime_rehash_policy, false, false, true> >> = {},

members of std::tr1::hashtable >, std::allocator > >, Internal::extract1st > >, _ConstCharPtrCmp, _ConstCharHash,

Internal::mod_range_hashing, Internal::default_ranged_hash,

Internal::prime_rehash_policy, false, false, true>:

m_node_allocator = {

  <__gnu_cxx::new_allocator >, false> >> = {}, },

m_buckets = 0x2aaac010,

m_bucket_count = 92203,

m_element_count = 69182,

m_rehash_policy = {

  m_max_load_factor = 1,

  m_growth_factor = 2,

  m_next_resize = 92203

}

  }, }


[Bug libstdc++/55649] libstdcxx gdb python pretty printer for tr1 not working

2012-12-11 Thread david.simmonds at igmarkets dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55649



--- Comment #3 from Dave Simmonds  
2012-12-11 16:49:17 UTC ---

(In reply to comment #2)

> (In reply to comment #0)

> > The Tr1UnorderedMapPrinter pretty printer, and other tr1 pretty printers 
> > look

> > for variables starting with _M_, the actual variable names start with m_

> 

> No they don't:

> http://gcc.gnu.org/viewcvs/trunk/libstdc%2B%2B-v3/include/tr1/unordered_map.h?view=markup



Thanks for your reply, but the link isn't showing any variables with _M_ or

with m_, so doesn't help. Why do you say they don't? Certainly it's not working

for me as is, and if I create my own pretty printer with _M_ replaced by m_ it

works.


[Bug libstdc++/55649] libstdcxx gdb python pretty printer for tr1 not working

2012-12-11 Thread david.simmonds at igmarkets dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55649



Dave Simmonds  changed:



   What|Removed |Added



 Status|UNCONFIRMED |RESOLVED

 Resolution||FIXED



--- Comment #4 from Dave Simmonds  
2012-12-11 16:56:19 UTC ---

(In reply to comment #3)

> (In reply to comment #2)

> > (In reply to comment #0)

> > > The Tr1UnorderedMapPrinter pretty printer, and other tr1 pretty printers 
> > > look

> > > for variables starting with _M_, the actual variable names start with m_

> > 

> > No they don't:

> > http://gcc.gnu.org/viewcvs/trunk/libstdc%2B%2B-v3/include/tr1/unordered_map.h?view=markup

> 

> Thanks for your reply, but the link isn't showing any variables with _M_ or

> with m_, so doesn't help. Why do you say they don't? Certainly it's not 
> working

> for me as is, and if I create my own pretty printer with _M_ replaced by m_ it

> works.



OK, I looked at the include file, I compiled against gcc 4.1.2, which has m_,

4.7.2 has _M_



Problem is that redhat el5 comes with gcc 4.1.2 and a pretty printer with _M_

which doesn't work togther