Skip to content

Commit 9f6a308

Browse files
committed
[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.
1 parent 3b222ef commit 9f6a308

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lldb/include/lldb/Utility/ReproducerInstrumentation.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ inline void stringify_append(llvm::raw_string_ostream &ss, const T &t) {
3232
ss << &t;
3333
}
3434

35+
template <typename T>
36+
inline void stringify_append(llvm::raw_string_ostream &ss, T *t) {
37+
ss << reinterpret_cast<void *>(t);
38+
}
39+
3540
template <typename T>
3641
inline void stringify_append(llvm::raw_string_ostream &ss, const T *t) {
3742
ss << reinterpret_cast<const void *>(t);
@@ -115,7 +120,7 @@ template <typename... Ts> inline std::string stringify_args(const Ts &... ts) {
115120

116121
#define LLDB_CONSTRUCT_(T, ...) \
117122
lldb_private::repro::Recorder _recorder(LLVM_PRETTY_FUNCTION, \
118-
stringify_args(__VA_ARGS__)); \
123+
stringify_args(this, __VA_ARGS__)); \
119124
if (lldb_private::repro::InstrumentationData _data = \
120125
LLDB_GET_INSTRUMENTATION_DATA()) { \
121126
_recorder.Record(_data.GetSerializer(), _data.GetRegistry(), \

0 commit comments

Comments
 (0)