Skip to content

[LLDB] Use non synthetic value for MSVC smart ptr check #148176

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 11, 2025

Conversation

Nerixyz
Copy link
Contributor

@Nerixyz Nerixyz commented Jul 11, 2025

I forgot to use the non-synthetic value to check for the _Ptr member.

Fixes the test failure from #147575.

@Nerixyz Nerixyz requested a review from JDevlieghere as a code owner July 11, 2025 09:53
@llvmbot llvmbot added the lldb label Jul 11, 2025
@llvmbot
Copy link
Member

llvmbot commented Jul 11, 2025

@llvm/pr-subscribers-lldb

Author: nerix (Nerixyz)

Changes

I forgot to use the non-synthetic value to check for the _Ptr member.

Fixes the test failure from #147575.


Full diff: https://github.com/llvm/llvm-project/pull/148176.diff

1 Files Affected:

  • (modified) lldb/source/Plugins/Language/CPlusPlus/MsvcStlSmartPointer.cpp (+2-1)
diff --git a/lldb/source/Plugins/Language/CPlusPlus/MsvcStlSmartPointer.cpp b/lldb/source/Plugins/Language/CPlusPlus/MsvcStlSmartPointer.cpp
index 4a51879863f17..b5a85ab5deb8b 100644
--- a/lldb/source/Plugins/Language/CPlusPlus/MsvcStlSmartPointer.cpp
+++ b/lldb/source/Plugins/Language/CPlusPlus/MsvcStlSmartPointer.cpp
@@ -15,7 +15,8 @@
 using namespace lldb;
 
 bool lldb_private::formatters::IsMsvcStlSmartPointer(ValueObject &valobj) {
-  return valobj.GetChildMemberWithName("_Ptr") != nullptr;
+  ValueObjectSP valobj_sp = valobj.GetNonSyntheticValue();
+  return valobj_sp->GetChildMemberWithName("_Ptr") != nullptr;
 }
 
 bool lldb_private::formatters::MsvcStlSmartPointerSummaryProvider(

@Nerixyz
Copy link
Contributor Author

Nerixyz commented Jul 11, 2025

@Michael137 Sorry for the failure, I only built LLDB before but didn't run the tests after fixing the suggestions 🤦

Copy link
Member

@Michael137 Michael137 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no worries!
LGTM

Copy link

github-actions bot commented Jul 11, 2025

✅ With the latest revision this PR passed the C/C++ code formatter.

Co-authored-by: Michael Buch <michaelbuch12@gmail.com>
@Nerixyz Nerixyz force-pushed the fix/lldb-ms-smart-ptr branch from 1e03a7b to 7bf4135 Compare July 11, 2025 11:53
@Nerixyz
Copy link
Contributor Author

Nerixyz commented Jul 11, 2025

Windows premerge checks would be great for this. I opened #146236, but there are still some LLDB tests failing. Not really sure why.

@Michael137 Michael137 merged commit 539991e into llvm:main Jul 11, 2025
9 checks passed
@Michael137
Copy link
Member

Windows premerge checks would be great for this. I opened #146236, but there are still some LLDB tests failing. Not really sure why.

That's awesome! I think @Endilll looked at Windows pre-merge testing in the past (at least for Clang, but IIRC maybe also LLDB?), but it was disabled due to bandwidth issues. I'll CC him on #146236

@Nerixyz Nerixyz deleted the fix/lldb-ms-smart-ptr branch July 11, 2025 12:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants