Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to invoke accessors on json objects in lldb #1745

Closed
sbroberg opened this issue Sep 9, 2019 · 1 comment
Closed

Unable to invoke accessors on json objects in lldb #1745

sbroberg opened this issue Sep 9, 2019 · 1 comment
Labels
state: stale the issue has not been updated in a while and will be closed automatically soon unless it is updated

Comments

@sbroberg
Copy link

sbroberg commented Sep 9, 2019

Is there something I need to do to be able to interactively query the state of the json objects while debugging in lldb? For example, this sample program produces output as expected

#include "json.h"

int main(int argc, char **argv)
{
    json j;
    j["a"] = 1;
    j["b"] = "foo";
    j["c"] = 3;

    for (json::const_iterator element = j.begin(); element != j.end(); ++element) {
        std::cout << element.key() << ": " << element.value() << std::endl;
    }
}

but if I set a breakpoint on the "cout" line, attempting print the value of element.key() produces the error:

(lldb) print element.key()
error: Couldn't lookup symbols:
  __ZNK8nlohmann6detail9iter_implIKNS_10basic_jsonIT_S3_NSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEEbxydS3_S3_EEE3keyEv

I'm currently compiling with -O0 and and -g, but I've also tried all combinations of -fno-inline -mllvm -inline-threshold=1, as well as explicitly instantiating the template with:

template class nlohmann::basic_json<
  std::__1::map,
  std::__1::vector,
  std::__1::basic_string< char, std::__1::char_traits< char >, std::__1::allocator< char > >,
  bool,
  long long,
  unsigned long long,
  double,
  std::__1::allocator,
  nlohmann::adl_serializer >;
@stale
Copy link

stale bot commented Oct 9, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the state: stale the issue has not been updated in a while and will be closed automatically soon unless it is updated label Oct 9, 2019
@stale stale bot closed this as completed Oct 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state: stale the issue has not been updated in a while and will be closed automatically soon unless it is updated
Projects
None yet
Development

No branches or pull requests

1 participant