[PATCH] [msan] MSanDR: a simple DynamoRio-based tool that handles uninstrumented libraries and dynamically generated code

Evgeniy Stepanov eugenis at google.com
Wed Feb 20 00:58:23 PST 2013



================
Comment at: lib/msandr/msandr.cc:28
@@ +27,3 @@
+
+using std::string;
+
----------------
Kostya Serebryany wrote:
> Can we avoid using STL?
> It may give us lots of trouble with DR's native exec. 
The real question here is why does it work at all? :)
Probably because we never have both instrumented libc++/libstdc++ and run under MSanDR at the same time. With native_exec _and_ a statically linked client and DR we are probably fine, too, because all of them will live in high addresses. With native_exec and dynamic linking we might be in trouble.

================
Comment at: lib/msandr/msandr.cc:116
@@ +115,3 @@
+
+#define MEM_TO_SHADOW(mem) ((mem) & ~0x400000000000ULL)
+
----------------
Kostya Serebryany wrote:
> any reason not to make this an inline function? 
> (we use macros in similar cases if we need to call them in global initializers)
This way it has the same name in msan and msandr, easier to grep, etc.

================
Comment at: lib/msandr/msandr.cc:207
@@ +206,3 @@
+  };
+  std::set<reg_id_t> unused_registers(GPR_TO_USE_FOR_R2, GPR_TO_USE_FOR_R2 + 4);
+  unused_registers.erase(R1);
----------------
Kostya Serebryany wrote:
> grrr. std::set is not that easy to replace with non-STL. 
> What's the maximal number of elements here? 
4 :)
easily replaced with an array or even a bitfield.


http://llvm-reviews.chandlerc.com/D428



More information about the llvm-commits mailing list