From eb8398cda0f737b1e6b055bd9b2f4fdc93ff2a4c Mon Sep 17 00:00:00 2001 From: Igor Zhukov Date: Wed, 4 May 2022 12:58:49 +0700 Subject: [PATCH 1/2] don't dereference _Ptr when type is void --- stl/debugger/STL.natvis | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/stl/debugger/STL.natvis b/stl/debugger/STL.natvis index 5885050d8d..425c7f01df 100644 --- a/stl/debugger/STL.natvis +++ b/stl/debugger/STL.natvis @@ -388,6 +388,24 @@ SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + + + _Ptr + empty + nullptr + void + shared_ptr {*this,view(ptr)} [{_Rep->_Uses} strong ref] [{*_Rep}] + shared_ptr {*this,view(ptr)} [{_Rep->_Uses} strong ref, {_Rep->_Weaks - 1} weak ref] [{*_Rep}] + shared_ptr {*this,view(ptr)} [{_Rep->_Uses} strong ref, {_Rep->_Weaks - 1} weak refs] [{*_Rep}] + shared_ptr {*this,view(ptr)} [{_Rep->_Uses} strong refs] [{*_Rep}] + shared_ptr {*this,view(ptr)} [{_Rep->_Uses} strong refs, {_Rep->_Weaks - 1} weak ref] [{*_Rep}] + shared_ptr {*this,view(ptr)} [{_Rep->_Uses} strong refs, {_Rep->_Weaks - 1} weak refs] [{*_Rep}] + + _Ptr + *_Rep + + + _Ptr empty @@ -405,6 +423,23 @@ SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + + + empty + nullptr + void + expired [{_Rep->_Weaks} weak ref] [{*_Rep}] + expired [{_Rep->_Weaks} weak refs] [{*_Rep}] + weak_ptr {*this,view(ptr)} [{_Rep->_Uses} strong ref, {_Rep->_Weaks - 1} weak ref] [{*_Rep}] + weak_ptr {*this,view(ptr)} [{_Rep->_Uses} strong ref, {_Rep->_Weaks - 1} weak refs] [{*_Rep}] + weak_ptr {*this,view(ptr)} [{_Rep->_Uses} strong refs, {_Rep->_Weaks - 1} weak ref] [{*_Rep}] + weak_ptr {*this,view(ptr)} [{_Rep->_Uses} strong refs, {_Rep->_Weaks - 1} weak refs] [{*_Rep}] + + _Ptr + *_Rep + + + empty nullptr From a8b847da3f744fc00654a0f99c4d168ab4415a61 Mon Sep 17 00:00:00 2001 From: Igor Zhukov Date: Wed, 4 May 2022 18:40:01 +0700 Subject: [PATCH 2/2] `unique_ptr` is possible --- stl/debugger/STL.natvis | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/stl/debugger/STL.natvis b/stl/debugger/STL.natvis index 425c7f01df..70baf08fa5 100644 --- a/stl/debugger/STL.natvis +++ b/stl/debugger/STL.natvis @@ -288,6 +288,16 @@ SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + + _Mypair._Myval2 + empty + unique_ptr void + + _Mypair._Myval2 + _Mypair + + + _Mypair._Myval2 empty