View Issue Details

IDProjectCategoryView StatusLast Update
0000955XdebugProfilingpublic2021-04-14 16:03
Reporternajcik Assigned Toderick  
PrioritynormalSeverityfeatureReproducibilityN/A
Status closedResolutionwon't fix 
Summary0000955: provide a profiler API for xdebug
Description

In the .NET world there's something called profiler API. This extension is very low level (in terms of .NET code) but it gives programmers very interesting features: it allows for example to register callbacks on any function, method invocation or property access. It's like events for function calls: onCall, onReturn etc. - with the ProfilerAPI you could for example skip the call, modify its return value, fiddle with its parameters and the like or stub the whole invocation with a function of your choice.
Of course in terms of xdebug it would allow to create listeners to build one's own tool sets for tracking and examining call graphs and the like. Right now we are stuck with the tracking file xdebug generates.
My motivation for such an extension would be different though: one of the limitation of PHP language is that it is very difficult to mock or stub any static, final functions. Such extension would allow for a completely new generation of isolation (mock) frameworks with similar capabilities like those of Typemock Isolator but in the PHP world.

Ideally the hooks could be used from the PHP Code e.g. regular php code to be registered as onCall or onReturn handlers.

TagsNo tags attached.
Operating System
PHP Version5.1.0

Activities

najcik

2013-06-25 13:54

reporter   ~0002523

Here's how the profiler API was exploited at Typemock.
http://osherove.com/videos/2009/8/25/mocking-on-the-edge-isolation-at-the-system-level.html

derick

2016-12-13 21:11

administrator   ~0004045

Are you still interested in this? I have not had anybody else ask about it, and I also don't really feel like this is a debugging tool. It is much more like runkit or something like that.

najcik

2016-12-14 08:55

reporter   ~0004064

Thanks for taking time to review this suggestion.
Well while I appreciate your point that this proposal goes beyond what's traditionally considered a debugging feature on the other hand if a debugger was not able to "peek'n'poke" program variables? By changing a variable value you alternate the control flow. Why would that be so much different from changing the program itself which by the way is considered data as well in some programing paradigms?

derick

2021-03-17 09:21

administrator   ~0005738

Is this issue still relevant to you?

derick

2021-04-14 16:03

administrator   ~0005831

I am closing this out, as there was only ever one request for this.

Issue History

Date Modified Username Field Change
2013-06-25 13:40 najcik New Issue
2013-06-25 13:54 najcik Note Added: 0002523
2016-12-13 21:11 derick Note Added: 0004045
2016-12-13 21:11 derick Assigned To => derick
2016-12-13 21:11 derick Status new => feedback
2016-12-14 08:55 najcik Note Added: 0004064
2016-12-14 08:55 najcik Status feedback => assigned
2020-03-12 16:47 derick Category Feature/Change request => Profiling
2021-03-17 09:21 derick Status assigned => feedback
2021-03-17 09:21 derick Note Added: 0005738
2021-04-14 16:03 derick Status feedback => closed
2021-04-14 16:03 derick Resolution open => won't fix
2021-04-14 16:03 derick Note Added: 0005831