[Lldb-commits] [lldb] [lldb-dap] Refactoring breakpoints to not use the `g_dap` reference. (PR #115208)
Pavel Labath via lldb-commits
lldb-commits at lists.llvm.org
Thu Nov 7 08:25:54 PST 2024
================
@@ -11,23 +11,28 @@
#define LLDB_TOOLS_LLDB_DAP_INSTRUCTIONBREAKPOINT_H
#include "Breakpoint.h"
+#include "DAPForward.h"
+
+#include "lldb/lldb-defines.h"
+#include "lldb/lldb-types.h"
+
+#include <cstdint>
namespace lldb_dap {
// Instruction Breakpoint
struct InstructionBreakpoint : public Breakpoint {
lldb::addr_t instructionAddressReference;
- int32_t id;
int32_t offset;
- InstructionBreakpoint()
- : Breakpoint(), instructionAddressReference(LLDB_INVALID_ADDRESS), id(0),
+ InstructionBreakpoint(DAP &d)
----------------
labath wrote:
Thanks :D
There's no llvm policy on that, but I'd recommend using `explicit` everywhere where the two objects aren't different representations of the same "value". There's a lot of room for interpretation there, but that's definitely not the case for these class.
Another way to look at it is: would you be surprised if you passed an object of one type (`DAP`, here) to a function taking the other type (`InstructionBreakpoint`) and the call ended up creating a temporary object of the other type?
https://github.com/llvm/llvm-project/pull/115208
More information about the lldb-commits
mailing list