You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I love the 'json' command, but most of the time I've got JSON stored in NSData objects, not NSStrings, and it barfs on those:
Traceback (most recent call last):
File "/Users/snej/.lldb/MCSLLDBToolkit/mcslldb_helpers.py", line 61, in wrapper
result = function(debugger, *args)
File "/Users/snej/.lldb/MCSLLDBToolkit/mcslldb_commands.py", line 22, in json
pretty_json_string = json_lib.dumps(json_lib.loads(json_string),
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/__init__.py", line 338, in loads
return _default_decoder.decode(s)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py", line 365, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py", line 383, in raw_decode
raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded
The text was updated successfully, but these errors were encountered:
Supporting NSData seems reasonable, but there are two problems with it:
You have to choose encoding (although I'm sure UTF8 is a pretty obvious default).
LLDB doesn't have access to NSUTF8StringEncoding enum.
I added NSData support in de48a31 commit on 1-json-nsdata branch. I'm not sure whether to merge it into master just yet, but you can check this change out. Quit Xcode and run:
cd ~/.lldb/MCSLLDBToolkit
git pull
git checkout 1-json-nsdata
I love the 'json' command, but most of the time I've got JSON stored in NSData objects, not NSStrings, and it barfs on those:
The text was updated successfully, but these errors were encountered: