[Lldb-commits] [PATCH] D39967: Refactoring of MemoryWrite function

Greg Clayton via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Jan 23 08:18:33 PST 2018


clayborg added a comment.

In https://reviews.llvm.org/D39967#985119, @tatyana-krasnukha wrote:

> I completely agree with your point, but why isn't enough just to return an error about breakpoints in the area user wants to write?


The reason I don't like this is there is no way for a user to look at the error returned and do anything sensible. The only thing they can do is scrape the error string to see if it contains something about breakpoints? I am a firm believer that the debugger needs to do what is right for the API call to work no matter what it is doing for breakpoints since the breakpoints are a side effect of using the debugger.

> Or to disable breakpoints forcibly?

That would be an easy fix for the ObjectFile::Load(), we could see if there are any breakpoints in the range we are trying to write, get a list of them, disable them all, write memory and re-enable. But this doesn't stop a user from trying doing something like:

  (lldb) script lldb.process.WriteMemory(...)

And they should expect this to just work no matter where they write memory.


https://reviews.llvm.org/D39967





More information about the lldb-commits mailing list