[Lldb-commits] [PATCH] D39967: Disable breakpoints before writing memory and re-enable after.

Greg Clayton via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Feb 22 07:51:27 PST 2018

clayborg added a comment.

So one issue with this is some things, like GDB servers, might not need you to disable breakpoints in a range because they actually set the breakpoint for you and you don't know what opcode they used. I am hoping this works with that and doesn't cause us to manually write to memory when we don't need to by forcing every process subclass to always to the manual re-writing of the breakpoint opcodes.

Comment at: include/lldb/Breakpoint/BreakpointSiteList.h:129
-  void ForEach(std::function<void(BreakpointSite *)> const &callback);
+  using ModifyingCallback = std::function<void(BreakpointSite &)>;
+  void ForEach(const ModifyingCallback &callback);
Have this function return a bool where true means to keep iterating, and false means to stop iterating. This is how many other ForEach functions are done in LLDB and allows the ForEach to be used to linearly search a list and stop when done.

Comment at: include/lldb/Breakpoint/BreakpointSiteList.h:132-133
+  using Callback = std::function<void(const BreakpointSite &)>;
+  void ForEach(const Callback &callback) const;


More information about the lldb-commits mailing list