binutils-gdb/gdb/python
Pierre-Marie de Rodat f495252396 Fix use of a dangling pointer for Python breakpoint objects
When a Python script tries to create a breakpoint but fails to do so,
gdb.Breakpoint.__init__ raises an exception and the breakpoint does not
exist anymore in the Python interpreter. However, GDB still keeps a
reference to the Python object to be used for a later hook, which is
wrong.

This commit adds the necessary cleanup code so that there is no stale
reference to this Python object. It also adds a new testcase to
reproduce the bug and check the fix.

2016-06-25  Pierre-Marie de Rodat  <derodat@adacore.com>

gdb/
	* python/py-breakpoint.c (bppy_init): Clear bppy_pending_object
	when there is an error during the breakpoint creation.

gdb/testsuite

	* gdb.python/py-breakpoint-create-fail.c,
	gdb.python/py-breakpoint-create-fail.exp,
	gdb.python/py-breakpoint-create-fail.py: New testcase.
2016-06-27 12:11:25 +02:00
..
lib/gdb PR gdb/16483 - simplify "info frame-filters" output 2016-06-23 07:56:35 -06:00
py-arch.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-auto-load.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-block.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-bpevent.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-breakpoint.c Fix use of a dangling pointer for Python breakpoint objects 2016-06-27 12:11:25 +02:00
py-cmd.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-continueevent.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-event.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-event.h GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-events.h GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-evtregistry.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-evts.c remove trivialy unused variables 2016-05-07 20:12:53 -04:00
py-exitedevent.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-finishbreakpoint.c remove trivialy unused variables 2016-05-07 20:12:53 -04:00
py-frame.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-framefilter.c remove trivialy unused variables 2016-05-07 20:12:53 -04:00
py-function.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-gdb-readline.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-inferior.c remove trivialy unused variables 2016-05-07 20:12:53 -04:00
py-infevents.c remove trivialy unused variables 2016-05-07 20:12:53 -04:00
py-infthread.c remove trivialy unused variables 2016-05-07 20:12:53 -04:00
py-lazy-string.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-linetable.c remove trivialy unused variables 2016-05-07 20:12:53 -04:00
py-newobjfileevent.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-objfile.c Fix PR python/19438, PR python/18393 - initialize dictionaries 2016-05-23 10:08:34 -06:00
py-param.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-prettyprint.c Support structure offsets that are 512K or larger. 2016-06-24 21:02:36 -04:00
py-progspace.c Fix PR python/19438, PR python/18393 - initialize dictionaries 2016-05-23 10:08:34 -06:00
py-signalevent.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-stopevent.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-stopevent.h GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-symbol.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-symtab.c remove trivialy unused variables 2016-05-07 20:12:53 -04:00
py-threadevent.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-type.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-unwind.c remove trivialy unused variables 2016-05-07 20:12:53 -04:00
py-utils.c python/py-utils.c (host_string_to_python_string): New function. 2016-03-29 23:48:35 -07:00
py-value.c fix spelling of HAVE_LIBPYTHON2_4 in py-value.c 2016-05-25 07:54:44 -06:00
py-varobj.c remove trivialy unused variables 2016-05-07 20:12:53 -04:00
py-xmethods.c PR python/19819 - remove unused globals from py-xmethods.c 2016-06-09 14:29:21 -06:00
python-config.py
python-internal.h Support structure offsets that are 512K or larger. 2016-06-24 21:02:36 -04:00
python.c Make gdbpy_parameter static 2016-06-23 20:44:48 -06:00
python.h GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00