[Lldb-commits] [PATCH] D145487: [lldb][test] TestDataFormatterCpp.py: add test-case for member function pointer format
Michael Buch via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Tue Mar 7 06:18:07 PST 2023
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG554f79e050cb: [lldb][test] TestDataFormatterCpp.py: add test-case for member function pointer… (authored by Michael137).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D145487/new/
https://reviews.llvm.org/D145487
Files:
lldb/test/API/functionalities/data-formatter/data-formatter-cpp/TestDataFormatterCpp.py
lldb/test/API/functionalities/data-formatter/data-formatter-cpp/main.cpp
Index: lldb/test/API/functionalities/data-formatter/data-formatter-cpp/main.cpp
===================================================================
--- lldb/test/API/functionalities/data-formatter/data-formatter-cpp/main.cpp
+++ lldb/test/API/functionalities/data-formatter/data-formatter-cpp/main.cpp
@@ -57,6 +57,9 @@
{
const char* pointer;
IUseCharStar() : pointer("Hello world") {}
+
+ char const *member_func(int) { return ""; }
+ virtual void virt_member_func() {}
};
int main (int argc, const char * argv[])
@@ -106,7 +109,15 @@
char* strptr = "Hello world!";
i_am_cooler the_coolest_guy(1,2,3.14,6.28,'E','G');
-
+
+ const char *IUseCharStar::*member_ptr = &IUseCharStar::pointer;
+ const char *(IUseCharStar::*member_func_ptr)(int) =
+ &IUseCharStar::member_func;
+ auto &ref_to_member_func_ptr = member_func_ptr;
+
+ void (IUseCharStar::*virt_member_func_ptr)() =
+ &IUseCharStar::virt_member_func;
+
return 0; // Set break point at this line.
}
Index: lldb/test/API/functionalities/data-formatter/data-formatter-cpp/TestDataFormatterCpp.py
===================================================================
--- lldb/test/API/functionalities/data-formatter/data-formatter-cpp/TestDataFormatterCpp.py
+++ lldb/test/API/functionalities/data-formatter/data-formatter-cpp/TestDataFormatterCpp.py
@@ -285,3 +285,17 @@
matching=False,
substrs=['(int) iAmInt = 0x00000001'])
self.expect("frame variable iAmInt", substrs=['(int) iAmInt = 1'])
+
+ # FIXME: don't format pointer to members as bytes, but rather as regular pointers
+ self.expect(
+ "frame variable member_ptr",
+ patterns=['member_ptr = [0-9a-z]{2}\s'])
+ self.expect(
+ "frame variable member_func_ptr",
+ patterns=['member_func_ptr = [0-9a-z]{2}\s'])
+ self.expect(
+ "frame variable ref_to_member_func_ptr",
+ patterns=['ref_to_member_func_ptr = [0-9a-z]{2}\s'])
+ self.expect(
+ "frame variable virt_member_func_ptr",
+ patterns=['virt_member_func_ptr = [0-9a-z]{2}\s'])
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D145487.503022.patch
Type: text/x-patch
Size: 2185 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20230307/fe8c94d8/attachment.bin>
More information about the lldb-commits
mailing list