[Lldb-commits] [PATCH] D84254: [lldb] Skip overlapping hardware and external breakpoints when writing memory

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Jul 23 04:32:55 PDT 2020


labath accepted this revision.
labath added a comment.
This revision is now accepted and ready to land.

In D84254#2166562 <https://reviews.llvm.org/D84254#2166562>, @tatyana-krasnukha wrote:

> `BreakpointSite::IntersectsRange` returns `false` for hardware breakpoints, that's why the assertion fails.
>
> Since my bare-metal target loads process's memory via Process::WriteMemory, I have 200+ unresolved tests without this change.
>
> The added test should reproduce the issue for other targets too.


I see. That makes sense, thanks for the test.

My eyes nearly popped out when I saw that we were debugging a process from _inside_ a decorator (to determine watchpoint support status). I don't know when this stuff was introduced -- it sounds like a bad idea to me -- but I don't want to hold up your patch over that.



================
Comment at: lldb/test/API/functionalities/breakpoint/hardware_breakpoints/write_memory_with_hw_breakpoint/TestWriteMemoryWithHWBreakpoint.py:23-34
+        exe = self.getBuildArtifact("a.out")
+
+        # Create a target by the debugger.
+        target = self.dbg.CreateTarget(exe)
+        self.assertTrue(target, VALID_TARGET)
+
+        # Run the program and stop at entry.
----------------
These days we have helper functions for this typical test setup. I guess this could be `lldbutil.run_to_name_breakpoint`


================
Comment at: lldb/test/API/functionalities/breakpoint/hardware_breakpoints/write_memory_with_hw_breakpoint/TestWriteMemoryWithHWBreakpoint.py:51
+        result = process.WriteMemory(address, data, error)
+        self.assertTrue(error.Success() and result == len(bytes))
----------------
We also have a new `assertSuccess` helper with better error messages. It would be better to write this as `assertSuccess(error); assertEquals(result, len(bytes))`


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D84254/new/

https://reviews.llvm.org/D84254





More information about the lldb-commits mailing list