You can, instead, step through in the appropriate frame until you reach the statement you're interested in. If you continue on, the rest of the program will run normally. #9 PyRun_FileExFlags (fp=0x89ad60, filename=0x7fffffffb5b4 "signal_test.py", #5 PyEval_EvalFrameEx (f=0x8ac560, throwflag=) at Python/ceval.c:2665 #3 PyEval_EvalFrameEx (f=0x8aca30, throwflag=) at Python/ceval.c:2665 You can then look at a backtrace: (gdb) backtrace Program received signal SIGUSR1, User defined signal 1.Ġx0000003d340306f7 in kill () from /lib64/libc.so.6 Warning: no loadable sections found in added symbol-file system-supplied DSO at 0x2aaaaaaab000 Starting program: /net/gs/vol3/software/modules-sw/python/2.7/Linux/RHEL5/x86_64/bin/python signal_test.py Reading symbols from /net/gs/vol3/software/modules-sw/python/2.7/Linux/RHEL5/x86_64/bin/python.done.Īnd when you run it, it will go until you reach the call to kill(): (gdb) run This GDB was configured as "x86_64-redhat-linux-gnu".įor bug reporting instructions, please see: There is NO WARRANTY, to the extent permitted by law. This is free software: you are free to change and redistribute it. License GPLv3+: GNU GPL version 3 or later GNU gdb (GDB) Red Hat Enterprise Linux (7.0.1-37.el5_7.1)Ĭopyright (C) 2009 Free Software Foundation, Inc. Then you can run it under gdb: $ gdb -args python signal_test.py Signal.signal(signal.SIGUSR1, do_nothing) So - is what I want to do, at all possible with gdb and if not, what other alternatives would I have for something similar? and while the entire Python script does run within gdb, the breakpoint is simply never reached. Starting program: /usr/bin/python test.py Make breakpoint pending on future shared library load? (y or ) y Reading symbols from /usr/bin/python.(no debugging symbols found).done. The problem is: gdb on its own cannot really recognize breakpoints, placed on a Python script line: $ gdb python ( Note that DebuggingWithGdb - PythonInfo Wiki doesn't really explicitly state that this is possible) so) library - hence, I'd ideally place a breakpoint on a Python code line, and then "step into" the C part of the shared object. Now, I'd like to use gdb for this, because I'd like to debug Python bindings that may come as a part of a shared object (. and say, I'd like to debug this script by placing a breakpoint at line a=10, and then stepping through the script. Let's say we have the following mega-simple Python script: print "Initializing".
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |