[Lldb-commits] [lldb] [lldb-dap] Simplify `readMemory` (PR #109485)

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Tue Sep 24 01:30:54 PDT 2024


labath wrote:

> > [...] it may returned cached data from disk for running processes (which means it will be faster, but potentially return incorrect data).
> 
> I think the 2nd point shouldn't be an issue because `SBTarget::ReadMemory` sets `force_live_memory` to true when calling `Target::ReadMemory`

I see. SG then.

> 
> > [...] but I don't know how you should come to a decision there
> 
> I think I found a good criterion: Do whatever the `memory read` command is doing. Because users would probably expect the UI view and the results from `memory read` to be in-sync. It turns out `memory read` is using `Target::ReadMemory`. So I would like to do the same here, except if you are aware of good reasons not to do so

No, this sounds pretty convincing to me. This looks good to me, except for the test case failure (it fails to fail to read memory). I looked into this (for way longer than it should have been necessary), and I tracked it down to a somewhat embarrassing bug. I've created #109764 to fix that.

https://github.com/llvm/llvm-project/pull/109485


More information about the lldb-commits mailing list