LLDB mainline
SymbolFileDWARFDebugMap.h
Go to the documentation of this file.
1//===-- SymbolFileDWARFDebugMap.h ------------------------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#ifndef LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_SYMBOLFILEDWARFDEBUGMAP_H
10#define LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_SYMBOLFILEDWARFDEBUGMAP_H
11
12#include "DIERef.h"
15#include "llvm/Support/Chrono.h"
16#include <bitset>
17#include <map>
18#include <optional>
19#include <vector>
20
21#include "UniqueDWARFASTType.h"
24
26
27namespace lldb_private::plugin {
28namespace dwarf {
29class SymbolFileDWARF;
33
35 /// LLVM RTTI support.
36 static char ID;
37
38public:
39 /// LLVM RTTI support.
40 /// \{
41 bool isA(const void *ClassID) const override {
42 return ClassID == &ID || SymbolFileCommon::isA(ClassID);
43 }
44 static bool classof(const SymbolFile *obj) { return obj->isA(&ID); }
45 /// \}
46
47 // Static Functions
48 static void Initialize();
49
50 static void Terminate();
51
52 static llvm::StringRef GetPluginNameStatic() { return "dwarf-debugmap"; }
53
54 static llvm::StringRef GetPluginDescriptionStatic();
55
57
58 // Constructors and Destructors
61
62 uint32_t CalculateAbilities() override;
63 void InitializeObject() override;
64
65 // Compile Unit function calls
66 lldb::LanguageType ParseLanguage(CompileUnit &comp_unit) override;
67 XcodeSDK ParseXcodeSDK(CompileUnit &comp_unit) override;
68 llvm::SmallSet<lldb::LanguageType, 4>
69 ParseAllLanguages(CompileUnit &comp_unit) override;
70 size_t ParseFunctions(CompileUnit &comp_unit) override;
71 bool ParseLineTable(CompileUnit &comp_unit) override;
72 bool ParseDebugMacros(CompileUnit &comp_unit) override;
73
74 bool ForEachExternalModule(CompileUnit &, llvm::DenseSet<SymbolFile *> &,
75 llvm::function_ref<bool(Module &)>) override;
76
77 bool ParseSupportFiles(CompileUnit &comp_unit,
78 SupportFileList &support_files) override;
79
80 bool ParseIsOptimized(CompileUnit &comp_unit) override;
81
82 size_t ParseTypes(CompileUnit &comp_unit) override;
83
84 bool
86 std::vector<SourceModule> &imported_modules) override;
87 size_t ParseBlocksRecursive(Function &func) override;
88 size_t ParseVariablesForContext(const SymbolContext &sc) override;
89
90 Type *ResolveTypeUID(lldb::user_id_t type_uid) override;
91 std::optional<ArrayInfo>
93 const ExecutionContext *exe_ctx) override;
94
97 std::vector<CompilerContext>
99 void ParseDeclsForContext(CompilerDeclContext decl_ctx) override;
100
101 bool CompleteType(CompilerType &compiler_type) override;
102 uint32_t ResolveSymbolContext(const Address &so_addr,
103 lldb::SymbolContextItem resolve_scope,
104 SymbolContext &sc) override;
105 uint32_t ResolveSymbolContext(const SourceLocationSpec &src_location_spec,
106 lldb::SymbolContextItem resolve_scope,
107 SymbolContextList &sc_list) override;
108
110
112 const CompilerDeclContext &parent_decl_ctx,
113 uint32_t max_matches,
114 VariableList &variables) override;
115 void FindGlobalVariables(const RegularExpression &regex, uint32_t max_matches,
116 VariableList &variables) override;
117 void FindFunctions(const Module::LookupInfo &lookup_info,
118 const CompilerDeclContext &parent_decl_ctx,
119 bool include_inlines, SymbolContextList &sc_list) override;
120 void FindFunctions(const RegularExpression &regex, bool include_inlines,
121 SymbolContextList &sc_list) override;
122 void FindTypes(const lldb_private::TypeQuery &match,
123 lldb_private::TypeResults &results) override;
125 const CompilerDeclContext &parent_decl_ctx,
126 bool only_root_namespaces) override;
127 void GetTypes(SymbolContextScope *sc_scope, lldb::TypeClass type_mask,
128 TypeList &type_list) override;
129 std::vector<std::unique_ptr<CallEdge>>
130 ParseCallEdgesInFunction(UserID func_id) override;
131
132 void DumpClangAST(Stream &s, llvm::StringRef filter,
133 bool show_color) override;
134
135 /// List separate oso files.
136 bool GetSeparateDebugInfo(StructuredData::Dictionary &d, bool errors_only,
137 bool load_all_debug_info = false) override;
138
139 // PluginInterface protocol
140 llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }
141
142 // Statistics overrides.
144
145 void
146 GetCompileOptions(std::unordered_map<lldb::CompUnitSP, Args> &args) override;
147
148 llvm::Expected<SymbolContext>
150
151protected:
152 enum { kHaveInitializedOSOs = (1 << 0), kNumFlags };
153
154 friend class DebugMapModule;
155 friend class ::DWARFASTParserClang;
156 friend class DWARFCompileUnit;
157 friend class SymbolFileDWARF;
163
164 typedef std::shared_ptr<OSOInfo> OSOInfoSP;
165
168
169 // Class specific types
173 llvm::sys::TimePoint<> oso_mod_time;
176 /// The compile units that an object file contains.
177 llvm::SmallVector<lldb::CompUnitSP, 2> compile_units_sps;
178 /// A map from the compile unit ID to its index in the vector.
179 llvm::SmallDenseMap<uint64_t, uint64_t, 2> id_to_index_map;
186
187 CompileUnitInfo() = default;
188
190 };
191
192 // Protected Member Functions
193 void InitOSO();
194
195 /// This function actually returns the number of object files, which may be
196 /// less than the actual number of compile units, since an object file may
197 /// contain more than one compile unit. SymbolFileDWARFDebugMap looks up the
198 /// number of compile units by reading the nlist symbol table, which
199 /// currently, on macOS, only reports one compile unit per object file, and
200 /// there's no efficient way to calculate the actual number of compile units
201 /// upfront.
202 uint32_t CalculateNumCompileUnits() override;
203
204 /// This function actually returns the first compile unit the object file at
205 /// the given index contains.
206 lldb::CompUnitSP ParseCompileUnitAtIndex(uint32_t index) override;
207
209 std::optional<uint32_t> OsoNum = DIERef(uid).file_index();
210 lldbassert(OsoNum && "Invalid OSO Index");
211 return *OsoNum;
212 }
213
215
216 bool GetFileSpecForSO(uint32_t oso_idx, FileSpec &file_spec);
217
218 CompileUnitInfo *GetCompUnitInfo(const SymbolContext &sc);
219 CompileUnitInfo *GetCompUnitInfo(const CompileUnit &comp_unit);
220
221 size_t GetCompUnitInfosForModule(const Module *oso_module,
222 std::vector<CompileUnitInfo *> &cu_infos);
223
224 Module *GetModuleByCompUnitInfo(CompileUnitInfo *comp_unit_info);
225
226 Module *GetModuleByOSOIndex(uint32_t oso_idx);
227
228 ObjectFile *GetObjectFileByCompUnitInfo(CompileUnitInfo *comp_unit_info);
229
230 ObjectFile *GetObjectFileByOSOIndex(uint32_t oso_idx);
231
232 uint32_t GetCompUnitInfoIndex(const CompileUnitInfo *comp_unit_info);
233
235 SymbolFileDWARF *GetSymbolFile(const CompileUnit &comp_unit);
236
237 SymbolFileDWARF *GetSymbolFileByCompUnitInfo(CompileUnitInfo *comp_unit_info);
238
239 SymbolFileDWARF *GetSymbolFileByOSOIndex(uint32_t oso_idx);
240
241 /// If closure returns \ref IterationAction::Continue, iteration
242 /// continues. Otherwise, iteration terminates.
243 void
244 ForEachSymbolFile(std::string description,
245 std::function<IterationAction(SymbolFileDWARF &)> closure);
246
247 CompileUnitInfo *GetCompileUnitInfoForSymbolWithIndex(uint32_t symbol_idx,
248 uint32_t *oso_idx_ptr);
249
250 CompileUnitInfo *GetCompileUnitInfoForSymbolWithID(lldb::user_id_t symbol_id,
251 uint32_t *oso_idx_ptr);
252
253 static int
254 SymbolContainsSymbolWithIndex(uint32_t *symbol_idx_ptr,
255 const CompileUnitInfo *comp_unit_info);
256
257 static int SymbolContainsSymbolWithID(lldb::user_id_t *symbol_idx_ptr,
258 const CompileUnitInfo *comp_unit_info);
259
260 void
262 const CompilerDeclContext &parent_decl_ctx,
263 const std::vector<uint32_t> &name_symbol_indexes,
264 uint32_t max_matches, VariableList &variables);
265
266 void SetCompileUnit(SymbolFileDWARF *oso_dwarf,
267 const lldb::CompUnitSP &cu_sp);
268
269 /// Returns the compile unit associated with the dwarf compile unit. This may
270 /// be one of the extra compile units an object file contains which isn't
271 /// reachable by ParseCompileUnitAtIndex(uint32_t).
273 DWARFCompileUnit &dwarf_cu);
274
275 CompileUnitInfo *GetCompileUnitInfo(SymbolFileDWARF *oso_dwarf);
276
278
280 const DWARFDIE &die, ConstString type_name, bool must_be_implementation);
281
282 llvm::DenseMap<lldb::opaque_compiler_type_t, DIERef> &
286
290
291 llvm::DenseMap<const DWARFDebugInfoEntry *, Type *> &GetDIEToType() {
292 return m_die_to_type;
293 }
294
295 // OSOEntry
296 class OSOEntry {
297 public:
298 OSOEntry() = default;
299
300 OSOEntry(uint32_t exe_sym_idx, lldb::addr_t oso_file_addr)
301 : m_exe_sym_idx(exe_sym_idx), m_oso_file_addr(oso_file_addr) {}
302
303 uint32_t GetExeSymbolIndex() const { return m_exe_sym_idx; }
304
305 bool operator<(const OSOEntry &rhs) const {
306 return m_exe_sym_idx < rhs.m_exe_sym_idx;
307 }
308
310
311 void SetOSOFileAddress(lldb::addr_t oso_file_addr) {
312 m_oso_file_addr = oso_file_addr;
313 }
314
315 protected:
318 };
319
321
322 // Member Variables
323 std::bitset<kNumFlags> m_flags;
324 std::vector<CompileUnitInfo> m_compile_unit_infos;
325 std::vector<uint32_t> m_func_indexes; // Sorted by address
326 std::vector<uint32_t> m_glob_indexes;
327 std::map<std::pair<ConstString, llvm::sys::TimePoint<>>, OSOInfoSP> m_oso_map;
328 // A map from CompilerType to the struct/class/union/enum DIE (might be a
329 // declaration or a definition) that is used to construct it.
330 llvm::DenseMap<lldb::opaque_compiler_type_t, DIERef>
333 llvm::DenseMap<const DWARFDebugInfoEntry *, Type *> m_die_to_type;
334
336
337 // When an object file from the debug map gets parsed in
338 // SymbolFileDWARF, it needs to tell the debug map about the object
339 // files addresses by calling this function once for each N_FUN,
340 // N_GSYM and N_STSYM and after all entries in the debug map have
341 // been matched up, FinalizeOSOFileRanges() should be called.
342 bool AddOSOFileRange(CompileUnitInfo *cu_info, lldb::addr_t exe_file_addr,
343 lldb::addr_t exe_byte_size, lldb::addr_t oso_file_addr,
344 lldb::addr_t oso_byte_size);
345
346 // Called after calling AddOSOFileRange() for each object file debug
347 // map entry to finalize the info for the unlinked compile unit.
349
350 /// Convert \a addr from a .o file address, to an executable address.
351 ///
352 /// \param[in] addr
353 /// A section offset address from a .o file
354 ///
355 /// \return
356 /// Returns true if \a addr was converted to be an executable
357 /// section/offset address, false otherwise.
358 bool LinkOSOAddress(Address &addr);
359
360 /// Convert a .o file "file address" to an executable "file address".
361 ///
362 /// \param[in] oso_symfile
363 /// The DWARF symbol file that contains \a oso_file_addr
364 ///
365 /// \param[in] oso_file_addr
366 /// A .o file "file address" to convert.
367 ///
368 /// \return
369 /// LLDB_INVALID_ADDRESS if \a oso_file_addr is not in the
370 /// linked executable, otherwise a valid "file address" from the
371 /// linked executable that contains the debug map.
373 lldb::addr_t oso_file_addr);
374
375 /// Given a line table full of lines with "file addresses" that are
376 /// for a .o file represented by \a oso_symfile, link a new line table
377 /// and return it.
378 ///
379 /// \param[in] oso_symfile
380 /// The DWARF symbol file that produced the \a line_table
381 ///
382 /// \param[in] line_table
383 /// A pointer to the line table.
384 ///
385 /// \return
386 /// Returns a valid line table full of linked addresses, or NULL
387 /// if none of the line table addresses exist in the main
388 /// executable.
390 LineTable *line_table);
391
392 size_t AddOSOARanges(SymbolFileDWARF *dwarf2Data,
393 DWARFDebugAranges *debug_aranges);
394};
395} // namespace dwarf
396} // namespace lldb_private::plugin
397
398#endif // LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_SYMBOLFILEDWARFDEBUGMAP_H
#define lldbassert(x)
Definition LLDBAssert.h:16
A section + offset based address class.
Definition Address.h:62
A class that describes a compilation unit.
Definition CompileUnit.h:43
Represents a generic declaration context in a program.
Generic representation of a type in a programming language.
A uniqued constant string class.
Definition ConstString.h:40
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
A file utility class.
Definition FileSpec.h:57
A class that describes a function.
Definition Function.h:400
A line table class.
Definition LineTable.h:25
A collection class for Module objects.
Definition ModuleList.h:104
A class that encapsulates name lookup information.
Definition Module.h:916
A class that describes an executable image and its associated object and symbol files.
Definition Module.h:90
A plug-in interface definition class for object file parsers.
Definition ObjectFile.h:45
"lldb/Core/SourceLocationSpec.h" A source location specifier class.
This base class provides an interface to stack frames.
Definition StackFrame.h:44
An error handling class.
Definition Status.h:118
A stream class that can stream formatted output to a file.
Definition Stream.h:28
A list of support files for a CompileUnit.
Defines a list of symbol context objects.
"lldb/Symbol/SymbolContextScope.h" Inherit from this if your object is part of a symbol context and c...
Defines a symbol context baton that can be handed other debug core functions.
bool isA(const void *ClassID) const override
LLVM RTTI support.
Definition SymbolFile.h:544
SymbolFileCommon(lldb::ObjectFileSP objfile_sp)
Definition SymbolFile.h:551
Provides public interface for all SymbolFiles.
Definition SymbolFile.h:51
virtual bool isA(const void *ClassID) const
LLVM RTTI support.
Definition SymbolFile.h:58
std::unordered_map< lldb::CompUnitSP, Args > GetCompileOptions()
Returns a map of compilation unit to the compile option arguments associated with that compilation un...
Definition SymbolFile.h:516
A class that contains all state required for type lookups.
Definition Type.h:104
This class tracks the state and results of a TypeQuery.
Definition Type.h:344
An abstraction for Xcode-style SDKs that works like ArchSpec.
Definition XcodeSDK.h:25
Identifies a DWARF debug info entry within a given Module.
Definition DIERef.h:31
std::optional< uint32_t > file_index() const
Definition DIERef.h:60
OSOEntry(uint32_t exe_sym_idx, lldb::addr_t oso_file_addr)
void ForEachSymbolFile(std::string description, std::function< IterationAction(SymbolFileDWARF &)> closure)
If closure returns IterationAction::Continue, iteration continues.
llvm::DenseMap< const DWARFDebugInfoEntry *, Type * > m_die_to_type
static SymbolFileDWARF * GetSymbolFileAsSymbolFileDWARF(SymbolFile *sym_file)
RangeDataVector< lldb::addr_t, lldb::addr_t, lldb::addr_t > FileRangeMap
Status CalculateFrameVariableError(StackFrame &frame) override
Subclasses will override this function to for GetFrameVariableError().
CompileUnitInfo * GetCompUnitInfo(const SymbolContext &sc)
std::map< std::pair< ConstString, llvm::sys::TimePoint<> >, OSOInfoSP > m_oso_map
CompilerDeclContext GetDeclContextContainingUID(lldb::user_id_t uid) override
void DumpClangAST(Stream &s, llvm::StringRef filter, bool show_color) override
void ParseDeclsForContext(CompilerDeclContext decl_ctx) override
bool GetSeparateDebugInfo(StructuredData::Dictionary &d, bool errors_only, bool load_all_debug_info=false) override
List separate oso files.
void FindGlobalVariables(ConstString name, const CompilerDeclContext &parent_decl_ctx, uint32_t max_matches, VariableList &variables) override
SymbolFileDWARF * GetSymbolFileByCompUnitInfo(CompileUnitInfo *comp_unit_info)
lldb::CompUnitSP GetCompileUnit(SymbolFileDWARF *oso_dwarf, DWARFCompileUnit &dwarf_cu)
Returns the compile unit associated with the dwarf compile unit.
llvm::DenseMap< lldb::opaque_compiler_type_t, DIERef > & GetForwardDeclCompilerTypeToDIE()
bool ForEachExternalModule(CompileUnit &, llvm::DenseSet< SymbolFile * > &, llvm::function_ref< bool(Module &)>) override
uint32_t ResolveSymbolContext(const Address &so_addr, lldb::SymbolContextItem resolve_scope, SymbolContext &sc) override
lldb::TypeSP FindCompleteObjCDefinitionTypeForDIE(const DWARFDIE &die, ConstString type_name, bool must_be_implementation)
CompileUnitInfo * GetCompileUnitInfoForSymbolWithIndex(uint32_t symbol_idx, uint32_t *oso_idx_ptr)
bool CompleteType(CompilerType &compiler_type) override
ModuleList GetDebugInfoModules() override
Get the additional modules that this symbol file uses to parse debug info.
RangeDataVector< lldb::addr_t, lldb::addr_t, OSOEntry > DebugMap
lldb::CompUnitSP ParseCompileUnitAtIndex(uint32_t index) override
This function actually returns the first compile unit the object file at the given index contains.
bool isA(const void *ClassID) const override
LLVM RTTI support.
std::vector< CompilerContext > GetCompilerContextForUID(lldb::user_id_t uid) override
lldb::addr_t LinkOSOFileAddress(SymbolFileDWARF *oso_symfile, lldb::addr_t oso_file_addr)
Convert a .o file "file address" to an executable "file address".
SymbolFileDWARF * GetSymbolFile(const SymbolContext &sc)
void PrivateFindGlobalVariables(ConstString name, const CompilerDeclContext &parent_decl_ctx, const std::vector< uint32_t > &name_symbol_indexes, uint32_t max_matches, VariableList &variables)
void FindTypes(const lldb_private::TypeQuery &match, lldb_private::TypeResults &results) override
Find types using a type-matching object that contains all search parameters.
std::optional< ArrayInfo > GetDynamicArrayInfoForUID(lldb::user_id_t type_uid, const ExecutionContext *exe_ctx) override
If type_uid points to an array type, return its characteristics.
CompileUnitInfo * GetCompileUnitInfo(SymbolFileDWARF *oso_dwarf)
bool GetFileSpecForSO(uint32_t oso_idx, FileSpec &file_spec)
ObjectFile * GetObjectFileByCompUnitInfo(CompileUnitInfo *comp_unit_info)
static SymbolFile * CreateInstance(lldb::ObjectFileSP objfile_sp)
CompilerDeclContext FindNamespace(ConstString name, const CompilerDeclContext &parent_decl_ctx, bool only_root_namespaces) override
Finds a namespace of name name and whose parent context is parent_decl_ctx.
std::vector< std::unique_ptr< CallEdge > > ParseCallEdgesInFunction(UserID func_id) override
lldb::LanguageType ParseLanguage(CompileUnit &comp_unit) override
size_t ParseVariablesForContext(const SymbolContext &sc) override
llvm::SmallSet< lldb::LanguageType, 4 > ParseAllLanguages(CompileUnit &comp_unit) override
This function exists because SymbolFileDWARFDebugMap may extra compile units which aren't exposed as ...
uint32_t ResolveSymbolContext(const SourceLocationSpec &src_location_spec, lldb::SymbolContextItem resolve_scope, SymbolContextList &sc_list) override
uint32_t GetCompUnitInfoIndex(const CompileUnitInfo *comp_unit_info)
Module * GetModuleByCompUnitInfo(CompileUnitInfo *comp_unit_info)
XcodeSDK ParseXcodeSDK(CompileUnit &comp_unit) override
Return the Xcode SDK comp_unit was compiled against.
size_t AddOSOARanges(SymbolFileDWARF *dwarf2Data, DWARFDebugAranges *debug_aranges)
void FindFunctions(const Module::LookupInfo &lookup_info, const CompilerDeclContext &parent_decl_ctx, bool include_inlines, SymbolContextList &sc_list) override
void GetTypes(SymbolContextScope *sc_scope, lldb::TypeClass type_mask, TypeList &type_list) override
llvm::Expected< SymbolContext > ResolveFunctionCallLabel(FunctionCallLabel &label) override
Resolves the function corresponding to the specified LLDB function call label.
bool AddOSOFileRange(CompileUnitInfo *cu_info, lldb::addr_t exe_file_addr, lldb::addr_t exe_byte_size, lldb::addr_t oso_file_addr, lldb::addr_t oso_byte_size)
bool ParseSupportFiles(CompileUnit &comp_unit, SupportFileList &support_files) override
void SetCompileUnit(SymbolFileDWARF *oso_dwarf, const lldb::CompUnitSP &cu_sp)
Type * ResolveTypeUID(lldb::user_id_t type_uid) override
static int SymbolContainsSymbolWithID(lldb::user_id_t *symbol_idx_ptr, const CompileUnitInfo *comp_unit_info)
static int SymbolContainsSymbolWithIndex(uint32_t *symbol_idx_ptr, const CompileUnitInfo *comp_unit_info)
uint32_t CalculateNumCompileUnits() override
This function actually returns the number of object files, which may be less than the actual number o...
bool ParseImportedModules(const SymbolContext &sc, std::vector< SourceModule > &imported_modules) override
llvm::DenseMap< const DWARFDebugInfoEntry *, Type * > & GetDIEToType()
size_t GetCompUnitInfosForModule(const Module *oso_module, std::vector< CompileUnitInfo * > &cu_infos)
bool LinkOSOAddress(Address &addr)
Convert addr from a .o file address, to an executable address.
llvm::DenseMap< lldb::opaque_compiler_type_t, DIERef > m_forward_decl_compiler_type_to_die
void InitializeObject() override
Initialize the SymbolFile object.
CompilerDeclContext GetDeclContextForUID(lldb::user_id_t uid) override
CompileUnitInfo * GetCompileUnitInfoForSymbolWithID(lldb::user_id_t symbol_id, uint32_t *oso_idx_ptr)
LineTable * LinkOSOLineTable(SymbolFileDWARF *oso_symfile, LineTable *line_table)
Given a line table full of lines with "file addresses" that are for a .o file represented by oso_symf...
#define LLDB_INVALID_ADDRESS
#define UINT32_MAX
IterationAction
Useful for callbacks whose return type indicates whether to continue iteration or short-circuit.
std::shared_ptr< lldb_private::ObjectFile > ObjectFileSP
LanguageType
Programming language type.
std::shared_ptr< lldb_private::Type > TypeSP
uint64_t user_id_t
Definition lldb-types.h:82
uint64_t addr_t
Definition lldb-types.h:80
std::shared_ptr< lldb_private::Module > ModuleSP
std::shared_ptr< lldb_private::CompileUnit > CompUnitSP
Holds parsed information about a function call label that LLDB attaches as an AsmLabel to function AS...
Definition Expression.h:110
A mix in class that contains a generic user ID.
Definition UserID.h:31
const FileRangeMap & GetFileRangeMap(SymbolFileDWARFDebugMap *exe_symfile)
llvm::SmallVector< lldb::CompUnitSP, 2 > compile_units_sps
The compile units that an object file contains.
llvm::SmallDenseMap< uint64_t, uint64_t, 2 > id_to_index_map
A map from the compile unit ID to its index in the vector.