mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-21 07:29:53 +00:00
LibDebug: Use InputMemoryStream instead of BufferStream.
This removes another call to ByteBuffer::wrap(const void*, size_t).
This commit is contained in:
parent
5bfa7749c3
commit
ac9f6fd1f8
Notes:
sideshowbarker
2024-07-19 04:14:19 +09:00
Author: https://github.com/asynts
Commit: ac9f6fd1f8
Pull-request: https://github.com/SerenityOS/serenity/pull/3007
Reviewed-by: https://github.com/awesomekling
Reviewed-by: https://github.com/nico
12 changed files with 125 additions and 106 deletions
|
@ -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();
|
||||
}
|
||||
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue