문제

I loaded in python a C library X.so, that I compiled with these flags.

GDBFLAGS = -gdwarf-2 -g3 -O0 -ggdb

and I call some of its non-static functions from python , using ctypes.

I wish debugging the C library X.so. Some function from X.so crashes sometimes, not all the time, and I wish monitoring the execution using gdb.

I use linux-gnu. How can I debug ctypes ?

도움이 되었습니까?

해결책

Use "gdb python" and run your program as usual. Then when it crashes, debug as normal.

BTW I recommend using just "-g3". Don't use "-gdwarf-2", this does the wrong thing nowadays -- DWARF 2 is quite old actually and the default is newer now.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top