I'm developing a C(++) extension for python. I have a library in C that I wrap using Swig. Unfortunately I have some error that I would like to debug that is within the C extension. My program makes heavy use of MsgBuffer class which I send over a serial connection. All the messages may contain multiple parts. If I add a MsgPart to a MsgBuffer, then the msg should make a copy of the message, but currently it looks like I'm adding a reference, because once I modify the part, add the modified part, the initial part looks like it is modified as well.
So What I would like to do is set a breakpoint in my python program and step through the debugger.
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)
I would like to step from python's debugger into a C debugger. How I now currently do this is to put a input('press enter') and attach a C debugger to the process, but I find this inconvenient. I would like to step into the extension from python, is this possible?