binutils-gdb/gdb/python
Maksim Dzabraev 484d8d361d Make gdb.selected_thread().inferior return a new reference
thpy_get_inferior function should return a new reference to the
existing inferior object, and therefore should increment its refcount.

Fixed bug looks like this.
If multiple time call gdb.selected_thread ().inferior, gdb throws exception:

(gdb) pi gdb.selected_thread().inferior
<gdb.Inferior object at 0x7f1952bea698>
(gdb) pi gdb.selected_thread().inferior
Python Exception <type 'exceptions.AttributeError'> 'NoneType' object
has no attribute 'inferior':
Error while executing Python code.
(gdb) info threads
  Id   Target Id         Frame
* 1    Thread 0x7f54f0474740 (LWP 584) "mc" 0x00007f54ef055c33 in
2017-10-28 14:19:08 -04:00
..
lib/gdb
py-all-events.def Make it simpler to add events to Python 2017-09-11 14:15:22 -06:00
py-arch.c
py-auto-load.c
py-block.c
py-bpevent.c Make it simpler to add events to Python 2017-09-11 14:15:22 -06:00
py-breakpoint.c Constify some linespec functions 2017-09-27 08:44:45 -06:00
py-cmd.c Add add_cmd function overloads 2017-09-27 08:44:14 -06:00
py-continueevent.c Make it simpler to add events to Python 2017-09-11 14:15:22 -06:00
py-event-types.def Make it simpler to add events to Python 2017-09-11 14:15:22 -06:00
py-event.c Small event ownership clean up in Python layer 2017-09-11 14:15:21 -06:00
py-event.h Make it simpler to add events to Python 2017-09-11 14:15:22 -06:00
py-events.h Make it simpler to add events to Python 2017-09-11 14:15:22 -06:00
py-evtregistry.c
py-evts.c Make it simpler to add events to Python 2017-09-11 14:15:22 -06:00
py-exitedevent.c Make it simpler to add events to Python 2017-09-11 14:15:22 -06:00
py-finishbreakpoint.c
py-frame.c Remove cleanups from find_frame_funname 2017-09-11 16:15:11 -06:00
py-framefilter.c
py-function.c
py-gdb-readline.c
py-inferior.c Add `thread_from_thread_handle' method to (Python) gdb.Inferior 2017-09-21 11:20:51 -07:00
py-infevents.c Make it simpler to add events to Python 2017-09-11 14:15:22 -06:00
py-infthread.c Make gdb.selected_thread().inferior return a new reference 2017-10-28 14:19:08 -04:00
py-instruction.c
py-instruction.h
py-lazy-string.c
py-linetable.c
py-newobjfileevent.c Make it simpler to add events to Python 2017-09-11 14:15:22 -06:00
py-objfile.c
py-param.c
py-prettyprint.c
py-progspace.c
py-record-btrace.c
py-record-btrace.h
py-record-full.c
py-record-full.h
py-record.c
py-record.h
py-ref.h
py-signalevent.c Make it simpler to add events to Python 2017-09-11 14:15:22 -06:00
py-stopevent.c Make it simpler to add events to Python 2017-09-11 14:15:22 -06:00
py-stopevent.h Small event ownership clean up in Python layer 2017-09-11 14:15:21 -06:00
py-symbol.c
py-symtab.c
py-threadevent.c Make it simpler to add events to Python 2017-09-11 14:15:22 -06:00
py-type.c
py-unwind.c
py-utils.c
py-value.c Stop assuming no-debug-info functions return int 2017-09-04 20:21:13 +01:00
py-varobj.c
py-xmethods.c
python-config.py
python-internal.h Add `thread_from_thread_handle' method to (Python) gdb.Inferior 2017-09-21 11:20:51 -07:00
python.c Constify add_prefix_cmd 2017-10-11 16:21:02 -06:00
python.h