试图调试从Python到C ++的PYBIND11。可以设置断点并按顺序击中两侧。
Python中的功能是
pyspiel.load_game
line36
game = pyspiel.load_game('kuhn_poker', {'players': num_players})
试图在C ++方面找到load_game函数,如下
line544 m.def(“ load_game”,
但是这一行中的断点无法击中。
然后尝试将LoadGame定位在下面,但是这里的断点也无法击中。
Line259
std::shared_ptr<const Game> LoadGame(const std::string& short_name,
试图查看呼叫堆栈,然后随机设置一些断点,从Pybind11部分中调用的第一个功能似乎如下。
https://github.com/deepmind/deepmind/deepmind/open_spiel/blob/blob/blob/blob/mbaster/ open_spiel/spiel.h
LINE1062
static std::map<std...
这样做意味着首先调用 loadGame
gamereGisterer
。
我可以在C ++方面了解 loadGame
的开始应该在哪里放置断点。
非常感谢您的建议。
亚历克斯
Trying to debug a pybind11 calling from python to c++. The breakpoints can be setup and hitted in both sides in sequence.
The function in python is
pyspiel.load_game
line36
https://github.com/deepmind/open_spiel/blob/master/open_spiel/python/egt/examples/alpharank_example.py
game = pyspiel.load_game('kuhn_poker', {'players': num_players})
Tried to locate the load_game function in c++ side is LoadGame as below
https://github.com/deepmind/open_spiel/blob/master/open_spiel/python/pybind11/pyspiel.cc
line544m.def("load_game",
But breakpoint in this line cannot be hitted.
Then try to locate LoadGame in as below, but the breakpoint here also cannot be hitted.
https://github.com/deepmind/open_spiel/blob/master/open_spiel/spiel.cc
line259
std::shared_ptr<const Game> LoadGame(const std::string& short_name,
Tried to look into the call stack, and randomly setup some breakpoints, the first function called out of pybind11 portion seems as below.
https://github.com/deepmind/open_spiel/blob/master/open_spiel/spiel.h
line1062
static std::map<std...
Does that means that in LoadGame
the GameRegisterer
is called firstly.
May I learn where should put breakpoint for the start of LoadGame
in c++ side.
Thank you very much for your suggestion.
alex
发布评论