binutils-gdb/gdb/python
Tom Tromey eb11506932 Add scoped_value_mark
This adds a scoped_value_mark class, that records the value mark in
the constructor and then calls value_free_to_mark in the destructor.
It then updates various spots in gdb to use this class, rather than a
cleanup.

It would be better overall to replace "struct value *" with a
shared_ptr, maybe eliminating the need for this class (watchpoints
would perhaps need some new mechanism as well).  However, that's
difficult to do.

2017-01-10  Tom Tromey  <tom@tromey.com>

	* python/py-value.c (valpy_dereference, valpy_referenced_value)
	(valpy_reference_value, valpy_const_value, valpy_get_address)
	(valpy_get_dynamic_type, valpy_lazy_string, valpy_do_cast)
	(valpy_getitem, valpy_call, valpy_binop_throw, valpy_negative)
	(valpy_absolute, valpy_richcompare_throw): Use scoped_value_mark.
	* dwarf2loc.c (dwarf2_loc_desc_get_symbol_read_needs): Use
	scoped_value_mark.
	* dwarf2-frame.c (execute_stack_op): Use scoped_value_mark.
	* value.h (scoped_value_mark): New class.
2017-01-10 19:14:12 -07:00
..
lib/gdb
py-arch.c Use gdbpy_ref in archpy_disassemble 2017-01-10 19:13:59 -07:00
py-auto-load.c
py-block.c
py-bpevent.c
py-breakpoint.c Use gdbpy_ref in gdbpy_breakpoint_cond_says_stop 2017-01-10 19:14:00 -07:00
py-cmd.c Use gdbpy_ref in py-cmd.c 2017-01-10 19:14:01 -07:00
py-continueevent.c
py-event.c
py-event.h
py-events.h
py-evtregistry.c
py-evts.c
py-exitedevent.c
py-finishbreakpoint.c Use gdbpy_ref in bpfinishpy_out_of_scope 2017-01-10 19:14:01 -07:00
py-frame.c
py-framefilter.c Use gdbpy_ref rather than make_cleanup_py_decref 2017-01-10 19:14:07 -07:00
py-function.c Use gdbpy_enter in fnpy_call 2017-01-10 19:13:53 -07:00
py-gdb-readline.c
py-inferior.c Use gdbpy_ref in py-inferior.c 2017-01-10 19:14:03 -07:00
py-infevents.c
py-infthread.c
py-lazy-string.c Change type of encoding argument to gdbpy_extract_lazy_string 2017-01-10 19:13:55 -07:00
py-linetable.c Use gdbpy_ref in py-linetable.c 2017-01-10 19:13:34 -07:00
py-newobjfileevent.c
py-objfile.c Use class to manage BFD reference counts 2017-01-10 19:14:10 -07:00
py-param.c Use gdbpy_ref in py-param.c 2017-01-10 19:14:04 -07:00
py-prettyprint.c Use gdbpy_ref in py-prettyprint.c 2017-01-10 19:13:58 -07:00
py-progspace.c Use gdbpy_enter in py-progspace.c 2017-01-10 19:13:42 -07:00
py-ref.h Add gdb_ref_ptr.h 2017-01-10 19:14:09 -07:00
py-signalevent.c
py-stopevent.c
py-stopevent.h
py-symbol.c Use gdbpy_ref in gdbpy_lookup_symbol 2017-01-10 19:13:38 -07:00
py-symtab.c
py-threadevent.c
py-type.c Use gdbpy_enter in py-type.c 2017-01-10 19:13:44 -07:00
py-unwind.c Use gdbpy_ref in pyuw_object_attribute_to_pointer 2017-01-10 19:14:05 -07:00
py-utils.c Remove make_cleanup_py_decref and make_cleanup_py_xdecref 2017-01-10 19:14:08 -07:00
py-value.c Add scoped_value_mark 2017-01-10 19:14:12 -07:00
py-varobj.c Use gdbpy_enter_varobj in py-varobj.c 2017-01-10 19:13:51 -07:00
py-xmethods.c Use gdbpy_enter in py-xmethod.c 2017-01-10 19:13:50 -07:00
python-config.py
python-internal.h Remove make_cleanup_py_decref and make_cleanup_py_xdecref 2017-01-10 19:14:08 -07:00
python.c Use gdbpy_ref in python.c 2017-01-10 19:14:04 -07:00
python.h