Skip to content
  • Greg Clayton's avatar
    Looking at some of the test suite failures in DWARF in .o files with the · 016a95eb
    Greg Clayton authored
    debug map showed that the location lists in the .o files needed some 
    refactoring in order to work. The case that was failing was where a function
    that was in the "__TEXT.__textcoal_nt" in the .o file, and in the 
    "__TEXT.__text" section in the main executable. This made symbol lookup fail
    due to the way we were finding a real address in the debug map which was
    by finding the section that the function was in in the .o file and trying to
    find this in the main executable. Now the section list supports finding a
    linked address in a section or any child sections. After fixing this, we ran
    into issue that were due to DWARF and how it represents locations lists. 
    DWARF makes a list of address ranges and expressions that go along with those
    address ranges. The location addresses are expressed in terms of a compile
    unit address + offset. This works fine as long as nothing moves around. When
    stuff moves around and offsets change between the remapped compile unit base
    address and the new function address, then we can run into trouble. To deal
    with this, we now store supply a location list slide amount to any location
    list expressions that will allow us to make the location list addresses into
    zero based offsets from the object that owns the location list (always a
    function in our case). 
    
    With these fixes we can now re-link random address ranges inside the debugger
    for use with our DWARF + debug map, incremental linking, and more.
    
    Another issue that arose when doing the DWARF in the .o files was that GCC
    4.2 emits a ".debug_aranges" that only mentions functions that are externally
    visible. This makes .debug_aranges useless to us and we now generate a real
    address range lookup table in the DWARF parser at the same time as we index
    the name tables (that are needed because .debug_pubnames is just as useless).
    llvm-gcc doesn't generate a .debug_aranges section, though this could be 
    fixed, we aren't going to rely upon it.
    
    Renamed a bunch of "UINT_MAX" to "UINT32_MAX".
    
    llvm-svn: 113829
    016a95eb
Loading