In one embodiment, a method is provided for use in a system which includes
a target application, a profiler application and a debugging application,
the profiler application being operative to attach to the target
application and, upon attaching to the target application, performing
operations to profile the target application, the debugging application
being operative to monitor the target application. The method comprises
attaching, by the profiler application, to the target application such
that operations performed by the profiler application in profiling the
target application are susceptible to monitoring by the debugging
application. In one embodiment, the method further comprises generating
helper code; transferring the helper code to the memory used by the
target application; and causing the helper code to be executed from the
memory used by the target application, wherein the helper code, when
executed, causes the profiler agent library to be loaded to the memory
used by the target application.