[Lldb-commits] [lldb] Don't count all the frames just to skip the current inlined ones. (PR #80918)

Greg Clayton via lldb-commits lldb-commits at lists.llvm.org
Wed Feb 7 10:10:53 PST 2024


clayborg wrote:

> Should the Doxygen comment of GetStackFrameCount warn that this is an expensive operation? https://lldb.llvm.org/cpp_reference/classlldb__private_1_1Thread.html#afc54feef950a58b625bbb198dc4cf57c

It might be nice to add a "std::optional<uint32_t> max_frame_count" to this function to allow it to stop when it hits "max_frame_count". Like:

```
/// Get the number of frames in a thread.
///
/// If \a max_frame_count is valid, return a number that is less than or equal 
/// to max_frame_count, else calculate the true number of frames. Calculating
/// the total number of frames can be expensive.
virtual uint32_t lldb_private::Thread::GetStackFrameCount(std::optional<uint32_t> max_frame_count);
```

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


More information about the lldb-commits mailing list