[Lldb-commits] [PATCH] D119963: [LLDB] Dump valid ranges of variables

Zequan Wu via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Feb 24 11:48:19 PST 2022


zequanwu added inline comments.


================
Comment at: lldb/source/Core/Address.cpp:739
-              s->PutCString(", location = ");
-              var_sp->DumpLocationForAddress(s, *this);
-              s->PutCString(", decl = ");
----------------
labath wrote:
> This place was the only caller of Variable::DumpLocationForAddress. What if we, instead of duplicating its logic here, just change the function to do what we want?
> The interface could be as simple as `Variable::DumpLocations(Stream&, Address)` where, if one provides an invalid Address, then all locations get dumped, and one can request a specific location by providing a concrete address.
> We might even do something similar for the DWARFExpression class, and avoid the filter callbacks completely.
I just moved the filter inside `Variable::DumpLocations`, because we still need to pass the filter callback to `DWARFExpression::DumpLocaitons` inside `Variable::DumpLocaitons` to choose dumping all ranges + locations or just one range location. 


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D119963/new/

https://reviews.llvm.org/D119963



More information about the lldb-commits mailing list