Visual Studio 2005 ptr_list visualizer?
Hello I've seen Visual Studio 2005 visualizers for various boost containers on here before. Has anyone written one for ptr_list that they can share? Thanks, Michael Marcin
On 7/30/07, Michael Marcin
Hello
I've seen Visual Studio 2005 visualizers for various boost containers on here before. Has anyone written one for ptr_list that they can share?
We are trying to build a repository of visualizers: http://svn.boost.org/trac/boost/wiki/DebuggerVisualizers Please contact Filip if you want to help. King regards Matias
On Thu, August 2, 2007 13:36, Matias Capeletto wrote:
On 7/30/07, Michael Marcin
wrote: Hello
I've seen Visual Studio 2005 visualizers for various boost containers on here before. Has anyone written one for ptr_list that they can share?
We are trying to build a repository of visualizers:
http://svn.boost.org/trac/boost/wiki/DebuggerVisualizers
Please contact Filip if you want to help.
King regards Matias _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
I could help if I get exact tasks to do ;) Unfortunately Filip's address is not visible in the Wiki page. With Kind Regards, Ovanes Markarian
On 8/2/07, Ovanes Markarian
On Thu, August 2, 2007 13:36, Matias Capeletto wrote:
On 7/30/07, Michael Marcin
wrote: Hello
I've seen Visual Studio 2005 visualizers for various boost containers on here before. Has anyone written one for ptr_list that they can share?
I could help if I get exact tasks to do ;) Unfortunately Filip's address is not visible in the Wiki page.
Great :) Please join the IBD IRC channel #ibd @ irc.freenode.net In a capable browser like Opera or Firefox+ChatZilla add on you can directly use irc://irc.freenode.net/ibd or the boost-docs list http://lists.boost.org/mailman/listinfo.cgi/boost-docs and we discuss it there. Anyway, I have seen your activity in the boost-users list. You are helping a lot here, you may be interested in other IBD projects too, specially in this one: http://svn.boost.org/trac/boost/wiki/GlueDocsProject For others project: http://svn.boost.org/trac/boost/wiki/ImprovingBoostDocs#Howtohelp We will really love to have you in our team, Ovanes King regards Matias
Ovanes Markarian (2.8.2007 13:54):
On Thu, August 2, 2007 13:36, Matias Capeletto wrote:
On 7/30/07, Michael Marcin
wrote: Hello
I've seen Visual Studio 2005 visualizers for various boost containers on here before. Has anyone written one for ptr_list that they can share?
We are trying to build a repository of visualizers:
http://svn.boost.org/trac/boost/wiki/DebuggerVisualizers
Please contact Filip if you want to help.
King regards Matias
I could help if I get exact tasks to do ;) Unfortunately Filip's address is not visible in the Wiki page.
Hi, contact me on this address if you want, or we can discuss right here if you will. I've been away for 3 weeks, but now that I'm back I'm going to do something about the wiki and I am certainly willing to help you. Best, Filip
Filip great! If you have some tasks for me, like visualize this or that. I will do it in my spare time. With Kind Regards, Ovanes Markarian On Thu, August 2, 2007 14:38, Filip KonviÄka wrote:
Ovanes Markarian (2.8.2007 13:54): [...]
Hi,
contact me on this address if you want, or we can discuss right here if you will. I've been away for 3 weeks, but now that I'm back I'm going to do something about the wiki and I am certainly willing to help you.
Best, Filip
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
If you have some tasks for me, like visualize this or that. I will do it in my spare time.
If you have time, that would be great. However, before I ask you or anyone to create visualizers, I'd like to write a how-to with examples, and create some style guidelines so that the visualizers are consisent. Another task could be doing some utility that installs or updates visualizers so that users don't have to dig deep into VC directories and hand-edit files. Thanks very much for your interest! I'll let you know when I have the basic docs and we can talk about what can be done. If you're impatient, however, you can read the May / June thread "[multi_index] MSVS 2005 visualizers" on this list, it contains about all the know-how that I currently have :-) Cheers, Filip
On Thu, August 2, 2007 15:23, Filip KonviÄka wrote:
If you have some tasks for me, like visualize this or that. I will do it in my spare time.
If you have time, that would be great. However, before I ask you or anyone to create visualizers, I'd like to write a how-to with examples, and create some style guidelines so that the visualizers are consisent. Another task could be doing some utility that installs or updates visualizers so that users don't have to dig deep into VC directories and hand-edit files.
Thanks very much for your interest! I'll let you know when I have the basic docs and we can talk about what can be done.
If you're impatient, however, you can read the May / June thread "[multi_index] MSVS 2005 visualizers" on this list, it contains about all the know-how that I currently have :-)
Cheers, Filip
Filip, I read this mailing already. But it is for sure better to have some tutorial. I can try to start with an installer. As I understand visualizers must be copied in the text file (mentioned in this mailing). I will think how one can best install and uninstall them. With Kind Regards, Ovanes Markarian
Ovanes Markarian (2.8.2007 15:28):
On Thu, August 2, 2007 15:23, Filip Konvicka wrote:
If you're impatient, however, you can read the May / June thread "[multi_index] MSVS 2005 visualizers" on this list, it contains about all the know-how that I currently have :-)
I read this mailing already. But it is for sure better to have some tutorial. Exactly, no need for you to go through all the pain. I can try to start with an installer. As I understand visualizers must be copied in the text file (mentioned in this mailing). I will think how one can best install and uninstall them.
OK, great! I was thinking about wrapping the "installed" code in some specially formatted comment blocks, which could include the author's name and visualizer version (for upgrading / uninstall purposes?) What do you think? BTW, if you don't mind, I suggest that we move this discussion to [boost-docs], I've just managed to re-subscribe from SF to lists.boost.org :-) Cheers, Filip
I have written visualizers for the other pointer containers, but realize that I had forgotten about ptr_list. I previously posted the visualizer code for ptr_vector, ptr_map, ptr_multimap, ptr_set, ptr_multiset, and also array. If you don't have it I can easily post it again. I took a quick stab at ptr_list, but I think I may have run into a limitation (or bug) in the visualizer. It's not letting me cast the final expression to the templated parameter. I tried it with a direct cast and that worked, but it seems to lose the template information in the resulting expression. The problem is in the expression ($T1*)$e._Myval. It seems that $T1 (the template parameter) is not valid at this point. If, for example the list is defined as ptr_list<int>, then the expression (int*)$e._Myval will work, but obviously we can't hard code that here. Any one have any ideas here? First attempt posted here (this does not include the iterators yet): ;--------------------------------------------------------------------------- --- ; boost::ptr_list ;--------------------------------------------------------------------------- --- boost::ptr_list<*>{ children ( #list ( head : ($c.c_._Myhead->_Next), size : $c.c_._Mysize, next : _Next ) : ($T1*)$e._Myval ) preview ( #( "[", $e._Mysize, "](", #list ( head : $c.c_._Myhead->_Next, size : $c.c_._Mysize, next : _Next ) : ($T1*)$e._Myval, ")" ) ) } -- Bill Buklis --
-----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users- bounces@lists.boost.org] On Behalf Of Filip Konvicka Sent: Thursday, August 02, 2007 8:51 AM To: boost-users@lists.boost.org Cc: boost-docs@lists.boost.org Subject: Re: [Boost-users] Visual Studio 2005 ptr_list visualizer?
Ovanes Markarian (2.8.2007 15:28):
On Thu, August 2, 2007 15:23, Filip Konvicka wrote:
If you're impatient, however, you can read the May / June thread "[multi_index] MSVS 2005 visualizers" on this list, it contains about all the know-how that I currently have :-)
I read this mailing already. But it is for sure better to have some tutorial. Exactly, no need for you to go through all the pain. I can try to start with an installer. As I understand visualizers must be copied in the text file (mentioned in this mailing). I will think how one can best install and uninstall them.
OK, great! I was thinking about wrapping the "installed" code in some specially formatted comment blocks, which could include the author's name and visualizer version (for upgrading / uninstall purposes?) What do you think?
BTW, if you don't mind, I suggest that we move this discussion to [boost-docs], I've just managed to re-subscribe from SF to lists.boost.org :-)
Cheers, Filip
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
Hi Bill, (please don't top post, thanks!)
I have written visualizers for the other pointer containers, but realize that I had forgotten about ptr_list. I previously posted the visualizer code for ptr_vector, ptr_map, ptr_multimap, ptr_set, ptr_multiset, and also array. If you don't have it I can easily post it again.
Thanks for sharing your work! Once the wiki + repository are ready, people will hopefully find things more easily.
I took a quick stab at ptr_list, but I think I may have run into a limitation (or bug) in the visualizer. It's not letting me cast the final expression to the templated parameter. I tried it with a direct cast and that worked, but it seems to lose the template information in the resulting expression.
The problem is in the expression ($T1*)$e._Myval. It seems that $T1 (the template parameter) is not valid at this point. If, for example the list is defined as ptr_list<int>, then the expression (int*)$e._Myval will work, but obviously we can't hard code that here. Any one have any ideas here?
Yes, this is a bit tricky... the problem is not $T1 being invalid in the
context, it rather is in how pattern matching works. I suspect that the
rule pattern matching is string-based. In this case, it is useful to
look (via a watch) at the exact type being matched. In the case of
ptr_list<int>, it is
boost::ptr_list
-----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users- bounces@lists.boost.org] On Behalf Of Filip Konvicka Sent: Thursday, August 02, 2007 6:44 PM To: boost-users@lists.boost.org Subject: Re: [Boost-users] Visual Studio 2005 ptr_list visualizer?
Hi Bill,
(please don't top post, thanks!)
I have written visualizers for the other pointer containers, but realize that I had forgotten about ptr_list. I previously posted the visualizer code for ptr_vector, ptr_map, ptr_multimap, ptr_set, ptr_multiset, and also array. If you don't have it I can easily post it again.
Thanks for sharing your work! Once the wiki + repository are ready, people will hopefully find things more easily.
I took a quick stab at ptr_list, but I think I may have run into a limitation (or bug) in the visualizer. It's not letting me cast the final expression to the templated parameter. I tried it with a direct cast and that worked, but it seems to lose the template information in the resulting expression.
The problem is in the expression ($T1*)$e._Myval. It seems that $T1 (the template parameter) is not valid at this point. If, for example the list is defined as ptr_list<int>, then the expression (int*)$e._Myval will work, but obviously we can't hard code that here. Any one have any ideas here?
Yes, this is a bit tricky... the problem is not $T1 being invalid in the context, it rather is in how pattern matching works. I suspect that the rule pattern matching is string-based. In this case, it is useful to look (via a watch) at the exact type being matched. In the case of ptr_list<int>, it is
boost::ptr_list
which apparently matches your filter
boost::ptr_list<*>
since you see some effects in the watch window. Hence $T1 = "int,boost::heap_clone_allocator,std::allocator
", which does not make sense after substitution. So, to fix your rule, it suffices to rewrite the pattern as boost::ptr_list<*,*,*>
(in fact, boost::ptr_list<*,*> would work as well, justifying my above guess...but it is clearly not as clean).
Cheers, Filip
You're right. That fixed it. I should've realized. I actually had that in my ptr_vector implementation - at least defined as ptr_vector<*,*>. Yes, ptr_list<*,*> works as well. By the way, it turns out that the iterators were already done. They use the same ones that ptr_vector used, so they were working already. I just realized that the visualizers I posted previously are all for boost version 1.33. It's quite possible that they will fully apply to v1.34. Though there may be an issue with ptr_map and ptr_multimap given that the usage has changed. I'm not in a position where I can switch over to 1.34 just yet. Can you give that one a try and see how it fares? I'm guessing that not using <*,*,*> instead of just <*,*> would fail if using a custom allocator, right? I haven't the need for that yet, but it sounds like a good reason to adjust everything to match. Updated visualizer: ;--------------------------------------------------------------------------- ; boost::ptr_list ;--------------------------------------------------------------------------- boost::ptr_list<*,*,*>{ children ( #list ( head : ($c.c_._Myhead->_Next), size : $c.c_._Mysize, next : _Next ) : ($T1*)$e._Myval ) preview ( #( "[", $e._Mysize, "](", #list ( head : $c.c_._Myhead->_Next, size : $c.c_._Mysize, next : _Next ) : ($T1*)$e._Myval, ")" ) ) } -- Bill --
Hi Bill,
I just realized that the visualizers I posted previously are all for boost version 1.33. It's quite possible that they will fully apply to v1.34. Though there may be an issue with ptr_map and ptr_multimap given that the usage has changed.
I'm not in a position where I can switch over to 1.34 just yet. Can you give that one a try and see how it fares?
I will.
I'm guessing that not using <*,*,*> instead of just <*,*> would fail if using a custom allocator, right? I haven't the need for that yet, but it sounds like a good reason to adjust everything to match.
It would work. You always get 3 template arguments, even if you don't supply them. You just get the default allocator. But as I said (now I can point you to the debugger visualizers wiki :-) http://svn.boost.org/trac/boost/wiki/DebuggerVisualizers), in this case the second wildcard will match the 2nd and 3rd template argument ("$T2,$T3" in terms of "<*,*,*>"). BTW, I use multi-template-argument matching in multi_index_container visualizers when I need to pass exactly the same template arguments to another templates, but never when accessing the actual template argument for type casts etc. Now please could you upload the most recent version of your visualizers to the boost vault at http://boost-consulting.com/vault/index.php?directory=Debug/Visualizers_MSVC... ? Please if you do also attach some license info, as I did with boost__multi_index_container.msvc8.vis.txt. If you want, you can add similar comments/headers into your file(s), otherwise I kindly ask you for permission to do this myself. Of course you keep all the credits! Thanks, Filip
-----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users- bounces@lists.boost.org] On Behalf Of Filip Konvicka Sent: Thursday, August 09, 2007 2:34 AM To: boost-users@lists.boost.org Subject: Re: [Boost-users] Visual Studio 2005 ptr_list visualizer?
It would work. You always get 3 template arguments, even if you don't supply them. You just get the default allocator. But as I said (now I can point you to the debugger visualizers wiki :-) http://svn.boost.org/trac/boost/wiki/DebuggerVisualizers), in this case the second wildcard will match the 2nd and 3rd template argument ("$T2,$T3" in terms of "<*,*,*>").
That I knew already. I was just wondering out loud that if only two
arguments <*,*> were specified in the visualizer would it still work for a
type that included a custom allocator. I looked at how std::vector,
std::list, etc are specified and none of them include the extra parameter
for the allocator. So, I'm guessing that it would. Either that or the
default visualizers are incorrect.
As an aside, I've discovered that the $T1,$T2, etc. seem to go by the
"asterisks" and not by the template arguments. Given class_name
BTW, I use multi-template-argument matching in multi_index_container visualizers when I need to pass exactly the same template arguments to another templates, but never when accessing the actual template argument for type casts etc.
Now please could you upload the most recent version of your visualizers to the boost vault at
http://boost- consulting.com/vault/index.php?directory=Debug/Visualizers_MSVC_8
Now uploaded. The following containers and associated iterators are included in this file: array ptr_array ptr_deque ptr_list ptr_map ptr_multimap ptr_set ptr_multiset ptr_vector
? Please if you do also attach some license info, as I did with boost__multi_index_container.msvc8.vis.txt. If you want, you can add similar comments/headers into your file(s), otherwise I kindly ask you for permission to do this myself. Of course you keep all the credits!
Thanks, Filip
I followed your example and placed similar information at the top of the text file. If it's not right or something's missing, you are free to modify the file as necessary. Just let me know, so I can update my local copy to match. -- Bill Buklis --
Bill Buklis wrote on 10.8.2007 1:19:
-----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users- bounces@lists.boost.org] On Behalf Of Filip Konvicka Sent: Thursday, August 09, 2007 2:34 AM To: boost-users@lists.boost.org Subject: Re: [Boost-users] Visual Studio 2005 ptr_list visualizer?
It would work. You always get 3 template arguments, even if you don't supply them. You just get the default allocator. But as I said (now I can point you to the debugger visualizers wiki :-) http://svn.boost.org/trac/boost/wiki/DebuggerVisualizers), in this case the second wildcard will match the 2nd and 3rd template argument ("$T2,$T3" in terms of "<*,*,*>").
That I knew already. I was just wondering out loud that if only two arguments <*,*> were specified in the visualizer would it still work for a type that included a custom allocator. I looked at how std::vector, std::list, etc are specified and none of them include the extra parameter for the allocator. So, I'm guessing that it would. Either that or the default visualizers are incorrect.
Maybe I still don't understand, but I wanted to point out that a pattern with "<*,*>" still matches a three-argument template, because the pattern matching is text-based (as I mention in the wiki guide). Most of the std:: visualizers don't actually use the template argument, so they're fine with a single * (it suffices that the pattern matches), and those that do use the asterisks correctly (auto_ptr<*>, deque<*,*>).
As an aside, I've discovered that the $T1,$T2, etc. seem to go by the "asterisks" and not by the template arguments. Given class_name
for example $T3 represents the second template argument. Go figure. At least that was the case when I did the visualizer for boost::void_ptr_iterator (used by ptr_array).
Again, due to the textual processing of the typenames. In the case of
class_name
BTW, I use multi-template-argument matching in multi_index_container visualizers when I need to pass exactly the same template arguments to another templates, but never when accessing the actual template argument for type casts etc.
Now please could you upload the most recent version of your visualizers to the boost vault at
http://boost- consulting.com/vault/index.php?directory=Debug/Visualizers_MSVC_8
Now uploaded. The following containers and associated iterators are included in this file: array ptr_array ptr_deque ptr_list ptr_map ptr_multimap ptr_set ptr_multiset ptr_vector
? Please if you do also attach some license info, as I did with boost__multi_index_container.msvc8.vis.txt. If you want, you can add similar comments/headers into your file(s), otherwise I kindly ask you for permission to do this myself. Of course you keep all the credits!
I followed your example and placed similar information at the top of the text file. If it's not right or something's missing, you are free to modify the file as necessary. Just let me know, so I can update my local copy to match.
Excellent, thanks! I'll try them out with 1.34 as I promised, and will mention them in the wiki as well. Cheers, Filip
Maybe I still don't understand, but I wanted to point out that a pattern with "<*,*>" still matches a three-argument template, because the pattern matching is text-based (as I mention in the wiki guide).
Most of the std:: visualizers don't actually use the template argument, so they're fine with a single * (it suffices that the pattern matches), and those that do use the asterisks correctly (auto_ptr<*>, deque<*,*>).
As an aside, I've discovered that the $T1,$T2, etc. seem to go by the "asterisks" and not by the template arguments. Given class_name
for example $T3 represents the second template argument. Go figure. At least that was the case when I did the visualizer for boost::void_ptr_iterator (used by ptr_array). Again, due to the textual processing of the typenames. In the case of class_name
(a pattern, right?), $T1 and $T2 simply match the empty string ($T1 maybe some pointer "*"s or "const *", depending what class is being matched against), and $T3 is indeed the second template parameter. That's what I think is the way it works - no way of telling that a "*" in a pattern is not a wildcard.
That sounds right. It does seem clearly text based processing. I guess I was expecting more sophisticated C++ matching. But, that's probably not needed here and might be too slow anyway. Here's one more tidbit you may wish to consider for the wiki guide. While doing a visualizer for a specialized date/time class we have, I discovered a bug in the visualizer handling. Colons cannot be used in literal text strings. See the example below. I don't know if there are any other invalid characters. I did not do an exhaustive test. I reported it to Microsoft and they acknowledged the problem. In there infinite wisdom, they decided it wasn't worth fixing (see http://tinyurl.com/2lcqzn for the bug report). Example: class test { public: int hour; int minute; int second; }; autoexp.dat entry: test{ preview ( #( $c.hour, ":", $c.minute, ":", $c.second ) ) } The quoted colon causes an error in the visualizer parsing. Changing to another character will succeed. -- Bill --
participants (5)
-
Bill Buklis
-
Filip Konvička
-
Matias Capeletto
-
Michael Marcin
-
Ovanes Markarian