Can't see boost::optional contents when debugging with Visual Studio
Asked Answered
A

3

9

If I try to look at the variable directly, I see a ? sign. If I create a watch calling the is_initialized function, I get the following error:

CXX0033: Error: error in OMF type information

I didn't find much info about this error related to Boost using Google.

Anybody else experienced this? It's a hassle using OutputDebugString everywhere and rebuilding...

EDIT: Using Visual Studio 2010 SP1 with all hotfixes in Windows XP SP3 idem, and Boost 1.49.0

UPDATE: This issue comes and goes, it doesn't happen consistently; Debugger Visualizers are a great solution, I've adopted them as my brand new tool

Assonance answered 2/7, 2012 at 20:22 Comment(0)
H
7

You can use DebuggerVisualizers.

Hercules answered 3/7, 2012 at 0:57 Comment(0)
O
7

Use DebuggerVisualizers to make this transition:

Before

ludicrously complicated

After

simple

P.S. I tried to add these images to clarify the accepted answer but my edit was rejected.

Orthographize answered 22/12, 2015 at 17:37 Comment(0)
C
6

Try this: for a variable boost::optional<Category> category, create a watch on: category.get()

Capitulary answered 2/7, 2012 at 21:39 Comment(1)
In VS 2005 I get CXX0039: Error: symbol is ambiguousNeat

© 2022 - 2024 — McMap. All rights reserved.