-
Notifications
You must be signed in to change notification settings - Fork 15.5k
[LLDB] Run MSVC STL (forward-)list test with PDB #166953
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
Conversation
|
@llvm/pr-subscribers-lldb Author: nerix (Nerixyz) ChangesSince PDB doesn't have template information, we need to get the element type from somewhere else. I'm using the type of Full diff: https://github.com/llvm/llvm-project/pull/166953.diff 4 Files Affected:
diff --git a/lldb/source/Plugins/Language/CPlusPlus/GenericList.cpp b/lldb/source/Plugins/Language/CPlusPlus/GenericList.cpp
index 5289027fbd8af..101b8b67a92f9 100644
--- a/lldb/source/Plugins/Language/CPlusPlus/GenericList.cpp
+++ b/lldb/source/Plugins/Language/CPlusPlus/GenericList.cpp
@@ -530,6 +530,12 @@ lldb::ChildCacheState MsvcStlForwardListFrontEnd::Update() {
m_backend.GetChildAtNamePath({"_Mypair", "_Myval2", "_Myhead"}))
m_head = head_sp.get();
+ if (!m_element_type && m_head) {
+ auto val_sp = m_head->GetChildMemberWithName("_Myval");
+ if (val_sp)
+ m_element_type = val_sp->GetCompilerType();
+ }
+
return ChildCacheState::eRefetch;
}
@@ -606,6 +612,12 @@ lldb::ChildCacheState MsvcStlListFrontEnd::Update() {
m_head = first.get();
m_tail = last.get();
+ if (!m_element_type && m_head) {
+ auto val_sp = m_head->GetChildMemberWithName("_Myval");
+ if (val_sp)
+ m_element_type = val_sp->GetCompilerType();
+ }
+
return lldb::ChildCacheState::eRefetch;
}
diff --git a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/forward_list/TestDataFormatterGenericForwardList.py b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/forward_list/TestDataFormatterGenericForwardList.py
index 45695c43b42a9..1db0c489bc7f9 100644
--- a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/forward_list/TestDataFormatterGenericForwardList.py
+++ b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/forward_list/TestDataFormatterGenericForwardList.py
@@ -9,6 +9,8 @@
class TestDataFormatterGenericForwardList(TestBase):
+ TEST_WITH_PDB_DEBUG_INFO = True
+
def setUp(self):
TestBase.setUp(self)
self.line = line_number("main.cpp", "// break here")
diff --git a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/list/TestDataFormatterGenericList.py b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/list/TestDataFormatterGenericList.py
index c0207e6ab5911..fbd021190214b 100644
--- a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/list/TestDataFormatterGenericList.py
+++ b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/list/TestDataFormatterGenericList.py
@@ -10,6 +10,8 @@
class GenericListDataFormatterTestCase(TestBase):
+ TEST_WITH_PDB_DEBUG_INFO = True
+
def setUp(self):
# Call super's setUp().
TestBase.setUp(self)
diff --git a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/list/loop/TestDataFormatterGenericListLoop.py b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/list/loop/TestDataFormatterGenericListLoop.py
index f6174dd786380..9c5daf760b31f 100644
--- a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/list/loop/TestDataFormatterGenericListLoop.py
+++ b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/list/loop/TestDataFormatterGenericListLoop.py
@@ -11,6 +11,7 @@
class GenericListDataFormatterTestCase(TestBase):
+ TEST_WITH_PDB_DEBUG_INFO = True
NO_DEBUG_INFO_TESTCASE = True
def do_test_with_run_command(self):
|
| if (!m_element_type && m_head) { | ||
| auto val_sp = m_head->GetChildMemberWithName("_Myval"); | ||
| if (val_sp) | ||
| m_element_type = val_sp->GetCompilerType(); | ||
| } | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we extract this to a GetElementType helper?
Also worth adding a comment that this is for PDB
Michael137
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks!
Since PDB doesn't have template information, we need to get the element type from somewhere else. I'm using the type of
_Myvalin a list node, which holds the element type.