zequanwu added inline comments.
================ Comment at: lldb/source/Expression/DWARFExpressionList.cpp:179 + if (m_exprs.GetSize() == 1) { + expr = m_exprs.Back()->data; + } else { ---------------- labath wrote: > I don't think this is correct. > > We should be able to distinguish between a location list that is always valid > (i.e., one which is not a location list at all), and a location list which > happens to contain a single valid range. > > That could probably be achieved by making the range of the always-valid entry > be (0, UINT_MAX), but maybe it would be better to have an explicit > fallback/default entry for this (one that is used when no ranged entry > applies). This is how the default location entries in DWARF5 are supposed to > work, although I am not sure if any compiler actually makes use of them. > That could probably be achieved by making the range of the always-valid entry > be (0, UINT_MAX) This looks better to me as it saves one default entry and there is no difference in terms of using DWARFExpressionList APIs. Added `IsAlwaysValidSingleExpr` to check if it is an always-valid entry and uses it to distinguish between the two kinds. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D125509/new/ https://reviews.llvm.org/D125509 _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits