DynamoRIO
create_annotation.p2

Next, modify elements of the annotation macro and declaration according to its new purpose:

  1. Change the name;
  2. Change the return type to void;
  3. Replace the formal parameter list.
+#ifndef _MEMCLIENT_ANNOTATIONS_H_
+#define _MEMCLIENT_ANNOTATIONS_H_ 1
#include "dr_annotations_asm.h"
/* To simplify project configuration, this pragma excludes the file from GCC warnings. */
#ifdef __GNUC__
# pragma GCC system_header
#endif
+#define MEMCLIENT_MARK_MEM_DEFINED_IF_ADDRESSABLE(start, size) \
+ DR_ANNOTATION(memclient_mark_mem_defined_if_addressable, start, size)
#ifdef __cplusplus
extern "C" {
#endif
+DR_DECLARE_ANNOTATION(void, memclient_mark_mem_defined_if_addressable,
+ (void *p, size_t size));
#ifdef __cplusplus
}
#endif
#endif

Note that one of the original annotations has been deleted. This completes the header for the new annotation, and now the source must be similarly copied and modified.

[ prev | next ]