[Lldb-commits] [PATCH] D109249: [lldb] Add Getdescription function for SBInstruction.

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Sep 8 01:16:45 PDT 2021


labath added a comment.

I'm not sure what's the exact use case here, but I /think/ that passing just the target part of the execution context will is not sufficient to enable all the disassembler bells and whistles. For example the regular "disassemble" command will also print a "-> " next to the instruction that references the current PC.

Even if that is not required for your use case, I think that a better (more generic) API would be for this function to take a SBExecutionContext argument, and let the user choose how it wants to populate it.



================
Comment at: lldb/source/API/SBInstruction.cpp:241-256
   lldb::InstructionSP inst_sp(GetOpaque());
   if (inst_sp) {
     SymbolContext sc;
     const Address &addr = inst_sp->GetAddress();
     ModuleSP module_sp(addr.GetModule());
     if (module_sp)
       module_sp->ResolveSymbolContextForAddress(addr, eSymbolContextEverything,
----------------
It seems like this function could now just delegate to the new version, passing a null/empty target or execution context


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D109249



More information about the lldb-commits mailing list