mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 07:27:45 +00:00
LibDebug: Support parsing non-contiguous DWARF address ranges
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.
This commit is contained in:
parent
2b04a86d4d
commit
26a96d315d
4 changed files with 115 additions and 0 deletions
35
Userland/Libraries/LibDebug/Dwarf/AddressRanges.h
Normal file
35
Userland/Libraries/LibDebug/Dwarf/AddressRanges.h
Normal file
|
@ -0,0 +1,35 @@
|
|||
/*
|
||||
* 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;
|
||||
};
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue