[PATCH 1/3] python: Add Inferior.progspace property

Simon Marchi simon.marchi@polymtl.ca
Wed Sep 12 22:22:00 GMT 2018


On 2018-09-12 17:42, Tom Tromey wrote:
>>>>>> "Simon" == Simon Marchi <simon.marchi@ericsson.com> writes:
> 
> Simon> This patch adds a progspace property to the gdb.Inferior type, 
> which
> Simon> allows getting the gdb.Progspace object associated to that 
> inferior.
> Simon> In conjunction with the following patch, this will allow scripts 
> iterate
> Simon> on objfiles associated with a particular inferior.
> 
> I did this a long time ago, plus a bit more.
> I think it would be good to compare approaches.
> 
> Old thread here:
> https://sourceware.org/ml/gdb-patches/2014-06/msg00616.html
> 
> I rebaesd it - see the python/progspace-submit branch in my github.
> I haven't re-tested it yet.

Oh wow, that's much more complete than what I have.  I also spotted some 
other areas of improvement, but I know that if I try to bite too much in 
one go I never finish and submit what I have.  That's why I sent just 
these two by themselves.

If you intend on finishing and submitting that patch I'll drop mine.  
Otherwise, I'll go ahead and maybe submit yours chunk by chunk, adding 
tests in the process.

As far as the gdb.Inferior.progspace part is concerned, our two versions 
are essentially identical.

> Simon> While modifying py-inferior.exp, I added some checks for the 
> other
> Simon> Inferior properties, when the Inferior is no longer valid.  This 
> doesn't
> Simon> seem tested at the moment.
> 
> This could go in immediately if you were so inclined.

Ok, I'll push an obvious patch for that.

Simon



More information about the Gdb-patches mailing list