This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

gdb.lookup_type problem with boost::multi_index::multi_index_container


Hi,
I'm using gdb-7.5, on RHEL 6, compiled with gcc-4.7.2. I'm trying to
write a pretty printer for boost::multi_index and ran into problems
with gdb.lookup_type.

Attached code has the following declaration.

TestSet ts;

Now, at the gdb command prompt, I'm performing the following
operations (in python)

gdb >> python
> set_value = gdb.parse_and_eval('ts')
> set_type = set_value.type.strip_typedefs()
> t1 = set_type.template_argument(0) # Test
> t2 = set_type.template_argument(1) # boost::mult_index::indexed_by ....
> t3 = set_type.template_argument(2) # std::allocator<Test>
> node_type = gdb.lookup_type('boost::multi_index::detail::multi_index_node_type < %s, %s, %s >::type' % (t1, t2, t3))
> base = gdb.lookup_type ('boost::multi_index::detail::multi_index_base_type < %s, %s, %s >::type' % (t1, t2, t3))
> allocator = gdb.lookup_type('boost::detail::allocator::rebind_to<%s, %s>::type' % (t3, node_type))
> end

I'm getting the node_type correctly. But gdb is unable to get types
for 'base' and 'allocator'.

------------------------ The error for 'base' --------------------
Traceback (most recent call last):
  File "<string>", line 1, in <module>
gdb.error: No type named boost::detail::multi_index_base_type < Test,
boost::multi_index::indexed_by<boost::multi_index::ordered_unique<boost::multi_index::member<Test,
std::basic_string<char, std::char_traits<char>, std::allocator<char>
>, &Test::s>, mpl_::na, mpl_::na>
, boost::multi_index::ordered_unique<boost::multi_index::tag<int,
mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na,
mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na,
mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na>, boost::multi_i
ndex::member<Test, int, &Test::i>, mpl_::na>,
boost::multi_index::ordered_unique<boost::multi_index::member<Test,
float, &Test::f>, mpl_::na, mpl_::na>, mpl_::na, mpl_::na, mpl_::na,
mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na,
mpl_::na, mpl_::na
, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na>,
std::allocator<Test> >::type.
Error while executing Python code.
--------------------------------------------------------------

and a similar error for 'allocator'.
as boost::multi_index_container is derived from
boost::detail::multi_index_base_type, I'm expecting gdb to return a
valid type for the same.

Am I missing something here. ?

Thanks,
Surya

Attachment: test.cxx
Description: Binary data


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]