If a SetDataBreakpointsRequest contains a list data breakpoints which
have duplicate starting addresses, the current behaviour is returning
`{verified: true}` to both watchpoints with duplicated starting
addresses. This confuses the client and what actually happens in lldb is
the second one overwrite the first one.
This fixes it by letting the last watchpoint at given address have
`{verified: true}` and all previous watchpoints at the same address
should have `{verfied: false}` at response.
40 lines
1.1 KiB
C++
40 lines
1.1 KiB
C++
//===-- Watchpoint.h --------------------------------------------*- C++ -*-===//
|
|
//
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#ifndef LLDB_TOOLS_LLDB_DAP_WATCHPOINT_H
|
|
#define LLDB_TOOLS_LLDB_DAP_WATCHPOINT_H
|
|
|
|
#include "BreakpointBase.h"
|
|
#include "lldb/API/SBError.h"
|
|
#include "lldb/API/SBWatchpoint.h"
|
|
#include "lldb/API/SBWatchpointOptions.h"
|
|
|
|
namespace lldb_dap {
|
|
|
|
struct Watchpoint : public BreakpointBase {
|
|
lldb::addr_t addr;
|
|
size_t size;
|
|
lldb::SBWatchpointOptions options;
|
|
// The LLDB breakpoint associated wit this watchpoint.
|
|
lldb::SBWatchpoint wp;
|
|
lldb::SBError error;
|
|
|
|
Watchpoint() = default;
|
|
Watchpoint(const llvm::json::Object &obj);
|
|
Watchpoint(lldb::SBWatchpoint wp) : wp(wp) {}
|
|
|
|
void SetCondition() override;
|
|
void SetHitCondition() override;
|
|
void CreateJsonObject(llvm::json::Object &object) override;
|
|
|
|
void SetWatchpoint();
|
|
};
|
|
} // namespace lldb_dap
|
|
|
|
#endif
|