1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-16 04:55:00 +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

@ -24,18 +24,18 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "Expression.h"
#include <AK/BufferStream.h>
#include <AK/Stream.h>
#include <sys/arch/i386/regs.h>
namespace Dwarf {
namespace Expression {
namespace Dwarf::Expression {
Value evaluate(const ByteBuffer& bytes, const PtraceRegisters& regs)
Value evaluate(ReadonlyBytes bytes, const PtraceRegisters& regs)
{
// TODO: we need a BufferStream variant that takes a const ByteBuffer
BufferStream stream(const_cast<ByteBuffer&>(bytes));
InputMemoryStream stream(bytes);
while (!stream.at_end()) {
while (!stream.eof()) {
u8 opcode = 0;
stream >> opcode;
@ -61,5 +61,4 @@ Value evaluate(const ByteBuffer& bytes, const PtraceRegisters& regs)
ASSERT_NOT_REACHED();
}
};
};
}