Re: Update and Questions on CPython Extension Module -fanalyzer plugin development

2023-08-07 Thread David Malcolm via Gcc
On Mon, 2023-08-07 at 14:31 -0400, Eric Feng wrote: > On Fri, Aug 4, 2023 at 6:46 PM David Malcolm > wrote: > > > > On Fri, 2023-08-04 at 18:42 -0400, David Malcolm wrote: > > > On Fri, 2023-08-04 at 16:48 -0400, Eric Feng wrote: > > > > On Fri, Aug 4, 2023 at 11:39 AM David Malcolm > > > > > >

Re: Update and Questions on CPython Extension Module -fanalyzer plugin development

2023-08-07 Thread Eric Feng via Gcc
On Fri, Aug 4, 2023 at 6:46 PM David Malcolm wrote: > > On Fri, 2023-08-04 at 18:42 -0400, David Malcolm wrote: > > On Fri, 2023-08-04 at 16:48 -0400, Eric Feng wrote: > > > On Fri, Aug 4, 2023 at 11:39 AM David Malcolm > > > wrote: > > > > > > > > On Fri, 2023-08-04 at 11:02 -0400, Eric Feng

Re: Update and Questions on CPython Extension Module -fanalyzer plugin development

2023-08-04 Thread David Malcolm via Gcc
On Fri, 2023-08-04 at 18:42 -0400, David Malcolm wrote: > On Fri, 2023-08-04 at 16:48 -0400, Eric Feng wrote: > > On Fri, Aug 4, 2023 at 11:39 AM David Malcolm > > wrote: > > > > > > On Fri, 2023-08-04 at 11:02 -0400, Eric Feng wrote: > > > > Hi Dave, > > > > > > > > Tests related to our plugin

Re: Update and Questions on CPython Extension Module -fanalyzer plugin development

2023-08-04 Thread David Malcolm via Gcc
On Fri, 2023-08-04 at 16:48 -0400, Eric Feng wrote: > On Fri, Aug 4, 2023 at 11:39 AM David Malcolm > wrote: > > > > On Fri, 2023-08-04 at 11:02 -0400, Eric Feng wrote: > > > Hi Dave, > > > > > > Tests related to our plugin which depend on Python-specific > > > definitions have been run by

Re: Update and Questions on CPython Extension Module -fanalyzer plugin development

2023-08-04 Thread Eric Feng via Gcc
On Fri, Aug 4, 2023 at 11:39 AM David Malcolm wrote: > > On Fri, 2023-08-04 at 11:02 -0400, Eric Feng wrote: > > Hi Dave, > > > > Tests related to our plugin which depend on Python-specific > > definitions have been run by including /* { dg-options "-fanalyzer > > -I/usr/include/python3.9" } */.

Re: Update and Questions on CPython Extension Module -fanalyzer plugin development

2023-08-04 Thread David Malcolm via Gcc
On Fri, 2023-08-04 at 11:02 -0400, Eric Feng wrote: > Hi Dave, > > Tests related to our plugin which depend on Python-specific > definitions have been run by including /* { dg-options "-fanalyzer > -I/usr/include/python3.9" } */. This is undoubtedly not ideal; is it > best to approach this

Re: Update and Questions on CPython Extension Module -fanalyzer plugin development

2023-08-04 Thread Eric Feng via Gcc
Hi Dave, Tests related to our plugin which depend on Python-specific definitions have been run by including /* { dg-options "-fanalyzer -I/usr/include/python3.9" } */. This is undoubtedly not ideal; is it best to approach this problem by adapting a subset of relevant definitions like in gil.h?

Re: Update and Questions on CPython Extension Module -fanalyzer plugin development

2023-08-01 Thread David Malcolm via Gcc
On Tue, 2023-08-01 at 09:57 -0400, Eric Feng wrote: > > > > My guess is that you were trying to do it from the > > PLUGIN_ANALYZER_INIT > > hook rather than from the plugin_init function, but it's hard to be > > sure without seeing the code. > > > > Thanks Dave, you are entirely right — I made

Re: Update and Questions on CPython Extension Module -fanalyzer plugin development

2023-08-01 Thread Eric Feng via Gcc
> > My guess is that you were trying to do it from the PLUGIN_ANALYZER_INIT > hook rather than from the plugin_init function, but it's hard to be > sure without seeing the code. > Thanks Dave, you are entirely right — I made the mistake of trying to do it from PLUGIN_ANALYZER_INIT hook and not

Re: Update and Questions on CPython Extension Module -fanalyzer plugin development

2023-07-30 Thread David Malcolm via Gcc
On Sun, 2023-07-30 at 13:52 -0400, Eric Feng wrote: > [...] > > As noted in our chat earlier, I don't think we can easily make > > these > > work.  Looking at CPython's implementation: PyList_Type's > > initializer > > here: > >

Re: Update and Questions on CPython Extension Module -fanalyzer plugin development

2023-07-30 Thread Eric Feng via Gcc
[...] > As noted in our chat earlier, I don't think we can easily make these > work. Looking at CPython's implementation: PyList_Type's initializer > here: > https://github.com/python/cpython/blob/main/Objects/listobject.c#L3101 > initializes tp_flags with the flags, but: > (a) we don't see that

Re: Update and Questions on CPython Extension Module -fanalyzer plugin development

2023-07-27 Thread David Malcolm via Gcc
On Thu, 2023-07-27 at 18:13 -0400, Eric Feng wrote: > Hi Dave, > > Thanks for the comments! > > [...] > > Do you have any DejaGnu tests for this functionality?  For example, > > given PyList_New > >   https://docs.python.org/3/c-api/list.html#c.PyList_New > > there could be a test like: > > > >

Re: Update and Questions on CPython Extension Module -fanalyzer plugin development

2023-07-27 Thread Eric Feng via Gcc
Hi Dave, Thanks for the comments! [...] > Do you have any DejaGnu tests for this functionality? For example, > given PyList_New > https://docs.python.org/3/c-api/list.html#c.PyList_New > there could be a test like: > > /* { dg-require-effective-target python_h } */ > > #define

Re: Update and Questions on CPython Extension Module -fanalyzer plugin development

2023-07-25 Thread David Malcolm via Gcc
On Tue, 2023-07-25 at 00:49 -0400, Eric Feng wrote: > Hi all, Hi Eric, thanks for the update. Various comments inline below... > > I would like to update everyone on the progress of the static > analyzer > plugin for CPython extension module code. > Since the last update, I > have implemented

Update and Questions on CPython Extension Module -fanalyzer plugin development

2023-07-24 Thread Eric Feng via Gcc
Hi all, I would like to update everyone on the progress of the static analyzer plugin for CPython extension module code. Since the last update, I have implemented known function subclasses for PyList_New and PyList_Append. The existing known function subclasses have also been enhanced to provide