|
From: Sébastien S. <sa...@us...> - 2008-02-19 14:00:47
|
Hi Josef, Josef Weidendorfer a écrit : > Ok. From an more abstract view point, "ELF object" and "Source File" are > just different groupings of functions. For the python functions, you chose > to make these groupings equal. And the benefit would be that independent > of whether you want to see the "ELF object" or "Source File" grouping for > your C functions, you simultaneous get the "Python Source" grouping. Yes? Yes, exactly; it is just for practical reasons. It provides a different way of sorting functions. >> I am going to try to explain what I did: >> >> PyEval_EvalFrameEx, PyObject_CallMethod, PyObject_Call >> ... > > OK, now I hope I understand. Great. > Am I right to say that your additions are specific to a given python implementation > (the function names to catch etc.). Or is there some official specification which > says that every implementation of a python interpreter has to call these functions > on the given conditions with exactly this name? > Further, you take a stack value and cast it to some python structure to get the > function/file names. This also seems to be very specific to the given python > implementation, as well as specific to the ABI of the current architecture (e.g. > the patch probably would be different on x86-64). You are right; The additions I did are specific to CPython 2.5.1 and need to be recompiled to match the ABI of the architecture. That being said, the Python C API is rather stable so provided that you recompile it with the right version of headers, the patch should work as is with Python 2.4 or only require some minimal changes (possibily also with 2.3). I didn't have time to improve the patch yet, but I have plenty of ideas to so. regards -- Sébastien Sablé |