[lldb-dev] Making a new symbol provider

Greg Clayton via lldb-dev lldb-dev at lists.llvm.org
Mon Feb 29 17:29:26 PST 2016


> On Feb 29, 2016, at 5:09 PM, Zachary Turner <zturner at google.com> wrote:
> 
> Suppose you've got two line sequences.  
> 
> First sequence:
> 4198512
> 4198544
> 4198547
> 4198562
> 
> Second sequence:
> 4198528
> 4198531
> 4198537
> 4198552
> 
> These two line sequences overlap, and will not be inserted correctly into a LineTable.  This sounds like a bug to me, because as far as I can tell there is nothing preventing LineSequences being organized this way, but LineTable::InsertSequence assumes that this cannot happen.

Are these addresses or line numbers? If PDB can has its line tables randomly ordered, you will need to read all line entries out of the PDB file first into one big collection of all line entries, and remember if any are line termination entries and then make sequences out of the large collection you end up with.

We only expect to get one line entry for a given load address and I believe that is reasonable. The registration process for line entries is very DWARF centric right now, but I think that the end goal if having line table sequences in ascending order that have a single file and line for a given load address is a valid assumption.

So it sounds like you just need to read all of your stuff into one large buffer and then figure out how you want to register those sequences so they make sense.

In DWARF if you have a line tables like:

0x1000: foo.c line 1
0x1010: foo.c line 2
0x1030: foo.c line 3
0x1040: termination entry

0x2000: foo.c line 11
0x2010: foo.c line 12
0x2020: foo.c line 13
0x2050: termination entry

These are both sequences that define address ranges and we always know the address range of each line entry because the last entry in a contiguous line sequence always has a last entry to define the size of the last valid (non termination entry) line entry. 

How does the PDB file format emit it line table entries? Would it be equivalent to the DWARF with no termination entries? Something like:

0x1000: foo.c line 1
0x1010: foo.c line 2
0x1030: foo.c line 3

0x2000: foo.c line 11
0x2010: foo.c line 12
0x2020: foo.c line 13

If that is the case, how do you deal with large gaps like the gap between 0x1040 and 0x2000?

And if I read what you are saying correctly you are saying your line tables might come out like:

0x1000: foo.c line 1
0x2000: foo.c line 11
0x1010: foo.c line 2
0x2010: foo.c line 12
0x1030: foo.c line 3
0x2020: foo.c line 13

Questions:

- Does PDB emit ranges for each line or just a single address?
- Does PDB have termination entries for the equivalent of address 0x1040 and 0x2050?



More information about the lldb-dev mailing list