-
Notifications
You must be signed in to change notification settings - Fork 341
[lldb] Detect when full DWARF debugging should be enabled #8318
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
[lldb] Detect when full DWARF debugging should be enabled #8318
Conversation
@swift-ci test |
@@ -32,21 +32,21 @@ struct DescriptorFinderForwarder : public swift::reflection::DescriptorFinder { | |||
|
|||
std::unique_ptr<swift::reflection::BuiltinTypeDescriptorBase> | |||
getBuiltinTypeDescriptor(const swift::reflection::TypeRef *TR) override { | |||
if (m_descriptor_finder) | |||
if (m_descriptor_finder && shouldConsultDescriptorFinder()) |
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.
This pattern looks like it could be factored out into a template or a function that takes a std::function?
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.
Maybe there's a better way to do this, but I think the "obvious" template solution is more trouble than it's worth. We'd need a templated function like:
template <typename T>
std::unique_ptr<T>
getDescriptor(std::function<std::unique_ptr<T>()> descriptor_func) {
if (m_descriptor_finder && shouldConsultDescriptorFinder())
return descriptor_func();
return nullptr;
}
And then on the call side we'd need something like:
std::unique_ptr<swift::reflection::BuiltinTypeDescriptorBase>
getBuiltinTypeDescriptor(const swift::reflection::TypeRef *TR) override {
std::function<
std::unique_ptr<swift::reflection::BuiltinTypeDescriptorBase>()>
lambda =
[&]() { return m_descriptor_finder->getBuiltinTypeDescriptor(TR); };
return getDescriptor(lambda);
}
We need to spell out the lambda's type because the compiler is not able to deduce them.
lldb/source/Plugins/LanguageRuntime/Swift/ReflectionContext.cpp
Outdated
Show resolved
Hide resolved
Automatically turn on full DWARF debugging if reflection metadata isn't available. rdar://122711892
485d512
to
d39266d
Compare
@swift-ci test |
@swift-ci test Windows |
@swift-ci test windows |
Automatically turn on full DWARF debugging if reflection metadata isn't available.
rdar://122711892