Thanks a lot for the detailed instruction Alexander, but unfortunately I 
will have to stick with gcc as it is only the one currently supported on 
the system I am using.
I will try to find the equivalent information for gcc and work on that.

Thanks again,
Fakharu

On Monday, February 12, 2024 at 2:39:32 AM UTC-8 Alexander Potapenko wrote:

> Hi Fakharu,
>
> you don't mention the compiler you want to modify, but I advise you to
> use Clang.
> The instrumentation is implemented in AddressSanitizer.cpp
> (https://llvm.org/doxygen/AddressSanitizer_8cpp_source.html), and the
> function that actually adds instrumentation is called
> AddressSanitizer::instrumentAddress().
> You may also look at the loops in
> AddressSanitizer::instrumentFunction() that collect the
> instructions/operands to instrument based on their type.
>
> Make sure to familiarize yourself with
> https://llvm.org/docs/LangRef.html so that you understand how LLVM
> intermediate representation is organized.
>
> You can either construct your instrumentation code in the compiler
> pass (especially if you need it to be fast), or you can put it into
> the runtime library, and use out-of-line instrumentation based on
> calls (enabled with `-mllvm
> -asan-instrumentation-with-call-threshold=0`).
> In the latter case, if you don't need the rest of ASan instrumentation
> (e.g. redzones around global and stack objects), you may want to look
> at -fsanitize=thread, which just adds calls to every memory load and
> store.
>
> HTH,
> Alex
>
> On Fri, Feb 9, 2024 at 8:36 PM fakharu <[email protected]> wrote:
> >
> > Hi,
> >
> > I intend to over write the store instruction in similar manner as done 
> address sanitizer.
> > In that quest, I want to know what exactly does option 
> "-fsanitize=address" do and is there any way I can just pass on the custom 
> code to store instruction.
> >
> > I would really appreciate if someone could point me to appropriate 
> documentation.
> >
> > Thanks,
> > Fakharu
> >
> > --
> > You received this message because you are subscribed to the Google 
> Groups "address-sanitizer" group.
> > To unsubscribe from this group and stop receiving emails from it, send 
> an email to [email protected].
> > To view this discussion on the web visit 
> https://groups.google.com/d/msgid/address-sanitizer/390ebc47-e6a3-4744-b5fa-92f3337c3521n%40googlegroups.com
> .
>
>
>
> -- 
> Alexander Potapenko
> Software Engineer
>
> Google Germany GmbH
> Erika-Mann-Straße, 33
> 80636 München
>
> Geschäftsführer: Paul Manicle, Liana Sebastian
> Registergericht und -nummer: Hamburg, HRB 86891
> Sitz der Gesellschaft: Hamburg
>

-- 
You received this message because you are subscribed to the Google Groups 
"address-sanitizer" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/address-sanitizer/133ab8bb-94f1-4154-a79c-9614b1e2ee5an%40googlegroups.com.

Reply via email to