Re: Using anonymous namespace vs 'static'

2012-11-21 Thread netzen
On Wednesday, November 21, 2012 12:06:32 AM UTC-5, Robert O'Callahan wrote: On Wed, Nov 21, 2012 at 4:07 PM, net...@gmail.com wrote: Actually that seems quite easy. For example in FrameLayerBuilder.cpp I can add gMaskLayerImageCache to the watch window with no problems, even though it's in

Re: Using anonymous namespace vs 'static'

2012-11-20 Thread netzen
Even worse, in Visual Studio 2010 (not sure about 2012), you can't set a breakpoint on an anonymous-namespace symbol *at all*. And we can't submit patches to fix that, either :-). Maybe there's a specific case where you can reproduce this, but in general I've always been able to set

Re: Using anonymous namespace vs 'static'

2012-11-20 Thread Robert O'Callahan
On Wed, Nov 21, 2012 at 3:19 PM, net...@gmail.com wrote: Maybe there's a specific case where you can reproduce this, but in general I've always been able to set breakpoints in unnamed namespaces. I've tested just now with a simple app in VS2008, VS2010 and VS2012. And on those debuggers it

Re: Using anonymous namespace vs 'static'

2012-11-20 Thread netzen
That's not exactly correct. In VS2010 you can have symbols in your watch window that are in an anonymous namespace and you can put breakpoints on them. For example: namespace { int g = 42; } In your Watch window, add g, and you can see 42. If you have an anonymous namespace inside of

Re: Using anonymous namespace vs 'static'

2012-11-20 Thread Robert O'Callahan
On Wed, Nov 21, 2012 at 4:07 PM, net...@gmail.com wrote: In VS2010 you can have symbols in your watch window that are in an anonymous namespace and you can put breakpoints on them. For example: namespace { int g = 42; } In your Watch window, add g, and you can see 42. If you have an

Re: Using anonymous namespace vs 'static'

2012-11-03 Thread Jason Duell
On 11/03/2012 02:20 PM, Justin Lebar wrote: Are there compiler annotations we could put on a class so that it behaves as though it's in an anonymous namespace but also plays nicely with the debugger? If so, maybe we should switch to those. Sure: static :) Jason

Using anonymous namespace vs 'static'

2012-11-02 Thread Jason Duell
I see an increasing number of patches using anonymous namespaces instead of 'static'. This is debugger unfriendly: setting a breakpoint in gdb for 'foo' in an anonymous namespace requires the following syntax: b (anonymous namespace)::foo (If there's a less verbose way of doing this,

Re: Using anonymous namespace vs 'static'

2012-11-02 Thread Nicholas Nethercote
On Sat, Nov 3, 2012 at 6:59 AM, Jason Duell jduell.mcb...@gmail.com wrote: I see an increasing number of patches using anonymous namespaces instead of 'static'. This is debugger unfriendly It also obfuscates the visibility of the identifier, because the |namespace {| is often far from the