Giter Site home page Giter Site logo

How can I debug? about pybind11_json HOT 3 CLOSED

pybind avatar pybind commented on July 28, 2024
How can I debug?

from pybind11_json.

Comments (3)

JohanMabille avatar JohanMabille commented on July 28, 2024

If you have an IDE, just google to find how to do it. For intance on Windows MSVC has the PTVSD plugin that allows you to start a python process and break into C++ code.

If you don't use an IDE, std::cout is your best friend. It seems that you have a core dump, so you should be able to read it with gdb and investigate the root cause of the issue.

from pybind11_json.

nyckmaia avatar nyckmaia commented on July 28, 2024

UPDATE 1

I found where the error appears, but I don't have any solution yet.
Apparently, the C++ pugixml library is behaving differently on C++ and Python environment.

Here is the part of my C++ code where I found the different std::cout output:

// Select XML nodes in the path 'myPath' using pugixml library
const pugi::xpath_node_set x = _doc.select_nodes(myPath);

// Get the number of XML nodes in 'myPath'
size_t xSize = x.size();

// Print
std::cout << "xSize: " << xSize << std::endl;

Running in the C++ side:

xSize: 2000

Running in the Python side:

xSize: 0

Do you have any ideas?

from pybind11_json.

nyckmaia avatar nyckmaia commented on July 28, 2024

Sorry, I was passing the wrong argument in the Python function....
Please, forget it...

from pybind11_json.

Related Issues (20)

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.