mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-10 21:22: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
Libraries/LibDebug
|
@ -26,6 +26,7 @@
|
|||
|
||||
#include "DebugInfo.h"
|
||||
#include <AK/QuickSort.h>
|
||||
#include <AK/Stream.h>
|
||||
#include <LibDebug/Dwarf/CompilationUnit.h>
|
||||
#include <LibDebug/Dwarf/DwarfInfo.h>
|
||||
#include <LibDebug/Dwarf/Expression.h>
|
||||
|
@ -104,10 +105,10 @@ void DebugInfo::prepare_lines()
|
|||
return;
|
||||
|
||||
auto buffer = section.wrapping_byte_buffer();
|
||||
BufferStream stream(buffer);
|
||||
InputMemoryStream stream { buffer.span() };
|
||||
|
||||
Vector<LineProgram::LineInfo> all_lines;
|
||||
while (!stream.at_end()) {
|
||||
while (!stream.eof()) {
|
||||
LineProgram program(stream);
|
||||
all_lines.append(program.lines());
|
||||
}
|
||||
|
@ -204,7 +205,7 @@ static void parse_variable_location(const Dwarf::DIE& variable_die, DebugInfo::V
|
|||
}
|
||||
|
||||
if (location_info.value().type == Dwarf::DIE::AttributeValue::Type::DwarfExpression) {
|
||||
auto expression_bytes = ByteBuffer::wrap(location_info.value().data.as_raw_bytes.bytes, location_info.value().data.as_raw_bytes.length);
|
||||
auto expression_bytes = ReadonlyBytes { location_info.value().data.as_raw_bytes.bytes, location_info.value().data.as_raw_bytes.length };
|
||||
auto value = Dwarf::Expression::evaluate(expression_bytes, regs);
|
||||
|
||||
if (value.type != Dwarf::Expression::Type::None) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue