LLDB evaluates some utility expression to update the Objective-C class list that ends up
calling function such as free or objc_copyRealizedClassList_nolock. This adds a test that
just tries to define our own bogus version of objc_copyRealizedClassList_nolock. It just
tests that LLDB doesn't crash as we currently don't have a way to tell LLDB to look for
the function in a specific library.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
lldb/test/API/lang/objc/conflicting-class-list-function-from-user/main.m | ||
---|---|---|
22–23 | The description says "we currently don't have a way to tell LLDB to look for |
lldb/test/API/lang/objc/conflicting-class-list-function-from-user/main.m | ||
---|---|---|
22–23 | Everything you're saying is right, that's why the test is XFAIL'd. The test is just testing that LLDB doesn't crash or anything like that. The "we currently don't have a way to tell LLDB to look for the function in a specific library" comment is just there to point out that this is the missing functionality to make this test actually pass. |
LGTM
lldb/test/API/lang/objc/conflicting-class-list-function-from-user/main.m | ||
---|---|---|
22–23 | Ah, I missed that part, thanks for pointing that out! If we really wanted to, we could look up the symbol (which we already do to make sure it's available) and call it through that instead of relying on the expression parser, but that seems unlikely enough to happen. |
The description says "we currently don't have a way to tell LLDB to look for
the function in a specific library", so what guarantees we call the right one? We check if the symbol exists in libobjc (and fallback to the realized class list struct if not), but there's nothing in the source code that could tell the expression evaluator where the symbol should come from.