Page MenuHomePhabricator

Fix tuple getter in std unique pointer pretty-printer
ClosedPublic

Authored by aleksandr.urakov on Jun 8 2018, 1:02 AM.

Diff Detail

Repository
rL LLVM

Event Timeline

labath added a comment.Jun 8 2018, 1:08 AM

Did you investigate when does this happen? I take it it can happen if a user has a custom std::unique_ptr definition that kinda looks like the libstdc++ one, but not really, but I am wondering if we're not missing something else here..

This happened with MSVC's std::unique_ptr implementation. But I stepped through whole std::make_unique, and this was the only place, where lldb crashed.

labath accepted this revision.Jun 8 2018, 1:57 AM

Aha I see.

I think the root cause here is that this data formatter even gets invoked for MSVC's std::unique_ptr. Unfortunately, it seems that won't be able to differentiate easily, as the libstdc++ unique_ptr comes out simply as std::unique_ptr, without any tell-tale signs like __1 namespace that libc++ data types tend to have. If we ever get to implement unique_ptr formatter for MSVC type, we will probably have to have a single class that supports both. But this should be good enough for now.

This revision is now accepted and ready to land.Jun 8 2018, 1:57 AM
tberghammer accepted this revision.Jun 8 2018, 3:52 AM

BTW this can also happen if we are missing some debug info.

Please, commit this for me? I have no commit access.

This revision was automatically updated to reflect the committed changes.

Committed as r334411. I also squeezed in a quick test.