Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Print contents of Mat object when debugging in Xcode 5 with lldb

I'm building a project in Xcode 5, which uses the lldb debugger. I'd like to be able to examine the contents of a Mat object from the lldb prompt. However, doing the obvious thing, printing with std::cout, doesn't work. For example, let's say I have declared Mat err and filled it with something. I'm actually debugging the BundleAdjusterBase::estimate method where this happens. Here's what happens when I try to examine the variable in lldb:

(lldb) expr cout << err
error: use of undeclared identifier 'cout'
error: 1 errors parsing expression

and

(lldb) expr std::cout << err
error: no member named 'cout' in namespace 'std'
error: 1 errors parsing expression

This is probably related to lldb not understanding the std::cout command; see also my stackoverflow post about generally using cout in lldb.

Is there any other way to examine a Mat structure in lldb?