This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Level to do such a modification...


I know valgrind, it is an emulator ,but we are restricted not to use
an emulator. :-(

2007/1/24, Nicholas Nethercote <njn@csse.unimelb.edu.au>:
On Wed, 24 Jan 2007, [GB2312] ÎâêØ wrote:

> I am working on gcc 4.0.0. I want to use gcc to intercept each call to
> read, and taint the data readed in. For example:
> transform
>       read(fd, buf, size)
> to
>       read(fd, buf, size)
>       if(is_socket(fd))
>               taint(buf, size)
> So, what is the best suitable level to do this modification in gcc? My
> own thought is in finish_function, before calling c_genericize,as I
> discovered that in c front-end, there's no GENERIC tree... In
> c_genericize, it directly calls gimplify_function_tree.

Are you sure you want to do this in GCC?  You might find it easier to use a
dynamic binary instrumentation framework such as Valgrind or Pin to do this
kind of thing.

Nick



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]