Skip to content

Commit

Permalink
[lldb/Utility] Fix a bug in stringify_append for printing addresses.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
JDevlieghere committed Apr 16, 2020
1 parent 3b222ef commit 9f6a308
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lldb/include/lldb/Utility/ReproducerInstrumentation.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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(), \
Expand Down

0 comments on commit 9f6a308

Please sign in to comment.