[aspectc-user] Help about detcting new operator and the line and fle name where it is executed ?
hdhiab at gmail.com
Tue Dec 15 21:55:05 CET 2009
Hello every body ..
I'm developing a debugger for C++ dynamicly memory allocated with aspectC++.
So i have to detect each execution of NEW and NEW  opertors. For this, i
did the 'NewDetectionAspect' aspect.
The aspect working well, but i want to change the comportment of New
operator for return two arguments, the first is the line where New/New 
operator was executed, and the second is the file where it is executed.
I did an sample but without an aspect, it's just with basic C++ lass and a
header, some one can help me for integrate this changement in an aspect ??
change New operator Prototype by adding two arguments for line and file in
a header file *"halloc.h": *
# include <string.h>
# include <new>
void* operator new (size_t size, const char* nom_fich, const unsigned
#define new new (__FILE__, __LINE__)
And develop it in *hello.cpp:*
void* operator new (size_t size, const char* nom, const unsigned longligne)
void*ptr= new char;
printf ("%s:%lu - ",nom, ligne);
return ptr;// MallocSecurise (size, nom, ligne);
Some one can help me for resolve this problem, and made an
aspect/advice/slice for detect the line and the file for a new operator ??
Thank u very much, Heni.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the aspectc-user