Modify lldbutil.in_range(symbol, section) to deal with the symbol whose
end address is an LLDB_INVALID_ADDRESS. Modify the test case to dump all the symbols in all the sections. llvm-svn: 140710
This commit is contained in:
		
							parent
							
								
									933d51682f
								
							
						
					
					
						commit
						c0f53df8ff
					
				| 
						 | 
				
			
			@ -53,7 +53,14 @@ def in_range(symbol, section):
 | 
			
		|||
    symEA = symbol.GetEndAddress().GetFileAddress()
 | 
			
		||||
    secSA = section.GetFileAddress()
 | 
			
		||||
    secEA = secSA + section.GetByteSize()
 | 
			
		||||
    if (secSA <= symSA and symEA < secEA):
 | 
			
		||||
 | 
			
		||||
    if symEA != lldb.LLDB_INVALID_ADDRESS:
 | 
			
		||||
        if secSA <= symSA and symEA <= secEA:
 | 
			
		||||
            return True
 | 
			
		||||
        else:
 | 
			
		||||
            return False
 | 
			
		||||
    else:
 | 
			
		||||
        if secSA <= symSA and symSA < secEA:
 | 
			
		||||
            return True
 | 
			
		||||
        else:
 | 
			
		||||
            return False
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -43,8 +43,12 @@ class ModuleAndSectionAPIsTestCase(TestBase):
 | 
			
		|||
        INDENT2 = INDENT * 2
 | 
			
		||||
        for sec in exe_module.section_iter():
 | 
			
		||||
            print sec
 | 
			
		||||
            if sec.GetName() == "__TEXT":
 | 
			
		||||
            print INDENT + "Number of subsections: %d" % sec.GetNumSubSections()
 | 
			
		||||
            if sec.GetNumSubSections() == 0:
 | 
			
		||||
                for sym in symbol_iter(exe_module, sec):
 | 
			
		||||
                    print INDENT + repr(sym)
 | 
			
		||||
                    print INDENT + "symbol type: %s" % symbol_type_to_str(sym.GetType())
 | 
			
		||||
            else:
 | 
			
		||||
                for subsec in sec:
 | 
			
		||||
                    print INDENT + repr(subsec)
 | 
			
		||||
                    # Now print the symbols belonging to the subsection....
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue