mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-02 07:37:03 +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
Notes:
sideshowbarker
2024-07-18 03:22:36 +09:00
Author: https://github.com/itamar8910
Commit: 26a96d315d
Pull-request: https://github.com/SerenityOS/serenity/pull/10242
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