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"
23
25
26namespace lldb_private::plugin {
27namespace dwarf {
28class SymbolFileDWARF;
29class DWARFCompileUnit;
30class DWARFDebugAranges;
31class DWARFDeclContext;
32
34 /// LLVM RTTI support.
35 static char ID;
36
37public:
38 /// LLVM RTTI support.
39 /// \{
40 bool isA(const void *ClassID) const override {
41 return ClassID == &ID || SymbolFileCommon::isA(ClassID);
42 }
43 static bool classof(const SymbolFile *obj) { return obj->isA(&ID); }
44 /// \}
45
46 // Static Functions
47 static void Initialize();
48
49 static void Terminate();
50
51 static llvm::StringRef GetPluginNameStatic() { return "dwarf-debugmap"; }
52
53 static llvm::StringRef GetPluginDescriptionStatic();
54
56
57 // Constructors and Destructors
60
61 uint32_t CalculateAbilities() override;
62 void InitializeObject() override;
63
64 // Compile Unit function calls
65 lldb::LanguageType ParseLanguage(CompileUnit &comp_unit) override;
66 XcodeSDK ParseXcodeSDK(CompileUnit &comp_unit) override;
67 llvm::SmallSet<lldb::LanguageType, 4>
68 ParseAllLanguages(CompileUnit &comp_unit) override;
69 size_t ParseFunctions(CompileUnit &comp_unit) override;
70 bool ParseLineTable(CompileUnit &comp_unit) override;
71 bool ParseDebugMacros(CompileUnit &comp_unit) override;
72
73 bool ForEachExternalModule(CompileUnit &, llvm::DenseSet<SymbolFile *> &,
74 llvm::function_ref<bool(Module &)>) override;
75
76 bool ParseSupportFiles(CompileUnit &comp_unit,
77 FileSpecList &support_files) override;
78
79 bool ParseIsOptimized(CompileUnit &comp_unit) override;
80
81 size_t ParseTypes(CompileUnit &comp_unit) override;
82
83 bool
85 std::vector<SourceModule> &imported_modules) override;
86 size_t ParseBlocksRecursive(Function &func) override;
87 size_t ParseVariablesForContext(const SymbolContext &sc) override;
88
89 Type *ResolveTypeUID(lldb::user_id_t type_uid) override;
90 std::optional<ArrayInfo>
92 const ExecutionContext *exe_ctx) override;
93
96 std::vector<CompilerContext>
98 void ParseDeclsForContext(CompilerDeclContext decl_ctx) override;
99
100 bool CompleteType(CompilerType &compiler_type) override;
101 uint32_t ResolveSymbolContext(const Address &so_addr,
102 lldb::SymbolContextItem resolve_scope,
103 SymbolContext &sc) override;
104 uint32_t ResolveSymbolContext(const SourceLocationSpec &src_location_spec,
105 lldb::SymbolContextItem resolve_scope,
106 SymbolContextList &sc_list) override;
107
109
111 const CompilerDeclContext &parent_decl_ctx,
112 uint32_t max_matches,
113 VariableList &variables) override;
114 void FindGlobalVariables(const RegularExpression &regex, uint32_t max_matches,
115 VariableList &variables) override;
116 void FindFunctions(const Module::LookupInfo &lookup_info,
117 const CompilerDeclContext &parent_decl_ctx,
118 bool include_inlines, SymbolContextList &sc_list) override;
119 void FindFunctions(const RegularExpression &regex, bool include_inlines,
120 SymbolContextList &sc_list) override;
121 void FindTypes(ConstString name, const CompilerDeclContext &parent_decl_ctx,
122 uint32_t max_matches,
123 llvm::DenseSet<SymbolFile *> &searched_symbol_files,
124 TypeMap &types) override;
125 void FindTypes(llvm::ArrayRef<CompilerContext> context, LanguageSet languages,
126 llvm::DenseSet<SymbolFile *> &searched_symbol_files,
127 TypeMap &types) override;
129 const CompilerDeclContext &parent_decl_ctx,
130 bool only_root_namespaces) override;
131 void GetTypes(SymbolContextScope *sc_scope, lldb::TypeClass type_mask,
132 TypeList &type_list) override;
133 std::vector<std::unique_ptr<CallEdge>>
134 ParseCallEdgesInFunction(UserID func_id) override;
135
136 void DumpClangAST(Stream &s) override;
137
138 /// List separate oso files.
140 bool errors_only) override;
141
142 // PluginInterface protocol
143 llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }
144
145 // Statistics overrides.
147
148 void
149 GetCompileOptions(std::unordered_map<lldb::CompUnitSP, Args> &args) override;
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;
158 struct OSOInfo {
160
162 };
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 "false", iteration continues. If it returns
242 // "true", iteration terminates.
243 void ForEachSymbolFile(std::function<bool(SymbolFileDWARF *)> closure) {
244 for (uint32_t oso_idx = 0, num_oso_idxs = m_compile_unit_infos.size();
245 oso_idx < num_oso_idxs; ++oso_idx) {
246 if (SymbolFileDWARF *oso_dwarf = GetSymbolFileByOSOIndex(oso_idx)) {
247 if (closure(oso_dwarf))
248 return;
249 }
250 }
251 }
252
253 CompileUnitInfo *GetCompileUnitInfoForSymbolWithIndex(uint32_t symbol_idx,
254 uint32_t *oso_idx_ptr);
255
256 CompileUnitInfo *GetCompileUnitInfoForSymbolWithID(lldb::user_id_t symbol_id,
257 uint32_t *oso_idx_ptr);
258
259 static int
260 SymbolContainsSymbolWithIndex(uint32_t *symbol_idx_ptr,
261 const CompileUnitInfo *comp_unit_info);
262
263 static int SymbolContainsSymbolWithID(lldb::user_id_t *symbol_idx_ptr,
264 const CompileUnitInfo *comp_unit_info);
265
266 void
268 const CompilerDeclContext &parent_decl_ctx,
269 const std::vector<uint32_t> &name_symbol_indexes,
270 uint32_t max_matches, VariableList &variables);
271
272 void SetCompileUnit(SymbolFileDWARF *oso_dwarf,
273 const lldb::CompUnitSP &cu_sp);
274
275 /// Returns the compile unit associated with the dwarf compile unit. This may
276 /// be one of the extra compile units an object file contains which isn't
277 /// reachable by ParseCompileUnitAtIndex(uint32_t).
279 DWARFCompileUnit &dwarf_cu);
280
281 CompileUnitInfo *GetCompileUnitInfo(SymbolFileDWARF *oso_dwarf);
282
284
286
288 const DWARFDIE &die, ConstString type_name, bool must_be_implementation);
289
292 }
293
294 // OSOEntry
295 class OSOEntry {
296 public:
297 OSOEntry() = default;
298
299 OSOEntry(uint32_t exe_sym_idx, lldb::addr_t oso_file_addr)
300 : m_exe_sym_idx(exe_sym_idx), m_oso_file_addr(oso_file_addr) {}
301
302 uint32_t GetExeSymbolIndex() const { return m_exe_sym_idx; }
303
304 bool operator<(const OSOEntry &rhs) const {
305 return m_exe_sym_idx < rhs.m_exe_sym_idx;
306 }
307
309
310 void SetOSOFileAddress(lldb::addr_t oso_file_addr) {
311 m_oso_file_addr = oso_file_addr;
312 }
313
314 protected:
317 };
318
320
321 // Member Variables
322 std::bitset<kNumFlags> m_flags;
323 std::vector<CompileUnitInfo> m_compile_unit_infos;
324 std::vector<uint32_t> m_func_indexes; // Sorted by address
325 std::vector<uint32_t> m_glob_indexes;
326 std::map<std::pair<ConstString, llvm::sys::TimePoint<>>, OSOInfoSP> m_oso_map;
330
331 // When an object file from the debug map gets parsed in
332 // SymbolFileDWARF, it needs to tell the debug map about the object
333 // files addresses by calling this function once for each N_FUN,
334 // N_GSYM and N_STSYM and after all entries in the debug map have
335 // been matched up, FinalizeOSOFileRanges() should be called.
336 bool AddOSOFileRange(CompileUnitInfo *cu_info, lldb::addr_t exe_file_addr,
337 lldb::addr_t exe_byte_size, lldb::addr_t oso_file_addr,
338 lldb::addr_t oso_byte_size);
339
340 // Called after calling AddOSOFileRange() for each object file debug
341 // map entry to finalize the info for the unlinked compile unit.
343
344 /// Convert \a addr from a .o file address, to an executable address.
345 ///
346 /// \param[in] addr
347 /// A section offset address from a .o file
348 ///
349 /// \return
350 /// Returns true if \a addr was converted to be an executable
351 /// section/offset address, false otherwise.
352 bool LinkOSOAddress(Address &addr);
353
354 /// Convert a .o file "file address" to an executable "file address".
355 ///
356 /// \param[in] oso_symfile
357 /// The DWARF symbol file that contains \a oso_file_addr
358 ///
359 /// \param[in] oso_file_addr
360 /// A .o file "file address" to convert.
361 ///
362 /// \return
363 /// LLDB_INVALID_ADDRESS if \a oso_file_addr is not in the
364 /// linked executable, otherwise a valid "file address" from the
365 /// linked executable that contains the debug map.
367 lldb::addr_t oso_file_addr);
368
369 /// Given a line table full of lines with "file addresses" that are
370 /// for a .o file represented by \a oso_symfile, link a new line table
371 /// and return it.
372 ///
373 /// \param[in] oso_symfile
374 /// The DWARF symbol file that produced the \a line_table
375 ///
376 /// \param[in] line_table
377 /// A pointer to the line table.
378 ///
379 /// \return
380 /// Returns a valid line table full of linked addresses, or NULL
381 /// if none of the line table addresses exist in the main
382 /// executable.
384 LineTable *line_table);
385
386 size_t AddOSOARanges(SymbolFileDWARF *dwarf2Data,
387 DWARFDebugAranges *debug_aranges);
388};
389} // namespace dwarf
390} // namespace lldb_private::plugin
391
392#endif // LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_SYMBOLFILEDWARFDEBUGMAP_H
#define lldbassert(x)
Definition: LLDBAssert.h:15
A section + offset based address class.
Definition: Address.h:59
A class that describes a compilation unit.
Definition: CompileUnit.h:41
Represents a generic declaration context in a program.
Generic representation of a type in a programming language.
Definition: CompilerType.h:36
A uniqued constant string class.
Definition: ConstString.h:40
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
A file collection class.
Definition: FileSpecList.h:24
A file utility class.
Definition: FileSpec.h:57
A class that describes a function.
Definition: Function.h:399
A line table class.
Definition: LineTable.h:40
A collection class for Module objects.
Definition: ModuleList.h:82
A class that encapsulates name lookup information.
Definition: Module.h:949
A class that describes an executable image and its associated object and symbol files.
Definition: Module.h:88
A plug-in interface definition class for object file parsers.
Definition: ObjectFile.h:44
"lldb/Core/SourceLocationSpec.h" A source location specifier class.
This base class provides an interface to stack frames.
Definition: StackFrame.h:42
An error handling class.
Definition: Status.h:44
A stream class that can stream formatted output to a file.
Definition: Stream.h:28
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.
Definition: SymbolContext.h:33
Containing protected virtual methods for child classes to override.
Definition: SymbolFile.h:489
bool isA(const void *ClassID) const override
LLVM RTTI support.
Definition: SymbolFile.h:496
Provides public interface for all SymbolFiles.
Definition: SymbolFile.h:50
virtual bool isA(const void *ClassID) const
LLVM RTTI support.
Definition: SymbolFile.h:57
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:470
An abstraction for Xcode-style SDKs that works like ArchSpec.
Definition: XcodeSDK.h:24
Identifies a DWARF debug info entry within a given Module.
Definition: DIERef.h:30
std::optional< uint32_t > file_index() const
Definition: DIERef.h:59
OSOEntry(uint32_t exe_sym_idx, lldb::addr_t oso_file_addr)
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 ParseDeclsForContext(CompilerDeclContext decl_ctx) override
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.
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 GetSeparateDebugInfo(StructuredData::Dictionary &d, bool errors_only) override
List separate oso files.
bool CompleteType(CompilerType &compiler_type) override
ModuleList GetDebugInfoModules() override
Get the additional modules that this symbol file uses to parse debug info.
bool Supports_DW_AT_APPLE_objc_complete_type(SymbolFileDWARF *skip_dwarf_oso)
RangeDataVector< lldb::addr_t, lldb::addr_t, OSOEntry > DebugMap
bool ParseSupportFiles(CompileUnit &comp_unit, FileSpecList &support_files) override
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
void FindTypes(llvm::ArrayRef< CompilerContext > context, LanguageSet languages, llvm::DenseSet< SymbolFile * > &searched_symbol_files, TypeMap &types) 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)
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.
void ForEachSymbolFile(std::function< bool(SymbolFileDWARF *)> closure)
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)
void FindTypes(ConstString name, const CompilerDeclContext &parent_decl_ctx, uint32_t max_matches, llvm::DenseSet< SymbolFile * > &searched_symbol_files, TypeMap &types) override
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)
size_t ParseFunctions(CompileUnit &comp_unit) override
XcodeSDK ParseXcodeSDK(CompileUnit &comp_unit) override
Return the Xcode SDK comp_unit was compiled against.
size_t AddOSOARanges(SymbolFileDWARF *dwarf2Data, DWARFDebugAranges *debug_aranges)
static uint32_t GetOSOIndexFromUserID(lldb::user_id_t uid)
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
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)
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
lldb::TypeSP FindDefinitionTypeForDWARFDeclContext(const DWARFDIE &die)
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.
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
Definition: lldb-defines.h:82
#define UINT32_MAX
Definition: lldb-defines.h:19
std::shared_ptr< lldb_private::ObjectFile > ObjectFileSP
Definition: lldb-forward.h:363
LanguageType
Programming language type.
std::shared_ptr< lldb_private::Type > TypeSP
Definition: lldb-forward.h:445
uint64_t user_id_t
Definition: lldb-types.h:80
uint64_t addr_t
Definition: lldb-types.h:79
std::shared_ptr< lldb_private::Module > ModuleSP
Definition: lldb-forward.h:361
std::shared_ptr< lldb_private::CompileUnit > CompUnitSP
Definition: lldb-forward.h:323
A SmallBitVector that represents a set of source languages (lldb::LanguageType).
Definition: TypeSystem.h:51
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.