mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 14:52:43 +00:00 
			
		
		
		
	 26a96d315d
			
		
	
	
		26a96d315d
		
	
	
	
	
		
			
			This adds support for parsing DWARF "range lists", which are identified by the DW_AT_ranges form. They contain code addresses for DIEs whose location is not contiguous.
		
			
				
	
	
		
			35 lines
		
	
	
	
		
			744 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			35 lines
		
	
	
	
		
			744 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| /*
 | |
|  * Copyright (c) 2020-2021, Itamar S. <itamar8910@gmail.com>
 | |
|  *
 | |
|  * SPDX-License-Identifier: BSD-2-Clause
 | |
|  */
 | |
| 
 | |
| #pragma once
 | |
| 
 | |
| #include "CompilationUnit.h"
 | |
| #include <AK/Forward.h>
 | |
| #include <AK/Function.h>
 | |
| #include <AK/MemoryStream.h>
 | |
| #include <AK/Noncopyable.h>
 | |
| 
 | |
| namespace Debug::Dwarf {
 | |
| 
 | |
| class AddressRanges {
 | |
|     AK_MAKE_NONCOPYABLE(AddressRanges);
 | |
|     AK_MAKE_NONMOVABLE(AddressRanges);
 | |
| 
 | |
| public:
 | |
|     AddressRanges(ReadonlyBytes range_lists_data, size_t offset, CompilationUnit const& compilation_unit);
 | |
| 
 | |
|     struct Range {
 | |
|         FlatPtr start { 0 };
 | |
|         FlatPtr end { 0 };
 | |
|     };
 | |
|     void for_each_range(Function<void(Range)>);
 | |
| 
 | |
| private:
 | |
|     InputMemoryStream m_range_lists_stream;
 | |
|     CompilationUnit const& m_compilation_unit;
 | |
| };
 | |
| 
 | |
| }
 |