libvex_inner.h 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /*--------------------------------------------------------------------*/
  2. /*--- Utilities for inner Valgrind libvex_inner.h ---*/
  3. /*--------------------------------------------------------------------*/
  4. /*
  5. This file is part of Valgrind, a dynamic binary instrumentation
  6. framework.
  7. Copyright (C) 2017-2017 Philippe Waroquiers
  8. philippe.waroquiers@skynet.be
  9. This program is free software; you can redistribute it and/or
  10. modify it under the terms of the GNU General Public License as
  11. published by the Free Software Foundation; either version 2 of the
  12. License, or (at your option) any later version.
  13. This program is distributed in the hope that it will be useful, but
  14. WITHOUT ANY WARRANTY; without even the implied warranty of
  15. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16. General Public License for more details.
  17. You should have received a copy of the GNU General Public License
  18. along with this program; if not, write to the Free Software
  19. Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
  20. 02111-1307, USA.
  21. The GNU General Public License is contained in the file COPYING.
  22. */
  23. #ifndef __LIBVEX_INNER_H
  24. #define __LIBVEX_INNER_H
  25. //--------------------------------------------------------------------
  26. // PURPOSE: This header should be imported by every file in Valgrind
  27. // which needs specific behaviour when running as an "inner" Valgrind.
  28. // Valgrind can self-host itself (i.e. Valgrind can run Valgrind) :
  29. // The outer Valgrind executes the inner Valgrind.
  30. // For more details, see README_DEVELOPPERS.
  31. //--------------------------------------------------------------------
  32. #include "config.h"
  33. // The code of the inner Valgrind (core or tool code) contains client
  34. // requests (e.g. from helgrind.h, memcheck.h, ...) to help the
  35. // outer Valgrind finding (relevant) errors in the inner Valgrind.
  36. // Such client requests should only be compiled in for an inner Valgrind.
  37. // Use the macro INNER_REQUEST to allow a central enabling/disabling
  38. // of these client requests.
  39. #if defined(ENABLE_INNER)
  40. // By default, the inner Valgrind annotates various actions to help
  41. // the outer tool (memcheck or helgrind).
  42. // Undefine the below to have an inner Valgrind without any annotation.
  43. #define ENABLE_INNER_CLIENT_REQUEST 1
  44. #if defined(ENABLE_INNER_CLIENT_REQUEST)
  45. #define INNER_REQUEST(__zza) __zza
  46. #else
  47. #define INNER_REQUEST(__zza) do {} while (0)
  48. #endif
  49. #else
  50. #define INNER_REQUEST(__zza) do {} while (0)
  51. #endif
  52. #endif // __LIBVEX_INNER_H
  53. /*--------------------------------------------------------------------*/
  54. /*--- end ---*/
  55. /*--------------------------------------------------------------------*/