================
@@ -138,6 +134,21 @@ void Symtab::Dump(Stream *s, Target *target, SortOrder
sort_order,
}
} break;
+ case eSortOrderBySize: {
+ s->PutCString(" (sorted by size):\n");
+ DumpSymbolHeader(s);
+
+ std::multimap<size_t, const Symbol *, std::greater<size_t>> size_map;
+ for (const Symbol &symbol : m_symbols)
+ size_map.emplace(symbol.GetByteSize(), &symbol);
+
+ for (const auto &size_to_symbol : size_map) {
+ const Symbol *symbol = size_to_symbol.second;
+ s->Indent();
+ symbol->Dump(s, target, symbol - &m_symbols[0], name_preference);
----------------
jasonmolenda wrote:
I don't have a strong opinion here but when it's sorted by address, the index
is still sorted-ordering. This is showing the original symtab index numbers. I
think it should show the sorted index ordering, if someone wants to correspond
a symbol to the original symtab, they can search for the symbol name.
https://github.com/llvm/llvm-project/pull/83527
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits