[llvm-commits] Asan interception library patch (issue 6010049)
samsonov at google.com
samsonov at google.com
Thu Apr 12 07:22:45 PDT 2012
On 2012/04/12 14:21:26, samsonov wrote:
> http://codereview.appspot.com/6010049/diff/1/interception.h
> File interception.h (right):
> http://codereview.appspot.com/6010049/diff/1/interception.h#newcode78
> interception.h:78: # define DECLARE_WRAPPER(ret_type, convention,
func, ...)
> Naming was not self-explanatory already and now it's even worse :( As
I get it,
> you use DECLARE_WRAPPER(...func...) to define "func" that is:
> 1) alias to an interceptor if instrumented code doesn't define its own
"func"
> 2) breaks linkage if instrumented code does define its own "func"
> Why not call this macro smth like
"ADD_GUARD_AGAINST_CUSTOM_DEFINITION" or smth
> like that.
I mean, "breaks in runtime"
> http://codereview.appspot.com/6010049/diff/1/interception.h#newcode91
> interception.h:91: # define WRAP(x) interception_wrap_##x
> This fails on our output tests: the top stack frame of allocation now
says
> "interception_wrap_malloc" instead of "malloc". Can we use some other
naming?
> http://codereview.appspot.com/6010049/diff/1/interception.h#newcode96
> interception.h:96: __attribute__((weak,
alias("interception_wrap_"#func), \
> alias(WRAPPER_NAME(func)) ?
> http://codereview.appspot.com/6010049/diff/1/interception.h#newcode97
> interception.h:97: visibility("default")))
> You can use INTERCEPTOR_ATTRIBUTE instead of visibility("default")
> http://codereview.appspot.com/6010049/diff/1/interception_linux.h
> File interception_linux.h (right):
http://codereview.appspot.com/6010049/diff/1/interception_linux.h#newcode32
> interception_linux.h:32: (void*)&func, (void*)&WRAP(func))
> I think that
> && (void*)&func == (void*)&WRAP(func)
> would be better.
> Anyway, it's worth explaining this magic in the comment here or in
> interception.h
http://codereview.appspot.com/6010049/
More information about the llvm-commits
mailing list