It's pretty hard to debug programs with a complex JSON structure such as Json::Value, thinking on that.
I did create a very simple pretty print gdb script that would help you debug and see the content under yours JSON objects.
The script is pretty simple and just converts the JSON to a styled string representation with the method Json::Value::toStyledString
Would be good to access each member individually, but it's considered more complex task So if someone already have a better script or even would like to improve mine, I would really appreciate it.
Anyways, to use this script just launch gdb in your program, for example:
It's pretty hard to debug programs with a complex JSON structure such as Json::Value, thinking on that. I did create a very simple pretty print gdb script that would help you debug and see the content under yours JSON objects.
The script is pretty simple and just converts the JSON to a styled string representation with the method Json::Value::toStyledString
Would be good to access each member individually, but it's considered more complex task So if someone already have a better script or even would like to improve mine, I would really appreciate it.
Anyways, to use this script just launch gdb in your program, for example:
compile it
g++ main.cpp -g -O0 -o run
gdb run
source prettyPrint.py
if you try to print val for example, you would see the following output: