[Lldb-commits] [lldb] [lldb][RISCV] fix LR/SC atomic sequence handling in lldb-server (PR #127505)
David Spickett via lldb-commits
lldb-commits at lists.llvm.org
Fri Jun 20 08:34:27 PDT 2025
================
@@ -23,7 +23,7 @@ class NativeProcessSoftwareSingleStep {
protected:
// List of thread ids stepping with a breakpoint with the address of
// the relevan breakpoint
- std::map<lldb::tid_t, lldb::addr_t> m_threads_stepping_with_breakpoint;
+ std::multimap<lldb::tid_t, lldb::addr_t> m_threads_stepping_with_breakpoint;
----------------
DavidSpickett wrote:
I'm still not sure a multimap is a great fit. map of TID to vector of addresses would have been my first thought (though 99% of the time the vector would have 0 or one item).
Because code like:
```
m_threads_stepping_with_breakpoint.find(thread.GetID());
```
Will change behaviour if we have multiple entries with that TID. I'm thinking that it "works" now because it happens to only have one entry to find but if we build on this later, it'll be a mistake that's very hard to find.
https://en.cppreference.com/w/cpp/container/multimap/find.html
> 1,2) Finds an element with key equivalent to key.If there are several elements with the requested key in the container, any of them may be returned.
https://github.com/llvm/llvm-project/pull/127505
More information about the lldb-commits
mailing list