[Lldb-commits] [PATCH] D84402: [lldb/DWARF] Add more line table validation

2020-07-27 Thread Greg Clayton via Phabricator via lldb-commits
clayborg added a comment. I really like the idea of coming up with a low PC that is the first valid .text address. This will filter out many of the zeroed out dead stripped DWARF and will make a cheap way for us to check addresses when parsing debug info and line tables. Checking for -1 and -2

[Lldb-commits] [PATCH] D84402: [lldb/DWARF] Add more line table validation

2020-07-27 Thread Pavel Labath via Phabricator via lldb-commits
labath marked an inline comment as done. labath added inline comments. Comment at: lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp:1044 for (const llvm::DWARFDebugLine::Sequence &seq : line_table->Sequences) { +if (!list.ContainsFileAddressRange(seq.LowPC, seq.Hig

[Lldb-commits] [PATCH] D84402: [lldb/DWARF] Add more line table validation

2020-07-24 Thread Fangrui Song via Phabricator via lldb-commits
MaskRay added a comment. For ELF, there are non-pic cases (i.e. -no-pie) and pic cases (-pie or -shared). I think it is sufficient just testing -pie (image base is zero). If filtering for -pie works, filter for -no-pie or -shared should work as well. Comment at: lldb/source/P

[Lldb-commits] [PATCH] D84402: [lldb/DWARF] Add more line table validation

2020-07-24 Thread Greg Clayton via Phabricator via lldb-commits
clayborg added inline comments. Comment at: lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp:1044 for (const llvm::DWARFDebugLine::Sequence &seq : line_table->Sequences) { +if (!list.ContainsFileAddressRange(seq.LowPC, seq.HighPC - seq.LowPC)) + continue;

[Lldb-commits] [PATCH] D84402: [lldb/DWARF] Add more line table validation

2020-07-24 Thread Pavel Labath via Phabricator via lldb-commits
labath marked an inline comment as done. labath added inline comments. Comment at: lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp:1044 for (const llvm::DWARFDebugLine::Sequence &seq : line_table->Sequences) { +if (!list.ContainsFileAddressRange(seq.LowPC, seq.Hig

[Lldb-commits] [PATCH] D84402: [lldb/DWARF] Add more line table validation

2020-07-23 Thread Greg Clayton via Phabricator via lldb-commits
clayborg added a comment. If we do make a set of text ranges in SymbolFileDWARF, we should avoid producing function's whose address ranges are not within these bounds as well, so there are other uses for this text ranges list in SymbolFileDWARF. Repository: rG LLVM Github Monorepo CHANGES S

[Lldb-commits] [PATCH] D84402: [lldb/DWARF] Add more line table validation

2020-07-23 Thread Greg Clayton via Phabricator via lldb-commits
clayborg added inline comments. Comment at: lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp:1044 for (const llvm::DWARFDebugLine::Sequence &seq : line_table->Sequences) { +if (!list.ContainsFileAddressRange(seq.LowPC, seq.HighPC - seq.LowPC)) + continue;

[Lldb-commits] [PATCH] D84402: [lldb/DWARF] Add more line table validation

2020-07-23 Thread David Blaikie via Phabricator via lldb-commits
dblaikie added inline comments. Comment at: lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp:1044 for (const llvm::DWARFDebugLine::Sequence &seq : line_table->Sequences) { +if (!list.ContainsFileAddressRange(seq.LowPC, seq.HighPC - seq.LowPC)) + continue;

[Lldb-commits] [PATCH] D84402: [lldb/DWARF] Add more line table validation

2020-07-23 Thread Pavel Labath via Phabricator via lldb-commits
labath marked an inline comment as done. labath added inline comments. Comment at: lldb/test/Shell/SymbolFile/DWARF/debug_line-tombstone.s:35-36 # CHECK-NEXT: Line table for main.cpp -# CHECK-NEXT: 0x1000: main.cpp:1 -# CHECK-NEXT: 0x1001: main.cpp:1 +# C

[Lldb-commits] [PATCH] D84402: [lldb/DWARF] Add more line table validation

2020-07-23 Thread Pavel Labath via Phabricator via lldb-commits
labath created this revision. labath added reviewers: JDevlieghere, MaskRay, clayborg. Herald added a subscriber: aprantl. Herald added a project: LLDB. The intention here is to prune out line sequences addresses referring outside any known sections. Such line sequences are typically produced by d