Replies: 1 comment
-
I came to the conclusion that the problem I was facing was caused by statically linking libstdc++. If I link it dynamically then gdb automatically loads pretty-printers for STL containers defined in libstdc++. I suspect those pretty-printers are required for nlohmann_json pretty-printers to work. Could someone with better knowledge of gdb confirm it? If that is the case then I think that the gdb pretty-printer docs should mention that loading STL pretty-printers is required in order for the nlohmann_json pretty-printer to work. The pretty-printers I loaded in the end:
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, I'm trying to inspect an
nlohmann_json
object in gdb. I'm using this old version of the pretty-printer as I suspect that with the old versions ofnlohmann_json
library and Python that I'm using (nlohmann_json
v3.9.0, Python v3.6.5) it should be working (I can't migrate to newer versions because I'm working with some legacy code).Here is the log of what I am doing:
Quick summary:
json_lookup_function
pretty-printer was succesfully register and I explicitly enabled it yet:p -pretty on -array on -- data_json
outputs hexadecimal values instead of key-value pairsp -pretty on -array on -- data_json["some_key_0"]
returns an errorInvalid cast.
wheres it should print a valid value assome_key_0
is a valid key in thedata_json
object.What am I doing wrong?
Beta Was this translation helpful? Give feedback.
All reactions