<meta name="robots" content="noindex" /> ---++ <img alt="MLSA_logo.png" height="44" src="%ATTACHURL%/MLSA_logo.png" title="MLSA_logo.png" width="65" /> Future Work - Extension of the RDA analysis for more complex interoperability aPIs, including use of DATALOG for analysis - More extensive testing and comparisons of the CGs generated with those for existing CG tools - Handling other ways of calling Python * PyAPI _FUNC(int) PyRun _AnyFileExFlags(FILE *fp, const char *filename, int, PyCompilerFlags *); * Also PyRun _AnyFile or PyRun _AnyFileEx or PyRun _AnyFileFlags * if FP is associated with an interactive device, return PyRun _InteractiveLoop(); else return the result of PyRun _SimpleFile(). * IF filename is NULL, the function uses "???" as the filename * PyAPI _FUNC(int) PyRun _SimpleStringFlags(const char * command, PyCompilerFlags *); * also PyRun _SimpleString * "command" is the python command(s) to be executed. The function will create a __main__ function to add and run what is defined in "command" * the string can be filtered to find default Python functions * using a default name for this kind of python call to represent it in the graph (numbered default name to differ calls) * PyAPI _FUNC(int) PyRun _InteractiveOneFlags(FILE *fp, const char *filename, PyCompilerFlags *); * also PyRun _InteractiveOne * fp is an interactive device (console, terminal) and filename is the name of the file * executes only ONE statement from "filename" * PyAPI _FUNC(int) PyRun _InteractiveLoopFlags(FILE *fp, const char *filename, PyCompilerFlags *); * Also PyRun _InteractiveLoop * fp is an interactive device (console, terminal) and filename is the name of the file * executes statements from "filename" * PyAPI _FUNC(PyObject *) PyRun _StringFlags(const char *str, int start, PyObject *globals, PyObject *locals, PyCompilerFlags *); * Also PyRun _String * runs "str" in the context specified by "globals" and "locals" * create a default function name for this kind of call, then use it as nodes in the graph * PyAPI _FUNC(PyObject *) PyRun _FileExFlags(FILE *, const char *, int, PyObject *, PyObject *, int, PyCompilerFlags *); * Also PyRun _File or PyRun _FileExFlags or PyRun _FileExFlags * Python source code is read from fp, and filename is the name of the file. All these methods use a string as identifier to modules or commands. It should not be difficult to identify functions and analyze them. They are also similar to "PyRun_SimpleFile", which is already implemented . * Pure Embedding (most safe and complete way of calling python) * see for the original code: https://docs.python.org/3/extending/embedding.html * Process: * pModule = PyImport _Import(PyObject *pName); * pName comes from converting C string to Python Object using Python.h interface. It is the name of the module(file) to open. * pFunc = PyObject _GetAttrString(PyObject *pModule, const char *func); * func is the name of the function inside the module. * pValue = PyObject _CallObject(PyObject *pFunc, PyObject *pArgs); * pArgs is the list of arguments. pValue is the return value of the function. It must be converted to a C type The problem with this approach is that there are multiple conversions and attributions before getting the reference to the function. A Reaching Definition Analysis is necessary to find the intermediate values. There is a pattern for the steps to be performed, and it also gives more information about the function and the module. So it will make it easier to resolve scoping issues. ---++++ Future work for Pybind11 1 Handling of C++ defined function import rather than whole C++ module import in Python file.( E.g., _from example import Pet_) 1 Handling situation where the function is defined in the pybind11 binding statement. (E.g., _m.def("add",[](int a){ return a+a;})_ <font face="Liberation Serif, serif"><i>)</i></font> 1 Handling cases of function overloading i.e., more than one function defined with the same name but different parameters. ---++ Permissions * Persons/group who can view/change the page: * Set ALLOWTOPICCHANGE = FRCVRoboticsGroup -- (c) Fordham University Robotics and Computer Vision
Attachments
Attachments
Topic attachments
I
Attachment
History
Action
Size
Date
Who
Comment
png
MLSA_logo.png
r1
manage
38.5 K
2017-07-12 - 19:29
AnneMarieBogar
This topic: Main
>
WebHome
>
FordhamRoboticsAndComputerVisionLaboratory
>
FRCVPublicProject
>
FRCVLabMLSA
>
FRCVLabMLSA_future
Topic revision: r3 - 2019-05-29 - LabTech
Copyright © 2008-2025 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki?
Send feedback