Skip to content

Commit 025eca9

Browse files
committed
Address review feedback
Changes: - make the llvm-index-cache directory based off of %t to ensure uniqueness - log to DWARF debug info channel when we fail to parse DWARFUnitHeaders
1 parent 039a8bf commit 025eca9

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include "DWARFDebugInfoEntry.h"
2525
#include "DWARFFormValue.h"
2626
#include "DWARFTypeUnit.h"
27+
#include "LogChannelDWARF.h"
2728

2829
using namespace lldb;
2930
using namespace lldb_private;
@@ -81,12 +82,14 @@ void DWARFDebugInfo::ParseUnitsFor(DIERef::Section section) {
8182
: m_context.getOrLoadDebugInfoData();
8283
lldb::offset_t offset = 0;
8384
while (data.ValidOffset(offset)) {
85+
const lldb::offset_t unit_header_offset = offset;
8486
llvm::Expected<DWARFUnitSP> expected_unit_sp =
8587
DWARFUnit::extract(m_dwarf, m_units.size(), data, section, &offset);
8688

8789
if (!expected_unit_sp) {
88-
// FIXME: Propagate this error up.
89-
llvm::consumeError(expected_unit_sp.takeError());
90+
Log *log = GetLog(DWARFLog::DebugInfo);
91+
LLDB_LOG(log, "Unable to extract DWARFUnitHeader at {0:x}: {1}",
92+
unit_header_offset, llvm::toString(expected_unit_sp.takeError()));
9093
return;
9194
}
9295

lldb/test/Shell/SymbolFile/DWARF/x86/dwp-separate-debug-file.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
// Run one time with the index cache enabled to populate the index cache. When
1212
// we populate the index cache we have to parse all of the DWARF debug info
1313
// and it is always available.
14-
// RUN: rm -rf %T/lldb-index-cache
14+
// RUN: rm -rf %t.lldb-index-cache
1515
// RUN: %lldb \
1616
// RUN: -O 'settings set symbols.enable-lldb-index-cache true' \
17-
// RUN: -O 'settings set symbols.lldb-index-cache-path %T/lldb-index-cache' \
17+
// RUN: -O 'settings set symbols.lldb-index-cache-path %t.lldb-index-cache' \
1818
// RUN: -O 'settings set target.preload-symbols false' \
1919
// RUN: -o "script lldb.target.modules[0].FindTypes('::A').GetTypeAtIndex(0)" \
2020
// RUN: -o "statistics dump" \
@@ -28,7 +28,7 @@
2828
// don't crash and that we can find types when using .dwp files.
2929
// RUN: %lldb \
3030
// RUN: -O 'settings set symbols.enable-lldb-index-cache true' \
31-
// RUN: -O 'settings set symbols.lldb-index-cache-path %T/lldb-index-cache' \
31+
// RUN: -O 'settings set symbols.lldb-index-cache-path %t.lldb-index-cache' \
3232
// RUN: -O 'settings set target.preload-symbols false' \
3333
// RUN: -o "script lldb.target.modules[0].FindTypes('::A').GetTypeAtIndex(0)" \
3434
// RUN: -o "statistics dump" \
@@ -46,10 +46,10 @@
4646
// Run one time with the index cache enabled to populate the index cache. When
4747
// we populate the index cache we have to parse all of the DWARF debug info
4848
// and it is always available.
49-
// RUN: rm -rf %T/lldb-index-cache
49+
// RUN: rm -rf %t.lldb-index-cache
5050
// RUN: %lldb \
5151
// RUN: -O 'settings set symbols.enable-lldb-index-cache true' \
52-
// RUN: -O 'settings set symbols.lldb-index-cache-path %T/lldb-index-cache' \
52+
// RUN: -O 'settings set symbols.lldb-index-cache-path %t.lldb-index-cache' \
5353
// RUN: -O 'settings set target.preload-symbols false' \
5454
// RUN: -o "script lldb.target.modules[0].FindTypes('::A').GetTypeAtIndex(0)" \
5555
// RUN: -o "statistics dump" \
@@ -63,7 +63,7 @@
6363
// don't crash and that we can find types when using .dwp files.
6464
// RUN: %lldb \
6565
// RUN: -O 'settings set symbols.enable-lldb-index-cache true' \
66-
// RUN: -O 'settings set symbols.lldb-index-cache-path %T/lldb-index-cache' \
66+
// RUN: -O 'settings set symbols.lldb-index-cache-path %t.lldb-index-cache' \
6767
// RUN: -O 'settings set target.preload-symbols false' \
6868
// RUN: -o "script lldb.target.modules[0].FindTypes('::A').GetTypeAtIndex(0)" \
6969
// RUN: -o "statistics dump" \

0 commit comments

Comments
 (0)