Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 1 | //===-- DisassemblerLLVM.cpp ------------------------------------*- C++ -*-===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | |
| 10 | #include "DisassemblerLLVM.h" |
| 11 | |
| 12 | #include "llvm-c/EnhancedDisassembly.h" |
| 13 | |
| 14 | #include "lldb/Core/Address.h" |
| 15 | #include "lldb/Core/DataExtractor.h" |
| 16 | #include "lldb/Core/Disassembler.h" |
| 17 | #include "lldb/Core/Module.h" |
| 18 | #include "lldb/Core/PluginManager.h" |
| 19 | #include "lldb/Core/Stream.h" |
| 20 | #include "lldb/Core/StreamString.h" |
| 21 | #include "lldb/Symbol/SymbolContext.h" |
| 22 | |
| 23 | #include "lldb/Target/ExecutionContext.h" |
| 24 | #include "lldb/Target/Process.h" |
| 25 | #include "lldb/Target/RegisterContext.h" |
| 26 | #include "lldb/Target/Target.h" |
| 27 | |
Greg Clayton | b01000f | 2011-01-17 03:46:26 +0000 | [diff] [blame] | 28 | #include <assert.h> |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 29 | |
| 30 | using namespace lldb; |
| 31 | using namespace lldb_private; |
| 32 | |
| 33 | |
Greg Clayton | b1888f2 | 2011-03-19 01:12:21 +0000 | [diff] [blame] | 34 | static int |
Greg Clayton | 7bc3908 | 2011-03-24 23:53:38 +0000 | [diff] [blame] | 35 | DataExtractorByteReader (uint8_t *byte, uint64_t address, void *arg) |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 36 | { |
| 37 | DataExtractor &extractor = *((DataExtractor *)arg); |
| 38 | |
| 39 | if (extractor.ValidOffset(address)) |
| 40 | { |
| 41 | *byte = *(extractor.GetDataStart() + address); |
| 42 | return 0; |
| 43 | } |
| 44 | else |
| 45 | { |
| 46 | return -1; |
| 47 | } |
| 48 | } |
| 49 | |
| 50 | namespace { |
| 51 | struct RegisterReaderArg { |
| 52 | const lldb::addr_t instructionPointer; |
| 53 | const EDDisassemblerRef disassembler; |
| 54 | |
| 55 | RegisterReaderArg(lldb::addr_t ip, |
| 56 | EDDisassemblerRef dis) : |
| 57 | instructionPointer(ip), |
| 58 | disassembler(dis) |
| 59 | { |
| 60 | } |
| 61 | }; |
| 62 | } |
| 63 | |
| 64 | static int IPRegisterReader(uint64_t *value, unsigned regID, void* arg) |
| 65 | { |
| 66 | uint64_t instructionPointer = ((RegisterReaderArg*)arg)->instructionPointer; |
| 67 | EDDisassemblerRef disassembler = ((RegisterReaderArg*)arg)->disassembler; |
| 68 | |
Greg Clayton | b1888f2 | 2011-03-19 01:12:21 +0000 | [diff] [blame] | 69 | if (EDRegisterIsProgramCounter(disassembler, regID)) { |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 70 | *value = instructionPointer; |
| 71 | return 0; |
| 72 | } |
| 73 | |
| 74 | return -1; |
| 75 | } |
| 76 | |
Caroline Tice | af59180 | 2011-04-05 23:22:54 +0000 | [diff] [blame] | 77 | InstructionLLVM::InstructionLLVM (const Address &addr, |
| 78 | AddressClass addr_class, |
Greg Clayton | abe0fed | 2011-04-18 08:33:37 +0000 | [diff] [blame] | 79 | EDDisassemblerRef disassembler, |
Johnny Chen | 80ab18e | 2011-05-12 22:25:53 +0000 | [diff] [blame] | 80 | llvm::Triple::ArchType arch_type) : |
Greg Clayton | 889fbd0 | 2011-03-26 19:14:58 +0000 | [diff] [blame] | 81 | Instruction (addr, addr_class), |
Greg Clayton | abe0fed | 2011-04-18 08:33:37 +0000 | [diff] [blame] | 82 | m_disassembler (disassembler), |
Johnny Chen | 80ab18e | 2011-05-12 22:25:53 +0000 | [diff] [blame] | 83 | m_arch_type (arch_type) |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 84 | { |
| 85 | } |
| 86 | |
Caroline Tice | af59180 | 2011-04-05 23:22:54 +0000 | [diff] [blame] | 87 | InstructionLLVM::~InstructionLLVM() |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 88 | { |
| 89 | } |
| 90 | |
| 91 | static void |
| 92 | PadString(Stream *s, const std::string &str, size_t width) |
| 93 | { |
| 94 | int diff = width - str.length(); |
| 95 | |
| 96 | if (diff > 0) |
| 97 | s->Printf("%s%*.*s", str.c_str(), diff, diff, ""); |
| 98 | else |
| 99 | s->Printf("%s ", str.c_str()); |
| 100 | } |
Johnny Chen | d254eb9 | 2011-05-23 23:29:23 +0000 | [diff] [blame] | 101 | static void |
| 102 | AddSymbolicInfo(const ExecutionContext *exe_ctx, ExecutionContextScope *exe_scope, |
| 103 | StreamString &comment, uint64_t operand_value, const Address &inst_addr) |
| 104 | { |
| 105 | Address so_addr; |
Greg Clayton | 567e7f3 | 2011-09-22 04:58:26 +0000 | [diff] [blame^] | 106 | Target *target = NULL; |
| 107 | if (exe_ctx) |
| 108 | target = exe_ctx->GetTargetPtr(); |
| 109 | if (target && !target->GetSectionLoadList().IsEmpty()) |
Johnny Chen | d254eb9 | 2011-05-23 23:29:23 +0000 | [diff] [blame] | 110 | { |
Greg Clayton | 567e7f3 | 2011-09-22 04:58:26 +0000 | [diff] [blame^] | 111 | if (target->GetSectionLoadList().ResolveLoadAddress(operand_value, so_addr)) |
Johnny Chen | d254eb9 | 2011-05-23 23:29:23 +0000 | [diff] [blame] | 112 | so_addr.Dump(&comment, exe_scope, Address::DumpStyleResolvedDescriptionNoModule, Address::DumpStyleSectionNameOffset); |
| 113 | } |
| 114 | else |
| 115 | { |
| 116 | Module *module = inst_addr.GetModule(); |
| 117 | if (module) |
| 118 | { |
| 119 | if (module->ResolveFileAddress(operand_value, so_addr)) |
| 120 | so_addr.Dump(&comment, exe_scope, Address::DumpStyleResolvedDescriptionNoModule, Address::DumpStyleSectionNameOffset); |
| 121 | } |
| 122 | } |
| 123 | } |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 124 | |
Johnny Chen | 51ff248 | 2011-05-19 01:05:37 +0000 | [diff] [blame] | 125 | #include "llvm/ADT/StringRef.h" |
Johnny Chen | d254eb9 | 2011-05-23 23:29:23 +0000 | [diff] [blame] | 126 | static inline void StripSpaces(llvm::StringRef &Str) |
Johnny Chen | 51ff248 | 2011-05-19 01:05:37 +0000 | [diff] [blame] | 127 | { |
| 128 | while (!Str.empty() && isspace(Str[0])) |
| 129 | Str = Str.substr(1); |
| 130 | while (!Str.empty() && isspace(Str.back())) |
| 131 | Str = Str.substr(0, Str.size()-1); |
| 132 | } |
Johnny Chen | d254eb9 | 2011-05-23 23:29:23 +0000 | [diff] [blame] | 133 | static inline void RStrip(llvm::StringRef &Str, char c) |
| 134 | { |
| 135 | if (!Str.empty() && Str.back() == c) |
| 136 | Str = Str.substr(0, Str.size()-1); |
| 137 | } |
Johnny Chen | 3930cbe | 2011-05-24 20:36:40 +0000 | [diff] [blame] | 138 | // Aligns the raw disassembly (passed as 'str') with the rest of edis'ed disassembly output. |
| 139 | // This is called from non-raw mode when edis of the current m_inst fails for some reason. |
Johnny Chen | 84d42e8 | 2011-05-21 00:55:57 +0000 | [diff] [blame] | 140 | static void |
Johnny Chen | d17f801 | 2011-05-23 18:00:40 +0000 | [diff] [blame] | 141 | Align(Stream *s, const char *str, size_t opcodeColWidth, size_t operandColWidth) |
Johnny Chen | 84d42e8 | 2011-05-21 00:55:57 +0000 | [diff] [blame] | 142 | { |
| 143 | llvm::StringRef raw_disasm(str); |
| 144 | StripSpaces(raw_disasm); |
Johnny Chen | d17f801 | 2011-05-23 18:00:40 +0000 | [diff] [blame] | 145 | // Split the raw disassembly into opcode and operands. |
| 146 | std::pair<llvm::StringRef, llvm::StringRef> p = raw_disasm.split('\t'); |
| 147 | PadString(s, p.first, opcodeColWidth); |
| 148 | if (!p.second.empty()) |
| 149 | PadString(s, p.second, operandColWidth); |
Johnny Chen | 84d42e8 | 2011-05-21 00:55:57 +0000 | [diff] [blame] | 150 | } |
Johnny Chen | 51ff248 | 2011-05-19 01:05:37 +0000 | [diff] [blame] | 151 | |
Johnny Chen | 6678676 | 2011-08-03 04:50:37 +0000 | [diff] [blame] | 152 | #define AlignPC(pc_val) (pc_val & 0xFFFFFFFC) |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 153 | void |
Caroline Tice | af59180 | 2011-04-05 23:22:54 +0000 | [diff] [blame] | 154 | InstructionLLVM::Dump |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 155 | ( |
| 156 | Stream *s, |
Greg Clayton | 889fbd0 | 2011-03-26 19:14:58 +0000 | [diff] [blame] | 157 | uint32_t max_opcode_byte_size, |
Greg Clayton | 5c4c746 | 2010-10-06 03:09:58 +0000 | [diff] [blame] | 158 | bool show_address, |
Greg Clayton | 149731c | 2011-03-25 18:03:16 +0000 | [diff] [blame] | 159 | bool show_bytes, |
Greg Clayton | 5c4c746 | 2010-10-06 03:09:58 +0000 | [diff] [blame] | 160 | const lldb_private::ExecutionContext* exe_ctx, |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 161 | bool raw |
| 162 | ) |
| 163 | { |
| 164 | const size_t opcodeColumnWidth = 7; |
| 165 | const size_t operandColumnWidth = 25; |
| 166 | |
Greg Clayton | 5c4c746 | 2010-10-06 03:09:58 +0000 | [diff] [blame] | 167 | ExecutionContextScope *exe_scope = NULL; |
| 168 | if (exe_ctx) |
| 169 | exe_scope = exe_ctx->GetBestExecutionContextScope(); |
| 170 | |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 171 | // If we have an address, print it out |
Sean Callanan | 91557b0 | 2010-11-10 01:38:28 +0000 | [diff] [blame] | 172 | if (GetAddress().IsValid() && show_address) |
Greg Clayton | 7043635 | 2010-06-30 23:03:03 +0000 | [diff] [blame] | 173 | { |
Greg Clayton | 5c4c746 | 2010-10-06 03:09:58 +0000 | [diff] [blame] | 174 | if (GetAddress().Dump (s, |
| 175 | exe_scope, |
| 176 | Address::DumpStyleLoadAddress, |
| 177 | Address::DumpStyleModuleWithFileAddress, |
| 178 | 0)) |
Greg Clayton | 7043635 | 2010-06-30 23:03:03 +0000 | [diff] [blame] | 179 | s->PutCString(": "); |
| 180 | } |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 181 | |
| 182 | // If we are supposed to show bytes, "bytes" will be non-NULL. |
Greg Clayton | 149731c | 2011-03-25 18:03:16 +0000 | [diff] [blame] | 183 | if (show_bytes) |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 184 | { |
Greg Clayton | 149731c | 2011-03-25 18:03:16 +0000 | [diff] [blame] | 185 | if (m_opcode.GetType() == Opcode::eTypeBytes) |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 186 | { |
Greg Clayton | 149731c | 2011-03-25 18:03:16 +0000 | [diff] [blame] | 187 | // x86_64 and i386 are the only ones that use bytes right now so |
| 188 | // pad out the byte dump to be able to always show 15 bytes (3 chars each) |
| 189 | // plus a space |
Greg Clayton | 889fbd0 | 2011-03-26 19:14:58 +0000 | [diff] [blame] | 190 | if (max_opcode_byte_size > 0) |
| 191 | m_opcode.Dump (s, max_opcode_byte_size * 3 + 1); |
| 192 | else |
| 193 | m_opcode.Dump (s, 15 * 3 + 1); |
Greg Clayton | 149731c | 2011-03-25 18:03:16 +0000 | [diff] [blame] | 194 | } |
| 195 | else |
| 196 | { |
| 197 | // Else, we have ARM which can show up to a uint32_t 0x00000000 (10 spaces) |
| 198 | // plus two for padding... |
Greg Clayton | 889fbd0 | 2011-03-26 19:14:58 +0000 | [diff] [blame] | 199 | if (max_opcode_byte_size > 0) |
| 200 | m_opcode.Dump (s, max_opcode_byte_size * 3 + 1); |
| 201 | else |
| 202 | m_opcode.Dump (s, 12); |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 203 | } |
| 204 | } |
| 205 | |
Greg Clayton | f15996e | 2011-04-07 22:46:35 +0000 | [diff] [blame] | 206 | int numTokens = -1; |
| 207 | |
Johnny Chen | 80ab18e | 2011-05-12 22:25:53 +0000 | [diff] [blame] | 208 | // FIXME!!! |
| 209 | /* Remove the following section of code related to force_raw .... */ |
Johnny Chen | d17f801 | 2011-05-23 18:00:40 +0000 | [diff] [blame] | 210 | /* |
Johnny Chen | 80ab18e | 2011-05-12 22:25:53 +0000 | [diff] [blame] | 211 | bool force_raw = m_arch_type == llvm::Triple::arm || |
| 212 | m_arch_type == llvm::Triple::thumb; |
Greg Clayton | f15996e | 2011-04-07 22:46:35 +0000 | [diff] [blame] | 213 | if (!raw) |
Johnny Chen | 80ab18e | 2011-05-12 22:25:53 +0000 | [diff] [blame] | 214 | raw = force_raw; |
Johnny Chen | d17f801 | 2011-05-23 18:00:40 +0000 | [diff] [blame] | 215 | */ |
Johnny Chen | 80ab18e | 2011-05-12 22:25:53 +0000 | [diff] [blame] | 216 | /* .... when we fix the edis for arm/thumb. */ |
Greg Clayton | abe0fed | 2011-04-18 08:33:37 +0000 | [diff] [blame] | 217 | |
Johnny Chen | 611b7e9 | 2011-08-19 17:31:59 +0000 | [diff] [blame] | 218 | if (!raw) |
Greg Clayton | f15996e | 2011-04-07 22:46:35 +0000 | [diff] [blame] | 219 | numTokens = EDNumTokens(m_inst); |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 220 | |
| 221 | int currentOpIndex = -1; |
| 222 | |
Greg Clayton | f15996e | 2011-04-07 22:46:35 +0000 | [diff] [blame] | 223 | bool printTokenized = false; |
| 224 | |
| 225 | if (numTokens != -1 && !raw) |
Sean Callanan | 8541f2f | 2010-07-23 02:19:15 +0000 | [diff] [blame] | 226 | { |
| 227 | addr_t base_addr = LLDB_INVALID_ADDRESS; |
Greg Clayton | f15996e | 2011-04-07 22:46:35 +0000 | [diff] [blame] | 228 | |
Greg Clayton | 567e7f3 | 2011-09-22 04:58:26 +0000 | [diff] [blame^] | 229 | Target *target = NULL; |
| 230 | if (exe_ctx) |
| 231 | target = exe_ctx->GetTargetPtr(); |
| 232 | if (target && !target->GetSectionLoadList().IsEmpty()) |
| 233 | base_addr = GetAddress().GetLoadAddress (target); |
Sean Callanan | 8541f2f | 2010-07-23 02:19:15 +0000 | [diff] [blame] | 234 | if (base_addr == LLDB_INVALID_ADDRESS) |
Greg Clayton | 5c4c746 | 2010-10-06 03:09:58 +0000 | [diff] [blame] | 235 | base_addr = GetAddress().GetFileAddress (); |
Greg Clayton | f15996e | 2011-04-07 22:46:35 +0000 | [diff] [blame] | 236 | |
Johnny Chen | 80ab18e | 2011-05-12 22:25:53 +0000 | [diff] [blame] | 237 | lldb::addr_t PC = base_addr + EDInstByteSize(m_inst); |
| 238 | |
| 239 | // When executing an ARM instruction, PC reads as the address of the |
| 240 | // current instruction plus 8. And for Thumb, it is plus 4. |
| 241 | if (m_arch_type == llvm::Triple::arm) |
| 242 | PC = base_addr + 8; |
| 243 | else if (m_arch_type == llvm::Triple::thumb) |
| 244 | PC = base_addr + 4; |
| 245 | |
| 246 | RegisterReaderArg rra(PC, m_disassembler); |
Johnny Chen | c5272bf | 2011-05-12 18:48:11 +0000 | [diff] [blame] | 247 | |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 248 | printTokenized = true; |
| 249 | |
| 250 | // Handle the opcode column. |
| 251 | |
| 252 | StreamString opcode; |
| 253 | |
| 254 | int tokenIndex = 0; |
| 255 | |
| 256 | EDTokenRef token; |
| 257 | const char *tokenStr; |
| 258 | |
Johnny Chen | ff8fea6 | 2011-05-18 22:48:41 +0000 | [diff] [blame] | 259 | if (EDGetToken(&token, m_inst, tokenIndex)) // 0 on success |
| 260 | printTokenized = false; |
| 261 | else if (!EDTokenIsOpcode(token)) |
| 262 | printTokenized = false; |
| 263 | else if (EDGetTokenString(&tokenStr, token)) // 0 on success |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 264 | printTokenized = false; |
| 265 | |
Johnny Chen | ff8fea6 | 2011-05-18 22:48:41 +0000 | [diff] [blame] | 266 | if (printTokenized) |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 267 | { |
Johnny Chen | ff8fea6 | 2011-05-18 22:48:41 +0000 | [diff] [blame] | 268 | // Put the token string into our opcode string |
| 269 | opcode.PutCString(tokenStr); |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 270 | |
Johnny Chen | ff8fea6 | 2011-05-18 22:48:41 +0000 | [diff] [blame] | 271 | // If anything follows, it probably starts with some whitespace. Skip it. |
| 272 | if (++tokenIndex < numTokens) |
| 273 | { |
| 274 | if (EDGetToken(&token, m_inst, tokenIndex)) // 0 on success |
| 275 | printTokenized = false; |
| 276 | else if (!EDTokenIsWhitespace(token)) |
| 277 | printTokenized = false; |
| 278 | } |
| 279 | |
| 280 | ++tokenIndex; |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 281 | } |
| 282 | |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 283 | // Handle the operands and the comment. |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 284 | StreamString operands; |
| 285 | StreamString comment; |
| 286 | |
| 287 | if (printTokenized) |
| 288 | { |
Johnny Chen | 51ff248 | 2011-05-19 01:05:37 +0000 | [diff] [blame] | 289 | bool show_token = false; |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 290 | |
| 291 | for (; tokenIndex < numTokens; ++tokenIndex) |
| 292 | { |
| 293 | if (EDGetToken(&token, m_inst, tokenIndex)) |
| 294 | return; |
| 295 | |
Johnny Chen | 6d61ebf | 2011-05-18 22:08:52 +0000 | [diff] [blame] | 296 | int operandIndex = EDOperandIndexForToken(token); |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 297 | |
Johnny Chen | 6d61ebf | 2011-05-18 22:08:52 +0000 | [diff] [blame] | 298 | if (operandIndex >= 0) |
| 299 | { |
| 300 | if (operandIndex != currentOpIndex) |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 301 | { |
Johnny Chen | 6d61ebf | 2011-05-18 22:08:52 +0000 | [diff] [blame] | 302 | show_token = true; |
| 303 | |
| 304 | currentOpIndex = operandIndex; |
| 305 | EDOperandRef operand; |
| 306 | |
| 307 | if (!EDGetOperand(&operand, m_inst, currentOpIndex)) |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 308 | { |
Johnny Chen | 6d61ebf | 2011-05-18 22:08:52 +0000 | [diff] [blame] | 309 | if (EDOperandIsMemory(operand)) |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 310 | { |
Johnny Chen | 6d61ebf | 2011-05-18 22:08:52 +0000 | [diff] [blame] | 311 | uint64_t operand_value; |
| 312 | |
| 313 | if (!EDEvaluateOperand(&operand_value, operand, IPRegisterReader, &rra)) |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 314 | { |
Johnny Chen | 6d61ebf | 2011-05-18 22:08:52 +0000 | [diff] [blame] | 315 | if (EDInstIsBranch(m_inst)) |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 316 | { |
Johnny Chen | 6d61ebf | 2011-05-18 22:08:52 +0000 | [diff] [blame] | 317 | operands.Printf("0x%llx ", operand_value); |
| 318 | show_token = false; |
| 319 | } |
| 320 | else |
| 321 | { |
| 322 | // Put the address value into the comment |
| 323 | comment.Printf("0x%llx ", operand_value); |
| 324 | } |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 325 | |
Johnny Chen | d254eb9 | 2011-05-23 23:29:23 +0000 | [diff] [blame] | 326 | AddSymbolicInfo(exe_ctx, exe_scope, comment, operand_value, GetAddress()); |
Johnny Chen | 6d61ebf | 2011-05-18 22:08:52 +0000 | [diff] [blame] | 327 | } // EDEvaluateOperand |
| 328 | } // EDOperandIsMemory |
| 329 | } // EDGetOperand |
| 330 | } // operandIndex != currentOpIndex |
| 331 | } // operandIndex >= 0 |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 332 | |
| 333 | if (show_token) |
| 334 | { |
Enrico Granata | 4c3fb4b | 2011-07-19 18:03:25 +0000 | [diff] [blame] | 335 | if (EDGetTokenString(&tokenStr, token)) |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 336 | { |
| 337 | printTokenized = false; |
| 338 | break; |
| 339 | } |
| 340 | |
| 341 | operands.PutCString(tokenStr); |
| 342 | } |
| 343 | } // for (tokenIndex) |
| 344 | |
Johnny Chen | de5cc8c | 2011-05-20 17:27:37 +0000 | [diff] [blame] | 345 | // FIXME!!! |
| 346 | // Workaround for llvm::tB's operands not properly parsed by ARMAsmParser. |
| 347 | if (m_arch_type == llvm::Triple::thumb && opcode.GetString() == "b") { |
| 348 | const char *inst_str; |
Peter Collingbourne | d77c039 | 2011-05-20 22:42:59 +0000 | [diff] [blame] | 349 | const char *pos = NULL; |
Johnny Chen | c298a98 | 2011-05-23 19:41:31 +0000 | [diff] [blame] | 350 | operands.Clear(); comment.Clear(); |
Johnny Chen | de5cc8c | 2011-05-20 17:27:37 +0000 | [diff] [blame] | 351 | if (EDGetInstString(&inst_str, m_inst) == 0 && (pos = strstr(inst_str, "#")) != NULL) { |
| 352 | uint64_t operand_value = PC + atoi(++pos); |
Johnny Chen | d254eb9 | 2011-05-23 23:29:23 +0000 | [diff] [blame] | 353 | // Put the address value into the operands. |
Johnny Chen | de5cc8c | 2011-05-20 17:27:37 +0000 | [diff] [blame] | 354 | operands.Printf("0x%llx ", operand_value); |
Johnny Chen | d254eb9 | 2011-05-23 23:29:23 +0000 | [diff] [blame] | 355 | AddSymbolicInfo(exe_ctx, exe_scope, comment, operand_value, GetAddress()); |
Johnny Chen | de5cc8c | 2011-05-20 17:27:37 +0000 | [diff] [blame] | 356 | } |
| 357 | } |
Johnny Chen | c298a98 | 2011-05-23 19:41:31 +0000 | [diff] [blame] | 358 | // Yet more workaround for "bl #..." and "blx #...". |
| 359 | if ((m_arch_type == llvm::Triple::arm || m_arch_type == llvm::Triple::thumb) && |
| 360 | (opcode.GetString() == "bl" || opcode.GetString() == "blx")) { |
| 361 | const char *inst_str; |
| 362 | const char *pos = NULL; |
| 363 | operands.Clear(); comment.Clear(); |
| 364 | if (EDGetInstString(&inst_str, m_inst) == 0 && (pos = strstr(inst_str, "#")) != NULL) { |
Johnny Chen | 6678676 | 2011-08-03 04:50:37 +0000 | [diff] [blame] | 365 | if (m_arch_type == llvm::Triple::thumb && opcode.GetString() == "blx") { |
| 366 | // A8.6.23 BLX (immediate) |
| 367 | // Target Address = Align(PC,4) + offset value |
| 368 | PC = AlignPC(PC); |
| 369 | } |
Johnny Chen | c298a98 | 2011-05-23 19:41:31 +0000 | [diff] [blame] | 370 | uint64_t operand_value = PC + atoi(++pos); |
Johnny Chen | d254eb9 | 2011-05-23 23:29:23 +0000 | [diff] [blame] | 371 | // Put the address value into the comment. |
Johnny Chen | c298a98 | 2011-05-23 19:41:31 +0000 | [diff] [blame] | 372 | comment.Printf("0x%llx ", operand_value); |
Johnny Chen | d254eb9 | 2011-05-23 23:29:23 +0000 | [diff] [blame] | 373 | // And the original token string into the operands. |
| 374 | llvm::StringRef Str(pos - 1); |
| 375 | RStrip(Str, '\n'); |
| 376 | operands.PutCString(Str.str().c_str()); |
| 377 | AddSymbolicInfo(exe_ctx, exe_scope, comment, operand_value, GetAddress()); |
Johnny Chen | c298a98 | 2011-05-23 19:41:31 +0000 | [diff] [blame] | 378 | } |
| 379 | } |
Johnny Chen | de5cc8c | 2011-05-20 17:27:37 +0000 | [diff] [blame] | 380 | // END of workaround. |
| 381 | |
Johnny Chen | 51ff248 | 2011-05-19 01:05:37 +0000 | [diff] [blame] | 382 | // If both operands and comment are empty, we will just print out |
| 383 | // the raw disassembly. |
| 384 | if (operands.GetString().empty() && comment.GetString().empty()) |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 385 | { |
Johnny Chen | 51ff248 | 2011-05-19 01:05:37 +0000 | [diff] [blame] | 386 | const char *str; |
| 387 | |
| 388 | if (EDGetInstString(&str, m_inst)) |
| 389 | return; |
Johnny Chen | d17f801 | 2011-05-23 18:00:40 +0000 | [diff] [blame] | 390 | Align(s, str, opcodeColumnWidth, operandColumnWidth); |
Johnny Chen | 51ff248 | 2011-05-19 01:05:37 +0000 | [diff] [blame] | 391 | } |
| 392 | else |
| 393 | { |
| 394 | PadString(s, opcode.GetString(), opcodeColumnWidth); |
| 395 | |
| 396 | if (comment.GetString().empty()) |
| 397 | s->PutCString(operands.GetString().c_str()); |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 398 | else |
| 399 | { |
Johnny Chen | 51ff248 | 2011-05-19 01:05:37 +0000 | [diff] [blame] | 400 | PadString(s, operands.GetString(), operandColumnWidth); |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 401 | |
Johnny Chen | 51ff248 | 2011-05-19 01:05:37 +0000 | [diff] [blame] | 402 | s->PutCString("; "); |
| 403 | s->PutCString(comment.GetString().c_str()); |
| 404 | } // else (comment.GetString().empty()) |
| 405 | } // else (operands.GetString().empty() && comment.GetString().empty()) |
| 406 | } // printTokenized |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 407 | } // numTokens != -1 |
| 408 | |
| 409 | if (!printTokenized) |
| 410 | { |
| 411 | const char *str; |
| 412 | |
Johnny Chen | 51ff248 | 2011-05-19 01:05:37 +0000 | [diff] [blame] | 413 | if (EDGetInstString(&str, m_inst)) // 0 on success |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 414 | return; |
Johnny Chen | 08251ef | 2011-05-21 00:44:42 +0000 | [diff] [blame] | 415 | if (raw) |
| 416 | s->Write(str, strlen(str) - 1); |
| 417 | else |
| 418 | { |
| 419 | // EDis fails to parse the tokens of this inst. Need to align this |
Johnny Chen | 84d42e8 | 2011-05-21 00:55:57 +0000 | [diff] [blame] | 420 | // raw disassembly's opcode with the rest of output. |
Johnny Chen | d17f801 | 2011-05-23 18:00:40 +0000 | [diff] [blame] | 421 | Align(s, str, opcodeColumnWidth, operandColumnWidth); |
Johnny Chen | 08251ef | 2011-05-21 00:44:42 +0000 | [diff] [blame] | 422 | } |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 423 | } |
| 424 | } |
| 425 | |
| 426 | bool |
Caroline Tice | af59180 | 2011-04-05 23:22:54 +0000 | [diff] [blame] | 427 | InstructionLLVM::DoesBranch() const |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 428 | { |
| 429 | return EDInstIsBranch(m_inst); |
| 430 | } |
| 431 | |
| 432 | size_t |
Caroline Tice | af59180 | 2011-04-05 23:22:54 +0000 | [diff] [blame] | 433 | InstructionLLVM::Decode (const Disassembler &disassembler, |
| 434 | const lldb_private::DataExtractor &data, |
| 435 | uint32_t data_offset) |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 436 | { |
| 437 | if (EDCreateInsts(&m_inst, 1, m_disassembler, DataExtractorByteReader, data_offset, (void*)(&data))) |
Greg Clayton | 7bc3908 | 2011-03-24 23:53:38 +0000 | [diff] [blame] | 438 | { |
| 439 | const int byte_size = EDInstByteSize(m_inst); |
| 440 | uint32_t offset = data_offset; |
| 441 | // Make a copy of the opcode in m_opcode |
| 442 | switch (disassembler.GetArchitecture().GetMachine()) |
| 443 | { |
| 444 | case llvm::Triple::x86: |
| 445 | case llvm::Triple::x86_64: |
| 446 | m_opcode.SetOpcodeBytes (data.PeekData (data_offset, byte_size), byte_size); |
| 447 | break; |
| 448 | |
| 449 | case llvm::Triple::arm: |
Greg Clayton | 7bc3908 | 2011-03-24 23:53:38 +0000 | [diff] [blame] | 450 | case llvm::Triple::thumb: |
Greg Clayton | 149731c | 2011-03-25 18:03:16 +0000 | [diff] [blame] | 451 | switch (byte_size) |
| 452 | { |
| 453 | case 2: |
| 454 | m_opcode.SetOpcode16 (data.GetU16 (&offset)); |
| 455 | break; |
| 456 | |
| 457 | case 4: |
Caroline Tice | 6b8d3b5 | 2011-04-19 23:30:03 +0000 | [diff] [blame] | 458 | { |
| 459 | if (GetAddressClass() == eAddressClassCodeAlternateISA) |
| 460 | { |
| 461 | // If it is a 32-bit THUMB instruction, we need to swap the upper & lower halves. |
| 462 | uint32_t orig_bytes = data.GetU32 (&offset); |
| 463 | uint16_t upper_bits = (orig_bytes >> 16) & ((1u << 16) - 1); |
| 464 | uint16_t lower_bits = orig_bytes & ((1u << 16) - 1); |
| 465 | uint32_t swapped = (lower_bits << 16) | upper_bits; |
| 466 | m_opcode.SetOpcode32 (swapped); |
| 467 | } |
| 468 | else |
| 469 | m_opcode.SetOpcode32 (data.GetU32 (&offset)); |
| 470 | } |
Greg Clayton | 149731c | 2011-03-25 18:03:16 +0000 | [diff] [blame] | 471 | break; |
| 472 | |
| 473 | default: |
| 474 | assert (!"Invalid ARM opcode size"); |
| 475 | break; |
| 476 | } |
Greg Clayton | 7bc3908 | 2011-03-24 23:53:38 +0000 | [diff] [blame] | 477 | break; |
| 478 | |
| 479 | default: |
| 480 | assert (!"This shouldn't happen since we control the architecture we allow DisassemblerLLVM to be created for"); |
| 481 | break; |
| 482 | } |
| 483 | return byte_size; |
| 484 | } |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 485 | else |
| 486 | return 0; |
| 487 | } |
| 488 | |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 489 | static inline EDAssemblySyntax_t |
Greg Clayton | cf01505 | 2010-06-11 03:25:34 +0000 | [diff] [blame] | 490 | SyntaxForArchSpec (const ArchSpec &arch) |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 491 | { |
Greg Clayton | 940b103 | 2011-02-23 00:35:02 +0000 | [diff] [blame] | 492 | switch (arch.GetMachine ()) |
Greg Clayton | 5e4f4a2 | 2011-02-16 00:00:43 +0000 | [diff] [blame] | 493 | { |
Greg Clayton | 940b103 | 2011-02-23 00:35:02 +0000 | [diff] [blame] | 494 | case llvm::Triple::x86: |
| 495 | case llvm::Triple::x86_64: |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 496 | return kEDAssemblySyntaxX86ATT; |
Sean Callanan | d151c8a | 2011-03-09 01:02:51 +0000 | [diff] [blame] | 497 | case llvm::Triple::arm: |
Greg Clayton | 889fbd0 | 2011-03-26 19:14:58 +0000 | [diff] [blame] | 498 | case llvm::Triple::thumb: |
Sean Callanan | d151c8a | 2011-03-09 01:02:51 +0000 | [diff] [blame] | 499 | return kEDAssemblySyntaxARMUAL; |
Greg Clayton | 5e4f4a2 | 2011-02-16 00:00:43 +0000 | [diff] [blame] | 500 | default: |
| 501 | break; |
| 502 | } |
Greg Clayton | cf01505 | 2010-06-11 03:25:34 +0000 | [diff] [blame] | 503 | return (EDAssemblySyntax_t)0; // default |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 504 | } |
| 505 | |
| 506 | Disassembler * |
| 507 | DisassemblerLLVM::CreateInstance(const ArchSpec &arch) |
| 508 | { |
Greg Clayton | 5e4f4a2 | 2011-02-16 00:00:43 +0000 | [diff] [blame] | 509 | std::auto_ptr<DisassemblerLLVM> disasm_ap (new DisassemblerLLVM(arch)); |
| 510 | |
Caroline Tice | 080bf61 | 2011-04-05 18:46:00 +0000 | [diff] [blame] | 511 | if (disasm_ap.get() && disasm_ap->IsValid()) |
Greg Clayton | 5e4f4a2 | 2011-02-16 00:00:43 +0000 | [diff] [blame] | 512 | return disasm_ap.release(); |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 513 | |
Greg Clayton | cf01505 | 2010-06-11 03:25:34 +0000 | [diff] [blame] | 514 | return NULL; |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 515 | } |
| 516 | |
| 517 | DisassemblerLLVM::DisassemblerLLVM(const ArchSpec &arch) : |
Greg Clayton | b01000f | 2011-01-17 03:46:26 +0000 | [diff] [blame] | 518 | Disassembler (arch), |
Greg Clayton | b1888f2 | 2011-03-19 01:12:21 +0000 | [diff] [blame] | 519 | m_disassembler (NULL), |
| 520 | m_disassembler_thumb (NULL) // For ARM only |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 521 | { |
Greg Clayton | 5e4f4a2 | 2011-02-16 00:00:43 +0000 | [diff] [blame] | 522 | const std::string &arch_triple = arch.GetTriple().str(); |
| 523 | if (!arch_triple.empty()) |
Greg Clayton | cf01505 | 2010-06-11 03:25:34 +0000 | [diff] [blame] | 524 | { |
Greg Clayton | 5e4f4a2 | 2011-02-16 00:00:43 +0000 | [diff] [blame] | 525 | if (EDGetDisassembler(&m_disassembler, arch_triple.c_str(), SyntaxForArchSpec (arch))) |
| 526 | m_disassembler = NULL; |
Greg Clayton | b1888f2 | 2011-03-19 01:12:21 +0000 | [diff] [blame] | 527 | llvm::Triple::ArchType llvm_arch = arch.GetTriple().getArch(); |
Greg Clayton | 889fbd0 | 2011-03-26 19:14:58 +0000 | [diff] [blame] | 528 | // Don't have the lldb::Triple::thumb architecture here. If someone specifies |
| 529 | // "thumb" as the architecture, we want a thumb only disassembler. But if any |
| 530 | // architecture starting with "arm" if specified, we want to auto detect the |
| 531 | // arm/thumb code automatically using the AddressClass from section offset |
| 532 | // addresses. |
Greg Clayton | b1888f2 | 2011-03-19 01:12:21 +0000 | [diff] [blame] | 533 | if (llvm_arch == llvm::Triple::arm) |
| 534 | { |
| 535 | if (EDGetDisassembler(&m_disassembler_thumb, "thumb-apple-darwin", kEDAssemblySyntaxARMUAL)) |
| 536 | m_disassembler_thumb = NULL; |
| 537 | } |
Greg Clayton | cf01505 | 2010-06-11 03:25:34 +0000 | [diff] [blame] | 538 | } |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 539 | } |
| 540 | |
| 541 | DisassemblerLLVM::~DisassemblerLLVM() |
| 542 | { |
| 543 | } |
| 544 | |
| 545 | size_t |
Greg Clayton | 7043635 | 2010-06-30 23:03:03 +0000 | [diff] [blame] | 546 | DisassemblerLLVM::DecodeInstructions |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 547 | ( |
Greg Clayton | 5c4c746 | 2010-10-06 03:09:58 +0000 | [diff] [blame] | 548 | const Address &base_addr, |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 549 | const DataExtractor& data, |
| 550 | uint32_t data_offset, |
Jim Ingham | aa3e3e1 | 2011-03-22 01:48:42 +0000 | [diff] [blame] | 551 | uint32_t num_instructions, |
| 552 | bool append |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 553 | ) |
| 554 | { |
Greg Clayton | b01000f | 2011-01-17 03:46:26 +0000 | [diff] [blame] | 555 | if (m_disassembler == NULL) |
| 556 | return 0; |
| 557 | |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 558 | size_t total_inst_byte_size = 0; |
| 559 | |
Jim Ingham | aa3e3e1 | 2011-03-22 01:48:42 +0000 | [diff] [blame] | 560 | if (!append) |
| 561 | m_instruction_list.Clear(); |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 562 | |
| 563 | while (data.ValidOffset(data_offset) && num_instructions) |
| 564 | { |
Greg Clayton | 5c4c746 | 2010-10-06 03:09:58 +0000 | [diff] [blame] | 565 | Address inst_addr (base_addr); |
| 566 | inst_addr.Slide(data_offset); |
Greg Clayton | b1888f2 | 2011-03-19 01:12:21 +0000 | [diff] [blame] | 567 | |
| 568 | bool use_thumb = false; |
| 569 | // If we have a thumb disassembler, then we have an ARM architecture |
| 570 | // so we need to check what the instruction address class is to make |
| 571 | // sure we shouldn't be disassembling as thumb... |
Greg Clayton | 889fbd0 | 2011-03-26 19:14:58 +0000 | [diff] [blame] | 572 | AddressClass inst_address_class = eAddressClassInvalid; |
Greg Clayton | b1888f2 | 2011-03-19 01:12:21 +0000 | [diff] [blame] | 573 | if (m_disassembler_thumb) |
| 574 | { |
Greg Clayton | 889fbd0 | 2011-03-26 19:14:58 +0000 | [diff] [blame] | 575 | inst_address_class = inst_addr.GetAddressClass (); |
| 576 | if (inst_address_class == eAddressClassCodeAlternateISA) |
Greg Clayton | b1888f2 | 2011-03-19 01:12:21 +0000 | [diff] [blame] | 577 | use_thumb = true; |
| 578 | } |
Johnny Chen | 80ab18e | 2011-05-12 22:25:53 +0000 | [diff] [blame] | 579 | |
Greg Clayton | 7bc3908 | 2011-03-24 23:53:38 +0000 | [diff] [blame] | 580 | InstructionSP inst_sp (new InstructionLLVM (inst_addr, |
Greg Clayton | 889fbd0 | 2011-03-26 19:14:58 +0000 | [diff] [blame] | 581 | inst_address_class, |
Greg Clayton | abe0fed | 2011-04-18 08:33:37 +0000 | [diff] [blame] | 582 | use_thumb ? m_disassembler_thumb : m_disassembler, |
Johnny Chen | 1608c87 | 2011-05-18 18:22:16 +0000 | [diff] [blame] | 583 | use_thumb ? llvm::Triple::thumb : m_arch.GetMachine())); |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 584 | |
Greg Clayton | 889fbd0 | 2011-03-26 19:14:58 +0000 | [diff] [blame] | 585 | size_t inst_byte_size = inst_sp->Decode (*this, data, data_offset); |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 586 | |
| 587 | if (inst_byte_size == 0) |
| 588 | break; |
| 589 | |
Greg Clayton | 5c4c746 | 2010-10-06 03:09:58 +0000 | [diff] [blame] | 590 | m_instruction_list.Append (inst_sp); |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 591 | |
| 592 | total_inst_byte_size += inst_byte_size; |
| 593 | data_offset += inst_byte_size; |
| 594 | num_instructions--; |
| 595 | } |
| 596 | |
| 597 | return total_inst_byte_size; |
| 598 | } |
| 599 | |
| 600 | void |
| 601 | DisassemblerLLVM::Initialize() |
| 602 | { |
| 603 | PluginManager::RegisterPlugin (GetPluginNameStatic(), |
| 604 | GetPluginDescriptionStatic(), |
| 605 | CreateInstance); |
| 606 | } |
| 607 | |
| 608 | void |
| 609 | DisassemblerLLVM::Terminate() |
| 610 | { |
| 611 | PluginManager::UnregisterPlugin (CreateInstance); |
| 612 | } |
| 613 | |
| 614 | |
| 615 | const char * |
| 616 | DisassemblerLLVM::GetPluginNameStatic() |
| 617 | { |
Greg Clayton | 149731c | 2011-03-25 18:03:16 +0000 | [diff] [blame] | 618 | return "llvm"; |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 619 | } |
| 620 | |
| 621 | const char * |
| 622 | DisassemblerLLVM::GetPluginDescriptionStatic() |
| 623 | { |
Greg Clayton | 149731c | 2011-03-25 18:03:16 +0000 | [diff] [blame] | 624 | return "Disassembler that uses LLVM opcode tables to disassemble i386, x86_64 and ARM."; |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 625 | } |
| 626 | |
| 627 | //------------------------------------------------------------------ |
| 628 | // PluginInterface protocol |
| 629 | //------------------------------------------------------------------ |
| 630 | const char * |
| 631 | DisassemblerLLVM::GetPluginName() |
| 632 | { |
| 633 | return "DisassemblerLLVM"; |
| 634 | } |
| 635 | |
| 636 | const char * |
| 637 | DisassemblerLLVM::GetShortPluginName() |
| 638 | { |
| 639 | return GetPluginNameStatic(); |
| 640 | } |
| 641 | |
| 642 | uint32_t |
| 643 | DisassemblerLLVM::GetPluginVersion() |
| 644 | { |
| 645 | return 1; |
| 646 | } |
| 647 | |