Skip to content

Commit a2ba08c

Browse files
committed
[lldb-dap] add review changes
1 parent 71f027c commit a2ba08c

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

lldb/tools/lldb-dap/Handler/ReadMemoryRequestHandler.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ namespace lldb_dap {
1919
// `supportsReadMemoryRequest` is true
2020
llvm::Expected<protocol::ReadMemoryResponseBody>
2121
ReadMemoryRequestHandler::Run(const protocol::ReadMemoryArguments &args) const {
22-
const lldb::addr_t raw_address =
23-
args.memoryReference + args.offset.value_or(0);
22+
const lldb::addr_t raw_address = args.memoryReference + args.offset;
2423

2524
lldb::SBProcess process = dap.target.GetProcess();
2625
if (!lldb::SBDebugger::StateIsStoppedState(process.GetState()))

lldb/tools/lldb-dap/Protocol/ProtocolRequests.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -846,7 +846,7 @@ struct ReadMemoryArguments {
846846

847847
/// Offset (in bytes) to be applied to the reference location before reading
848848
/// data. Can be negative.
849-
std::optional<int64_t> offset;
849+
int64_t offset = 0;
850850

851851
/// Number of bytes to read at the specified location and offset.
852852
uint64_t count;

lldb/unittests/DAP/ProtocolTypesTest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -770,7 +770,7 @@ TEST(ProtocolTypesTest, ReadMemoryArguments) {
770770
ReadMemoryArguments args;
771771
args.count = 20;
772772
args.memoryReference = 43962;
773-
args.offset = std::nullopt;
773+
args.offset = 0;
774774

775775
llvm::Expected<ReadMemoryArguments> expected =
776776
parse<ReadMemoryArguments>(R"({"memoryReference":"-4000", "count": 20})");

0 commit comments

Comments
 (0)