Coder Social home page Coder Social logo

lonewanderer-gh / nlohmann-json-gdb Goto Github PK

View Code? Open in Web Editor NEW
14.0 3.0 1.0 4.57 MB

Provides gdb script and python gdb script to pretty print a nlohmann / json (https://github.com/nlohmann/json)

License: MIT License

GDB 1.62% C++ 95.62% Python 2.76%
gdb nlohmann-json json gdb-pretty-printers gdb-python-scripts cpp

nlohmann-json-gdb's People

Contributors

lonewanderer-gh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

yippeexu

nlohmann-json-gdb's Issues

.gdbinit instructions?

can you add the lines needed to automatically load this from .gdbinit? please assume zero python knowledge.

nlohmann_json.py needs "import gdb.printing"

I have downloaded nlohmann_json.py file, and in gdb, I have errors:

(gdb) source nlohmann_json.py 
PLATFORM_BITS 64
### Log info types output : All types matching regular expression "^nlohmann::basic_json<.*>$":
### Log info types output : 
### Log info types output : File ./headers/json.h:
### Log info types output : nlohmann::basic_json<std::map, std::vector, std::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> > >;

--------The researched nlohmann::basic_json type for this executable is---------
nlohmann::basic_json<std::map, std::vector, std::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> > >
(Using regex: ^nlohmann::basic_json<.*>$)
--------------------------------------------------------------------------------

Traceback (most recent call last):
  File "nlohmann_json.py", line 375, in <module>
    gdb.printing.register_pretty_printer(
AttributeError: 'module' object has no attribute 'printing'

And then, I add this line in it

import gdb.printing

It is OK

(gdb) source nlohmann_json.py 
PLATFORM_BITS 64
### Log info types output : All types matching regular expression "^nlohmann::basic_json<.*>$":
### Log info types output : 
### Log info types output : File ./headers/json.h:
### Log info types output : nlohmann::basic_json<std::map, std::vector, std::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> > >;

--------The researched nlohmann::basic_json type for this executable is---------
nlohmann::basic_json<std::map, std::vector, std::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> > >
(Using regex: ^nlohmann::basic_json<.*>$)
--------------------------------------------------

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.