Make gdb.selected_thread().inferior return a new reference
authorMaksim Dzabraev <dzabraew@gmail.com>
Sat, 28 Oct 2017 18:14:34 +0000 (01:14 +0700)
committerSimon Marchi <simon.marchi@ericsson.com>
Sat, 28 Oct 2017 18:19:08 +0000 (14:19 -0400)
commit484d8d361de65a8489252d14511b77c142d859a1
tree247fd9182f1133aa53e6d20dc31babeb2e8f8433
parentd91f0b20e561e326ee91a09a76206257bde8438b
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
gdb/ChangeLog
gdb/python/py-infthread.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.python/py-infthread.exp
This page took 0.030661 seconds and 4 git commands to generate.