Greg is right that this was a libedis feature and has no equivalent in LLDB today.

MCInst, however, doesn't have enough information by itself to do this.  The reason is that for many things that are considered "operands," the MCInst has several underlying operands.  For example, an operand that was expressed as a register + an offset would be represented in MCInst as a register operand and in immediate operand, and only correlating the opcode with the LLVM instruction tables (and possibly some special knowledge) would tell you that the two belong together.

Additionally, libedis could express the semantics of the instruction operands (e.g., "this is a source operand and represents the result of dereferncing rbp - 4") , and inform the client what ranges of characters in the generated string represented each high level operand.  Both of these features are not exposed anywhere at the moment, and in fact the underlying knowledge was lost when the edis TableGen backend was deprecated.

There are a few LLDB features that reads instructions and attempt to interpret them:

 * The fast unwinder looks for specific bit patterns (see
   UnwindAssembly_x86::GetFastUnwindPlan in UnwindAssembly-x86.cpp);
 * The ARM instruction emulator has its own home-grown instruction
   table (see EmulateInstructionARM64.cpp); and
 * The crash diagnose functionality actually parses the output strings
   from the disassembler (see DoGuessValueAt in StackFrame.cpp).

Sean

On 8/31/17 11:09 AM, Greg Clayton via lldb-dev wrote:
I believe libedis was deprecated many years ago and hasn't returned. We use the standard LLVM disassembler, so any features need to be built into llvm::MCInst.

On Aug 31, 2017, at 10:42 AM, Tatyana Krasnukha via lldb-dev <lldb-dev@lists.llvm.org <mailto:lldb-dev@lists.llvm.org>> wrote:

Hello,
As I understand it, old disassembler (based on libedis) could print symbolic information instead/beside address operand of an instruction. And it looks like there is not such ability in disassembler now. Is thisresponsibility shifted on some other component of lldb? Or it was considered as useless and was removed at all?
Thanks,
Tatyana
_______________________________________________
lldb-dev mailing list
lldb-dev@lists.llvm.org <mailto:lldb-dev@lists.llvm.org>
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev



_______________________________________________
lldb-dev mailing list
lldb-dev@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev

_______________________________________________
lldb-dev mailing list
lldb-dev@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev

Reply via email to