[Lldb-commits] [lldb] 1aca8ed - [lldb][ELF] Add a comment to explain address class map type
David Spickett via lldb-commits
lldb-commits at lists.llvm.org
Fri May 10 02:33:05 PDT 2024
Author: David Spickett
Date: 2024-05-10T09:25:03Z
New Revision: 1aca8ed5a7eeed264fdc2694deca8a4a4dba3689
URL: https://github.com/llvm/llvm-project/commit/1aca8ed5a7eeed264fdc2694deca8a4a4dba3689
DIFF: https://github.com/llvm/llvm-project/commit/1aca8ed5a7eeed264fdc2694deca8a4a4dba3689.diff
LOG: [lldb][ELF] Add a comment to explain address class map type
It was pointed out that ordering is crucial here, so note that.
I also looked into using a vector instead, as described in
https://llvm.org/docs/ProgrammersManual.html#dss-sortedvectorset.
Which this is in theory perfect for, but we have at least 2 places
that update the map and both would need to sort/unique each time.
Plus this code is pretty bug prone.
If there is future refactoring it's one thing to consider.
Added:
Modified:
lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.h
Removed:
################################################################################
diff --git a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.h b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.h
index 716bbe01638f3..844e981b1d890 100644
--- a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.h
+++ b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.h
@@ -187,6 +187,9 @@ class ObjectFileELF : public lldb_private::ObjectFile {
typedef DynamicSymbolColl::iterator DynamicSymbolCollIter;
typedef DynamicSymbolColl::const_iterator DynamicSymbolCollConstIter;
+ /// An ordered map of file address to address class. Used on architectures
+ /// like Arm where there is an alternative ISA mode like Thumb. The container
+ /// is ordered so that it can be binary searched.
typedef std::map<lldb::addr_t, lldb_private::AddressClass>
FileAddressToAddressClassMap;
More information about the lldb-commits
mailing list