1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 20:28:11 +00:00

AK: Move memory streams from LibCore

This commit is contained in:
Tim Schumacher 2023-01-25 20:19:05 +01:00 committed by Andrew Kaster
parent 11550f582b
commit 093cf428a3
46 changed files with 213 additions and 203 deletions

View file

@ -11,7 +11,7 @@
#include <AK/ByteReader.h>
#include <AK/LEB128.h>
#include <LibCore/MemoryStream.h>
#include <AK/MemoryStream.h>
#include <LibDebug/DebugInfo.h>
namespace Debug::Dwarf {
@ -47,8 +47,8 @@ ErrorOr<void> DwarfInfo::populate_compilation_units()
if (!m_debug_info_data.data())
return {};
auto debug_info_stream = TRY(Core::Stream::FixedMemoryStream::construct(m_debug_info_data));
auto line_info_stream = TRY(Core::Stream::FixedMemoryStream::construct(m_debug_line_data));
auto debug_info_stream = TRY(FixedMemoryStream::construct(m_debug_info_data));
auto line_info_stream = TRY(FixedMemoryStream::construct(m_debug_line_data));
while (!debug_info_stream->is_eof()) {
auto unit_offset = TRY(debug_info_stream->tell());
@ -321,14 +321,14 @@ ErrorOr<void> DwarfInfo::build_cached_dies() const
Vector<DIERange> entries;
if (die.compilation_unit().dwarf_version() == 5) {
auto range_lists_stream = TRY(Core::Stream::FixedMemoryStream::construct(debug_range_lists_data()));
auto range_lists_stream = TRY(FixedMemoryStream::construct(debug_range_lists_data()));
TRY(range_lists_stream->seek(offset));
AddressRangesV5 address_ranges(move(range_lists_stream), die.compilation_unit());
TRY(address_ranges.for_each_range([&entries](auto range) {
entries.empend(range.start, range.end);
}));
} else {
auto ranges_stream = TRY(Core::Stream::FixedMemoryStream::construct(debug_ranges_data()));
auto ranges_stream = TRY(FixedMemoryStream::construct(debug_ranges_data()));
TRY(ranges_stream->seek(offset));
AddressRangesV4 address_ranges(move(ranges_stream), die.compilation_unit());
TRY(address_ranges.for_each_range([&entries](auto range) {