Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:42:42

0001 //===-- SBInstruction.h -----------------------------------------*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 
0009 #ifndef LLDB_API_SBINSTRUCTION_H
0010 #define LLDB_API_SBINSTRUCTION_H
0011 
0012 #include "lldb/API/SBData.h"
0013 #include "lldb/API/SBDefines.h"
0014 
0015 #include <cstdio>
0016 
0017 // There's a lot to be fixed here, but need to wait for underlying insn
0018 // implementation to be revised & settle down first.
0019 
0020 class InstructionImpl;
0021 
0022 namespace lldb {
0023 
0024 class LLDB_API SBInstruction {
0025 public:
0026   SBInstruction();
0027 
0028   SBInstruction(const SBInstruction &rhs);
0029 
0030   const SBInstruction &operator=(const SBInstruction &rhs);
0031 
0032   ~SBInstruction();
0033 
0034   explicit operator bool() const;
0035 
0036   bool IsValid();
0037 
0038   SBAddress GetAddress();
0039 
0040   const char *GetMnemonic(lldb::SBTarget target);
0041 
0042   const char *GetOperands(lldb::SBTarget target);
0043 
0044   const char *GetComment(lldb::SBTarget target);
0045 
0046   lldb::InstructionControlFlowKind GetControlFlowKind(lldb::SBTarget target);
0047 
0048   lldb::SBData GetData(lldb::SBTarget target);
0049 
0050   size_t GetByteSize();
0051 
0052   bool DoesBranch();
0053 
0054   bool HasDelaySlot();
0055 
0056   bool CanSetBreakpoint();
0057 
0058 #ifndef SWIG
0059   void Print(FILE *out);
0060 #endif
0061 
0062   void Print(SBFile out);
0063 
0064   void Print(FileSP BORROWED);
0065 
0066   bool GetDescription(lldb::SBStream &description);
0067 
0068   bool EmulateWithFrame(lldb::SBFrame &frame, uint32_t evaluate_options);
0069 
0070   bool DumpEmulation(const char *triple); // triple is to specify the
0071                                           // architecture, e.g. 'armv6' or
0072                                           // 'armv7-apple-ios'
0073 
0074   bool TestEmulation(lldb::SBStream &output_stream, const char *test_file);
0075 
0076 protected:
0077   friend class SBInstructionList;
0078 
0079   SBInstruction(const lldb::DisassemblerSP &disasm_sp,
0080                 const lldb::InstructionSP &inst_sp);
0081 
0082   void SetOpaque(const lldb::DisassemblerSP &disasm_sp,
0083                  const lldb::InstructionSP &inst_sp);
0084 
0085   lldb::InstructionSP GetOpaque();
0086 
0087 private:
0088   std::shared_ptr<InstructionImpl> m_opaque_sp;
0089 };
0090 
0091 } // namespace lldb
0092 
0093 #endif // LLDB_API_SBINSTRUCTION_H