ADL and overload resolution while debugging

148 views Asked by At

Boost is very nice, but many of the coolest libraries makes heavy use of ADL and template deduction, which, as far as I'm aware, is impossible to do within the context of debugging. Say, I'm using BGL, and I would like to access a property map with a particular vertex. The code would just be get(index_property_map, v) (for example) and that would compile file, but what if I want to run the same code while debugging in GDB? I was wondering if there was some way to do this that I was not able to find.

I'm aware this would be somewhat complicated and would probably need compiler integration to work properly, and some sort of detection of the current "location" you are at while debugging. I am also aware that you can manually (if tediously) specify the template parameters, but when you have signatures like this

boost::get<boost::function_property_map<algo::ScheduleToGraphAdapter::get_vertex_index_map() const::{lambda(algo::detail::STGA::vertex_descriptor const&)#1}, algo::detail::STGA::vertex_descriptor, unsigned long>, unsigned long, algo::detail::STGA::vertex_descriptor>(boost::put_get_helper<boost::function_property_map<algo::ScheduleToGraphAdapter::get_vertex_index_map() const::{lambda(algo::detail::STGA::vertex_descriptor const&)#1}, algo::detail::STGA::vertex_descriptor, unsigned long>, boost::function_property_map<algo::ScheduleToGraphAdapter::get_vertex_index_map() const::{lambda(algo::detail::STGA::vertex_descriptor const&)#1}, algo::detail::STGA::vertex_descriptor, unsigned long> > const&, algo::detail::STGA::vertex_descriptor const&)

you can't even do that if you wanted, as GDB won't parse it (gets confused by the lambda parts). Also... sometimes you don't even know what namespace to look in exactly, which defeats whatever assistance tab completion was. So, yeah, is there a way to do the template overloading & ADL while in a debugger?

0

There are 0 answers