1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-19 16:35:06 +00:00

LibDebug: Use InputMemoryStream instead of BufferStream.

This removes another call to ByteBuffer::wrap(const void*, size_t).
This commit is contained in:
asynts 2020-08-05 10:55:36 +02:00 committed by Andreas Kling
parent 5bfa7749c3
commit ac9f6fd1f8
12 changed files with 125 additions and 106 deletions

View file

@ -27,6 +27,8 @@
#include "AbbreviationsMap.h"
#include "DwarfInfo.h"
#include <AK/Stream.h>
namespace Dwarf {
AbbreviationsMap::AbbreviationsMap(const DwarfInfo& dwarf_info, u32 offset)
@ -38,10 +40,10 @@ AbbreviationsMap::AbbreviationsMap(const DwarfInfo& dwarf_info, u32 offset)
void AbbreviationsMap::populate_map()
{
BufferStream abbreviation_stream(const_cast<ByteBuffer&>(m_dwarf_info.abbreviation_data()));
abbreviation_stream.advance(m_offset);
InputMemoryStream abbreviation_stream(m_dwarf_info.abbreviation_data().span());
abbreviation_stream.discard_or_error(m_offset);
while (!abbreviation_stream.at_end()) {
while (!abbreviation_stream.eof()) {
size_t abbreviation_code = 0;
abbreviation_stream.read_LEB128_unsigned(abbreviation_code);
// An abbrevation code of 0 marks the end of the