[lldb/DWARF] Add support for location lists in package files

The only thing needed was to account for the offset from the
debug_cu_index section when searching for the location list.

This patch also fixes a bug in the Module::ParseAllDebugSymbols
function, which meant that we would only parse the variables of the
first compile unit in the module. This function is only used from
lldb-test, so this does not fix any real issue, besides preventing me
from writing a test for this patch.
This commit is contained in:
Pavel Labath
2020-02-18 13:33:59 +01:00
parent 9746b3ae07
commit 8131cb6e18
4 changed files with 107 additions and 12 deletions

View File

@@ -364,11 +364,11 @@ void Module::ParseAllDebugSymbols() {
if (num_comp_units == 0)
return;
SymbolContext sc;
sc.module_sp = shared_from_this();
SymbolFile *symbols = GetSymbolFile();
for (size_t cu_idx = 0; cu_idx < num_comp_units; cu_idx++) {
SymbolContext sc;
sc.module_sp = shared_from_this();
sc.comp_unit = symbols->GetCompileUnitAtIndex(cu_idx).get();
if (!sc.comp_unit)
continue;