[lldb/Utility] Fix a bug in stringify_append for printing addresses.

The recent change in the API macros revealed that we were not printing
the pointer address for a bunch of methods, but rather the address of
the pointer. It's something I had already noticed while looking at some
reproducer traces, but hadn't made it to the top of my list yet. This
fixes the issue by providing a more specific overload.
This commit is contained in:
Jonas Devlieghere 2020-04-16 14:02:05 -07:00
parent 3b222ef246
commit 9f6a308457
1 changed files with 6 additions and 1 deletions

View File

@ -32,6 +32,11 @@ inline void stringify_append(llvm::raw_string_ostream &ss, const T &t) {
ss << &t;
}
template <typename T>
inline void stringify_append(llvm::raw_string_ostream &ss, T *t) {
ss << reinterpret_cast<void *>(t);
}
template <typename T>
inline void stringify_append(llvm::raw_string_ostream &ss, const T *t) {
ss << reinterpret_cast<const void *>(t);
@ -115,7 +120,7 @@ template <typename... Ts> inline std::string stringify_args(const Ts &... ts) {
#define LLDB_CONSTRUCT_(T, ...) \
lldb_private::repro::Recorder _recorder(LLVM_PRETTY_FUNCTION, \
stringify_args(__VA_ARGS__)); \
stringify_args(this, __VA_ARGS__)); \
if (lldb_private::repro::InstrumentationData _data = \
LLDB_GET_INSTRUMENTATION_DATA()) { \
_recorder.Record(_data.GetSerializer(), _data.GetRegistry(), \