hapeeeeee wrote: > That's better, but checking something the SourceManager calls the last line > against UINT32_MAX seem to me too much implementation detail. I also can't > see any other reason why m_last_line would be useful outside the > SourceManager. > > So maybe a better API would be > > `bool SourceManager::AtLastLine() { return m_last_line == UINT32_MAX; } ` > > Then client code doesn't have to know how the SourceManager manages its > paging through the source file.
As you suggested, I’ve encapsulated the `AsLastLine` for checking whether a line is the last one, and reused this API in the `SourceManager` to replace the original logic for determining the last line. > Also, it would be good in your test to page twice past the end of the source > buffer, not just once. That SHOULD just present the same error again, but it > would be good to assert that it does. I added a second `list` command when reaching the end of the file to ensure the output is consistent across both attempts. Could you please review my commit again? @jimingham https://github.com/llvm/llvm-project/pull/137515 _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits