<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Apr 16, 2020 at 2:37 PM Shafik Yaghmour <<a href="mailto:syaghmour@apple.com">syaghmour@apple.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><br>
> On Apr 16, 2020, at 2:04 PM, Jonas Devlieghere via lldb-commits <<a href="mailto:lldb-commits@lists.llvm.org" target="_blank">lldb-commits@lists.llvm.org</a>> wrote:<br>
> <br>
> <br>
> Author: Jonas Devlieghere<br>
> Date: 2020-04-16T14:03:55-07:00<br>
> New Revision: 9f6a308457d1bfebf1cee94b0306e738f270e512<br>
> <br>
> URL: <a href="https://github.com/llvm/llvm-project/commit/9f6a308457d1bfebf1cee94b0306e738f270e512" rel="noreferrer" target="_blank">https://github.com/llvm/llvm-project/commit/9f6a308457d1bfebf1cee94b0306e738f270e512</a><br>
> DIFF: <a href="https://github.com/llvm/llvm-project/commit/9f6a308457d1bfebf1cee94b0306e738f270e512.diff" rel="noreferrer" target="_blank">https://github.com/llvm/llvm-project/commit/9f6a308457d1bfebf1cee94b0306e738f270e512.diff</a><br>
> <br>
> LOG: [lldb/Utility] Fix a bug in stringify_append for printing addresses.<br>
> <br>
> The recent change in the API macros revealed that we were not printing<br>
> the pointer address for a bunch of methods, but rather the address of<br>
> the pointer. It's something I had already noticed while looking at some<br>
> reproducer traces, but hadn't made it to the top of my list yet. This<br>
> fixes the issue by providing a more specific overload.<br>
> <br>
> Added: <br>
> <br>
> <br>
> Modified: <br>
>    lldb/include/lldb/Utility/ReproducerInstrumentation.h<br>
> <br>
> Removed: <br>
> <br>
> <br>
> <br>
> ################################################################################<br>
> diff  --git a/lldb/include/lldb/Utility/ReproducerInstrumentation.h b/lldb/include/lldb/Utility/ReproducerInstrumentation.h<br>
> index 3728e19386d1..3b5dde3d2e2a 100644<br>
> --- a/lldb/include/lldb/Utility/ReproducerInstrumentation.h<br>
> +++ b/lldb/include/lldb/Utility/ReproducerInstrumentation.h<br>
> @@ -32,6 +32,11 @@ inline void stringify_append(llvm::raw_string_ostream &ss, const T &t) {<br>
>   ss << &t;<br>
> }<br>
> <br>
<br>
<br>
Note you can use the narrower static_cast<void*><br></blockquote><div><br></div><div>That's not true here because this function is also used for function pointers. </div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
<br>
> +template <typename T><br>
> +inline void stringify_append(llvm::raw_string_ostream &ss, T *t) {<br>
> +  ss << reinterpret_cast<void *>(t);<br>
> +}<br>
> +<br>
> template <typename T><br>
> inline void stringify_append(llvm::raw_string_ostream &ss, const T *t) {<br>
>   ss << reinterpret_cast<const void *>(t);<br>
> @@ -115,7 +120,7 @@ template <typename... Ts> inline std::string stringify_args(const Ts &... ts) {<br>
> <br>
> #define LLDB_CONSTRUCT_(T, ...)                                                \<br>
>   lldb_private::repro::Recorder _recorder(LLVM_PRETTY_FUNCTION,                \<br>
> -                                          stringify_args(__VA_ARGS__));        \<br>
> +                                          stringify_args(this, __VA_ARGS__));  \<br>
>   if (lldb_private::repro::InstrumentationData _data =                         \<br>
>           LLDB_GET_INSTRUMENTATION_DATA()) {                                   \<br>
>     _recorder.Record(_data.GetSerializer(), _data.GetRegistry(),               \<br>
> <br>
> <br>
> <br>
> _______________________________________________<br>
> lldb-commits mailing list<br>
> <a href="mailto:lldb-commits@lists.llvm.org" target="_blank">lldb-commits@lists.llvm.org</a><br>
> <a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits</a><br>
<br>
</blockquote></div></div>