我正在为python开发一个C++扩展。我有一个C语言的库,我用Swig包装它。不幸的是,我有一些错误,我想调试,是在C扩展。我的程序大量使用MsgBuffer类,我通过串行连接发送它。所有消息可能包含多个部分。如果我将一个MsgPart添加到一个MsgBuffer中,那么msg应该复制一个消息,但是现在看起来我正在添加一个引用,因为一旦我修改了部分,添加了修改的部分,初始部分看起来也被修改了。你知道吗
所以我想做的是在我的python程序中设置一个断点并逐步完成调试器。你知道吗
pin = 12 # Pin 12 on Teensy3.2
pullup = False # No need for enabling pull up resistor.
msg = MsgBuffer(TEENSY_REQ_INPUT_PIN)
part= MsgPart()
part.write_uint32(pin)
msg.add_part(part)
part.write_uint32(1 if pullup else 0)
msg.add_part(part) # I would like to set a breakpoint here in order to see whether it is added as reference or it is copied in the c extension
self._serial.write_msg(msg)
我想从python的调试器进入C调试器。我现在的做法是输入一个输入('press enter')并在进程中附加一个C调试器,但我发现这很不方便。我想进入python的扩展,这可能吗?你知道吗
目前没有回答
相关问题 更多 >
编程相关推荐