[lldb-dev] api questions

Greg Clayton gclayton at apple.com
Wed Sep 26 11:28:10 PDT 2012


On Sep 26, 2012, at 2:37 AM, Carlo Kok <ck at remobjects.com> wrote:

> Op 25-9-2012 22:13, Greg Clayton schreef:
>> 
>> On Sep 25, 2012, at 12:09 PM, Carlo Kok <ck at remobjects.com> wrote:
>> 
> 
> Two more questions:
> 
> Seems the memory maps for open files are kept open for caching purposes. Is there a way to force close them? On windows an open file means it cannot be written to.

When you delete a target, it will clean up any orphaned modules which should release your memory mapped files.

bool
SBDebugger::DeleteTarget (lldb::SBTarget &target)


> 
> EndRow/EndCol info. I noticed that when I emit debug info I have to do both start and end row/col, but when reading it back I only get start. Is there a way to get this info? (not sure if it's stored)

The line tables in DWARF only support a single column for each address, but you can often take the delta between the current line table entry and the next to come up with a range. This wouldn't be hard to add. The line tables internally are stored in a minimal format, and then handed out internally in a less minimal format: lldb_private::LineEntry. To figure out the address range there is already code that looks at the next minimal line table entry to get the next address to compute the size, so we can easily figure out the column range by doing the same thing: if the next line table entry if on the same line, then the end column range is the column from the next line entry, and if not, then it is just the end of the line. This can result is bad columns ranges though when you have line entries for a line in source that aren't next to each other (commonly happens with for loops). So a better algorithm would be the find all line entries with the same line from the same file and look at all the column entries for it. 

So, no we don't have it now, but you can add it, but need to be careful and make sure the algorithm that creates the column range isn't too expensive. Maybe it can be computed only on demand with a new API function:

uint32_t
SBLineEntry::GetEndColumn () const;

Then this can take its time and figure out the right answer.

Greg Clayton






More information about the lldb-dev mailing list