mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 12:47:35 +00:00
AK: Move Stream
and SeekableStream
from LibCore
`Stream` will be qualified as `AK::Stream` until we remove the `Core::Stream` namespace. `IODevice` now reuses the `SeekMode` that is defined by `SeekableStream`, since defining its own would require us to qualify it with `AK::SeekMode` everywhere.
This commit is contained in:
parent
5f2ea31816
commit
8464da1439
96 changed files with 620 additions and 586 deletions
|
@ -11,7 +11,7 @@
|
|||
|
||||
namespace Debug::Dwarf {
|
||||
|
||||
AddressRangesV5::AddressRangesV5(NonnullOwnPtr<Core::Stream::Stream> range_lists_stream, CompilationUnit const& compilation_unit)
|
||||
AddressRangesV5::AddressRangesV5(NonnullOwnPtr<AK::Stream> range_lists_stream, CompilationUnit const& compilation_unit)
|
||||
: m_range_lists_stream(move(range_lists_stream))
|
||||
, m_compilation_unit(compilation_unit)
|
||||
{
|
||||
|
@ -85,7 +85,7 @@ ErrorOr<void> AddressRangesV5::for_each_range(Function<void(Range)> callback)
|
|||
return {};
|
||||
}
|
||||
|
||||
AddressRangesV4::AddressRangesV4(NonnullOwnPtr<Core::Stream::Stream> ranges_stream, CompilationUnit const& compilation_unit)
|
||||
AddressRangesV4::AddressRangesV4(NonnullOwnPtr<AK::Stream> ranges_stream, CompilationUnit const& compilation_unit)
|
||||
: m_ranges_stream(move(ranges_stream))
|
||||
, m_compilation_unit(compilation_unit)
|
||||
{
|
||||
|
|
|
@ -24,12 +24,12 @@ class AddressRangesV5 {
|
|||
AK_MAKE_NONMOVABLE(AddressRangesV5);
|
||||
|
||||
public:
|
||||
AddressRangesV5(NonnullOwnPtr<Core::Stream::Stream> range_lists_stream, CompilationUnit const& compilation_unit);
|
||||
AddressRangesV5(NonnullOwnPtr<AK::Stream> range_lists_stream, CompilationUnit const& compilation_unit);
|
||||
|
||||
ErrorOr<void> for_each_range(Function<void(Range)>);
|
||||
|
||||
private:
|
||||
NonnullOwnPtr<Core::Stream::Stream> m_range_lists_stream;
|
||||
NonnullOwnPtr<AK::Stream> m_range_lists_stream;
|
||||
CompilationUnit const& m_compilation_unit;
|
||||
};
|
||||
|
||||
|
@ -38,12 +38,12 @@ class AddressRangesV4 {
|
|||
AK_MAKE_NONMOVABLE(AddressRangesV4);
|
||||
|
||||
public:
|
||||
AddressRangesV4(NonnullOwnPtr<Core::Stream::Stream> ranges_stream, CompilationUnit const&);
|
||||
AddressRangesV4(NonnullOwnPtr<AK::Stream> ranges_stream, CompilationUnit const&);
|
||||
|
||||
ErrorOr<void> for_each_range(Function<void(Range)>);
|
||||
|
||||
private:
|
||||
NonnullOwnPtr<Core::Stream::Stream> m_ranges_stream;
|
||||
NonnullOwnPtr<AK::Stream> m_ranges_stream;
|
||||
CompilationUnit const& m_compilation_unit;
|
||||
};
|
||||
|
||||
|
|
|
@ -80,7 +80,7 @@ ErrorOr<void> DwarfInfo::populate_compilation_units()
|
|||
}
|
||||
|
||||
ErrorOr<AttributeValue> DwarfInfo::get_attribute_value(AttributeDataForm form, ssize_t implicit_const_value,
|
||||
Core::Stream::SeekableStream& debug_info_stream, CompilationUnit const* unit) const
|
||||
SeekableStream& debug_info_stream, CompilationUnit const* unit) const
|
||||
{
|
||||
AttributeValue value;
|
||||
value.m_form = form;
|
||||
|
|
|
@ -43,7 +43,7 @@ public:
|
|||
ErrorOr<void> for_each_compilation_unit(Callback) const;
|
||||
|
||||
ErrorOr<AttributeValue> get_attribute_value(AttributeDataForm form, ssize_t implicit_const_value,
|
||||
Core::Stream::SeekableStream& debug_info_stream, CompilationUnit const* unit = nullptr) const;
|
||||
SeekableStream& debug_info_stream, CompilationUnit const* unit = nullptr) const;
|
||||
|
||||
ErrorOr<Optional<DIE>> get_die_at_address(FlatPtr) const;
|
||||
|
||||
|
|
|
@ -54,7 +54,7 @@ struct [[gnu::packed]] CompilationUnitHeader {
|
|||
u32 abbrev_offset() const { return (common.version <= 4) ? v4.abbrev_offset : v5.abbrev_offset; }
|
||||
u8 address_size() const { return (common.version <= 4) ? v4.address_size : v5.address_size; }
|
||||
|
||||
static ErrorOr<CompilationUnitHeader> read_from_stream(Core::Stream::Stream& stream)
|
||||
static ErrorOr<CompilationUnitHeader> read_from_stream(AK::Stream& stream)
|
||||
{
|
||||
CompilationUnitHeader header;
|
||||
TRY(stream.read_entire_buffer(Bytes { &header.common, sizeof(header.common) }));
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
namespace Debug::Dwarf {
|
||||
|
||||
LineProgram::LineProgram(DwarfInfo& dwarf_info, Core::Stream::SeekableStream& stream)
|
||||
LineProgram::LineProgram(DwarfInfo& dwarf_info, SeekableStream& stream)
|
||||
: m_dwarf_info(dwarf_info)
|
||||
, m_stream(stream)
|
||||
{
|
||||
|
|
|
@ -66,7 +66,7 @@ struct [[gnu::packed]] LineProgramUnitHeader32 {
|
|||
u8 line_range() const { return (common.version <= 4) ? v4.line_range : v5.line_range; }
|
||||
u8 opcode_base() const { return (common.version <= 4) ? v4.opcode_base : v5.opcode_base; }
|
||||
|
||||
static ErrorOr<LineProgramUnitHeader32> read_from_stream(Core::Stream::Stream& stream)
|
||||
static ErrorOr<LineProgramUnitHeader32> read_from_stream(AK::Stream& stream)
|
||||
{
|
||||
LineProgramUnitHeader32 header;
|
||||
TRY(stream.read_entire_buffer(Bytes { &header.common, sizeof(header.common) }));
|
||||
|
@ -109,7 +109,7 @@ class LineProgram {
|
|||
AK_MAKE_NONMOVABLE(LineProgram);
|
||||
|
||||
public:
|
||||
explicit LineProgram(DwarfInfo& dwarf_info, Core::Stream::SeekableStream& stream);
|
||||
explicit LineProgram(DwarfInfo& dwarf_info, SeekableStream& stream);
|
||||
|
||||
struct LineInfo {
|
||||
FlatPtr address { 0 };
|
||||
|
@ -174,7 +174,7 @@ private:
|
|||
static constexpr u16 MAX_DWARF_VERSION = 5;
|
||||
|
||||
DwarfInfo& m_dwarf_info;
|
||||
Core::Stream::SeekableStream& m_stream;
|
||||
SeekableStream& m_stream;
|
||||
|
||||
size_t m_unit_offset { 0 };
|
||||
LineProgramUnitHeader32 m_unit_header {};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue