DynamoRIO
create_annotation.p7

Next modify elements of the cmake function for usage with the MemClient annotations:

  1. Replace DynamoRIO with the client name, e.g. MemClient;
  2. Change the variable prefix from dr_ to a suitable prefix, e.g. memclient_;
  3. Specify the client's annotation source file(s).
+# For configuring target applications that use MemClient annotations
+function (use_MemClient_annotations target target_srcs)
+  set(memclient_annotation_dir "${MemClient_cwd}/../include/annotations")
+  set(memclient_annotation_srcs "${memclient_annotation_dir}/memclient_annotations.c")
+  configure_DynamoRIO_annotation_sources("${memclient_annotation_srcs}")
+  set(${target_srcs} ${${target_srcs}} ${memclient_annotation_srcs} PARENT_SCOPE)
+endfunction (use_MemClient_annotations target target_srcs)

Note that the cmake variable memclient_annotation_dir has been set to the same direcotry as the default DynamoRIO annotation directory, but this is not required–the client developer may choose to put the new annotations in any directory within the build output area.

In more general terms, this cmake function takes the following steps:

  1. Copies the MemClient annotation header and source file to the build output area;
  2. Assigns the required compiler flags;
  3. Adds the source file to the project source list.

Target applications that are not built with cmake will need to take these same 3 steps in a comparable way.

[ prev | back ]