Re: [lldb-dev] Question about building line tables

2016-03-08 Thread Zachary Turner via lldb-dev
Yea, I already whipped up some changes locally that do almost exactly that. On Tue, Mar 8, 2016 at 3:17 PM Greg Clayton wrote: > If the PDB line tables have sizes you could do: > > PDBLineEntry curr = pdb->GetLineEntry(n); > PDBLineEntry next = pdb->GetLineEntry(n+1); > > line_entries.insert(cur

Re: [lldb-dev] Question about building line tables

2016-03-08 Thread Greg Clayton via lldb-dev
If the PDB line tables have sizes you could do: PDBLineEntry curr = pdb->GetLineEntry(n); PDBLineEntry next = pdb->GetLineEntry(n+1); line_entries.insert(curr.addr, curr.line, curr.file, false /*is_terminal*/); if (curr.addr + curr.size != next.addr) { // Insert terminal entry for end of cur

Re: [lldb-dev] Question about building line tables

2016-03-08 Thread Greg Clayton via lldb-dev
Yep > On Mar 8, 2016, at 12:56 PM, Zachary Turner wrote: > > Let's suppose I've got this function (ignore the operands to branch > instructions, I disassembled a real function and just manually adjusted > addresses on the left side only just to create a contrived example). > > infinite-dwarf

Re: [lldb-dev] Question about building line tables

2016-03-08 Thread Zachary Turner via lldb-dev
Let's suppose I've got this function (ignore the operands to branch instructions, I disassembled a real function and just manually adjusted addresses on the left side only just to create a contrived example). infinite-dwarf.exe`main at infinite.cpp:5 4 5int main(int argc, char **argv) {

Re: [lldb-dev] Question about building line tables

2016-03-07 Thread Greg Clayton via lldb-dev
> On Mar 7, 2016, at 3:21 PM, Zachary Turner wrote: > > Does DWARF not store this information? Because it seems like it could be > efficiently stored in an interval tree, the question is just whether it is > efficient to convert what DWARF stores into that format. No it stores it just like w

Re: [lldb-dev] Question about building line tables

2016-03-07 Thread Greg Clayton via lldb-dev
The one thing that might confuse you is we actually store line entries using lldb_private::LineTable::Entry structures which do not have the byte size or the file as a FileSpec: class LineTable { protected: struct Entry { lldb::addr_t file_addr; ///< The file address

Re: [lldb-dev] Question about building line tables

2016-03-07 Thread Zachary Turner via lldb-dev
Does DWARF not store this information? Because it seems like it could be efficiently stored in an interval tree, the question is just whether it is efficient to convert what DWARF stores into that format. PDB returns line entries in the format I described, with a start address and a byte length,

Re: [lldb-dev] Question about building line tables

2016-03-07 Thread Greg Clayton via lldb-dev
> On Mar 7, 2016, at 3:07 PM, Zachary Turner via lldb-dev > wrote: > > This discussion originally started on a code review thread, but I figured I > would continue it here since the patch has landed and I want to do more work > as a followup. > > So LLDB's LineTable data structures have the

[lldb-dev] Question about building line tables

2016-03-07 Thread Zachary Turner via lldb-dev
This discussion originally started on a code review thread, but I figured I would continue it here since the patch has landed and I want to do more work as a followup. So LLDB's LineTable data structures have the notion of a "terminal entry". As I understand it, LineTables are structured as a sequ