8#ifndef LLDB_UTILITY_INSTRUMENTATION_H
9#define LLDB_UTILITY_INSTRUMENTATION_H
13#include "llvm/ADT/DenseMap.h"
14#include "llvm/ADT/StringRef.h"
15#include "llvm/Support/ErrorHandling.h"
22namespace instrumentation {
24template <typename T, std::enable_if_t<std::is_fundamental<T>::value,
int> = 0>
29template <typename T, std::enable_if_t<!std::is_fundamental<T>::value,
int> = 0>
36 ss << reinterpret_cast<void *>(t);
41 ss << reinterpret_cast<const void *>(t);
47 ss <<
'\"' << t <<
'\"';
52 const std::nullptr_t &t) {
56template <
typename Head>
61template <
typename Head,
typename... Tail>
63 const Tail &...tail) {
69template <
typename... Ts>
inline std::string
stringify_args(
const Ts &...ts) {
71 llvm::raw_string_ostream ss(buffer);
79 Instrumenter(llvm::StringRef pretty_func, std::string &&pretty_args = {});
93#define LLDB_INSTRUMENT() \
94 lldb_private::instrumentation::Instrumenter _instr(LLVM_PRETTY_FUNCTION);
96#define LLDB_INSTRUMENT_VA(...) \
97 lldb_private::instrumentation::Instrumenter _instr( \
98 LLVM_PRETTY_FUNCTION, \
99 lldb_private::instrumentation::stringify_args(__VA_ARGS__));
RAII object for instrumenting LLDB API functions.
bool m_local_boundary
Whether this function call was the one crossing the API boundary.
llvm::StringRef m_pretty_func
void stringify_helper(llvm::raw_string_ostream &ss, const Head &head)
void stringify_append(llvm::raw_string_ostream &ss, const T &t)
std::string stringify_args(const Ts &...ts)
void stringify_append< std::nullptr_t >(llvm::raw_string_ostream &ss, const std::nullptr_t &t)
void stringify_append< char >(llvm::raw_string_ostream &ss, const char *t)
A class that represents a running process on the host machine.