Debug libtorch while developing C++ extension for PyTorch

Kindly read the detailed issue reproduction steps from Mixed mode Python C++ debug issue with PyTorch and libtorch.

This is currently my problem: I am unable to look inside the ScriptModule object received at the C++ side from the Python side. Is there some specific configuration that I need to use while building the project? The libtorch documentation is way too limited for this.