[Lldb-commits] [lldb] [lldb-dap] Use protocol types for modules request and events. (PR #146966)
Jonas Devlieghere via lldb-commits
lldb-commits at lists.llvm.org
Thu Jul 3 16:32:41 PDT 2025
================
@@ -46,6 +48,107 @@ static bool ShouldDisplayAssemblySource(
return false;
}
+static uint64_t GetDebugInfoSizeInSection(lldb::SBSection section) {
+ uint64_t debug_info_size = 0;
+ const llvm::StringRef section_name(section.GetName());
+ if (section_name.starts_with(".debug") ||
+ section_name.starts_with("__debug") ||
+ section_name.starts_with(".apple") || section_name.starts_with("__apple"))
+ debug_info_size += section.GetFileByteSize();
+
+ const size_t num_sub_sections = section.GetNumSubSections();
+ for (size_t i = 0; i < num_sub_sections; i++) {
+ debug_info_size +=
+ GetDebugInfoSizeInSection(section.GetSubSectionAtIndex(i));
+ }
+ return debug_info_size;
+}
+
+static uint64_t GetDebugInfoSize(lldb::SBModule module) {
+ uint64_t debug_info_size = 0;
+ const size_t num_sections = module.GetNumSections();
+ for (size_t i = 0; i < num_sections; i++) {
+ debug_info_size += GetDebugInfoSizeInSection(module.GetSectionAtIndex(i));
+ }
----------------
JDevlieghere wrote:
```suggestion
for (size_t i = 0; i < num_sections; i++)
debug_info_size += GetDebugInfoSizeInSection(module.GetSectionAtIndex(i));
```
https://github.com/llvm/llvm-project/pull/146966
More information about the lldb-commits
mailing list