如何在eclipse中调试jsoncpp

问题描述

我在 Eclipse IDE 上的 cpp 项目中使用了 jsoncpp 库,并且在我的应用程序中使用了很多 Json::Value 对象。 在调试我的程序时,我在监视窗口看不到 Json::Value 对象的真实内容,只能看到该对象的一些信息(例如 minInt、maxInt...)。

当我将 object.toStyledString() 放入手表时,我可以看到部分真实内容,但不能看到全部内容

我知道有一个 debug helper for Visual Studio 用于此,但没有用于 eclipse。

有什么想法吗?

PS:我有一个旧的 Eclipse (Kepler),表达式/变量窗口上的“最大长度”选项不起作用。

解决方法

Json::Value root;
//...

std::string strJson = root.toStyledString();
std::cout << strJson << std::endl;