LLDB mainline
Disassembler.h
Go to the documentation of this file.
1//===-- Disassembler.h ------------------------------------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#ifndef LLDB_CORE_DISASSEMBLER_H
10#define LLDB_CORE_DISASSEMBLER_H
11
12#include "lldb/Core/Address.h"
15#include "lldb/Core/Opcode.h"
23#include "lldb/lldb-defines.h"
24#include "lldb/lldb-forward.h"
26#include "lldb/lldb-types.h"
27
28#include "llvm/ADT/StringRef.h"
29
30#include <functional>
31#include <map>
32#include <memory>
33#include <set>
34#include <string>
35#include <vector>
36
37#include <cstddef>
38#include <cstdint>
39#include <cstdio>
40
41namespace llvm {
42template <typename T> class SmallVectorImpl;
43}
44
45namespace lldb_private {
46class AddressRange;
47class DataExtractor;
48class Debugger;
49class Disassembler;
50class Module;
51class StackFrame;
52class Stream;
53class SymbolContext;
54class SymbolContextList;
55class Target;
56struct RegisterInfo;
57
59public:
60 Instruction(const Address &address,
62
63 virtual ~Instruction();
64
65 const Address &GetAddress() const { return m_address; }
66
67 const char *GetMnemonic(const ExecutionContext *exe_ctx,
68 bool markup = false) {
70 return markup ? m_markup_opcode_name.c_str() : m_opcode_name.c_str();
71 }
72
73 const char *GetOperands(const ExecutionContext *exe_ctx,
74 bool markup = false) {
76 return markup ? m_markup_mnemonics.c_str() : m_mnemonics.c_str();
77 }
78
79 const char *GetComment(const ExecutionContext *exe_ctx) {
81 return m_comment.c_str();
82 }
83
84 /// \return
85 /// The control flow kind of this instruction, or
86 /// eInstructionControlFlowKindUnknown if the instruction
87 /// can't be classified.
92
93 virtual void
95
97
98 void SetAddress(const Address &addr) {
99 // Invalidate the address class to lazily discover it if we need to.
101 m_address = addr;
102 }
103
104 /// Dump the text representation of this Instruction to a Stream
105 ///
106 /// Print the (optional) address, (optional) bytes, opcode,
107 /// operands, and instruction comments to a stream.
108 ///
109 /// \param[in] s
110 /// The Stream to add the text to.
111 ///
112 /// \param[in] show_address
113 /// Whether the address (using disassembly_addr_format_spec formatting)
114 /// should be printed.
115 ///
116 /// \param[in] show_bytes
117 /// Whether the bytes of the assembly instruction should be printed.
118 ///
119 /// \param[in] show_control_flow_kind
120 /// Whether the control flow kind of the instruction should be printed.
121 ///
122 /// \param[in] max_opcode_byte_size
123 /// The size (in bytes) of the largest instruction in the list that
124 /// we are printing (for text justification/alignment purposes)
125 /// Only needed if show_bytes is true.
126 ///
127 /// \param[in] exe_ctx
128 /// The current execution context, if available. May be used in
129 /// the assembling of the operands+comments for this instruction.
130 /// Pass NULL if not applicable.
131 ///
132 /// \param[in] sym_ctx
133 /// The SymbolContext for this instruction.
134 /// Pass NULL if not available/computed.
135 /// Only needed if show_address is true.
136 ///
137 /// \param[in] prev_sym_ctx
138 /// The SymbolContext for the previous instruction. Depending on
139 /// the disassembly address format specification, a change in
140 /// Symbol / Function may mean that a line is printed with the new
141 /// symbol/function name.
142 /// Pass NULL if unavailable, or if this is the first instruction of
143 /// the InstructionList.
144 /// Only needed if show_address is true.
145 ///
146 /// \param[in] disassembly_addr_format
147 /// The format specification for how addresses are printed.
148 /// Only needed if show_address is true.
149 ///
150 /// \param[in] max_address_text_size
151 /// The length of the longest address string at the start of the
152 /// disassembly line that will be printed (the
153 /// Debugger::FormatDisassemblerAddress() string)
154 /// so this method can properly align the instruction opcodes.
155 /// May be 0 to indicate no indentation/alignment of the opcodes.
156 virtual void Dump(Stream *s, uint32_t max_opcode_byte_size, bool show_address,
157 bool show_bytes, bool show_control_flow_kind,
158 const ExecutionContext *exe_ctx,
159 const SymbolContext *sym_ctx,
160 const SymbolContext *prev_sym_ctx,
161 const FormatEntity::Entry *disassembly_addr_format,
162 size_t max_address_text_size);
163
164 virtual bool DoesBranch() = 0;
165
166 virtual bool HasDelaySlot();
167
168 virtual bool IsLoad() = 0;
169
170 virtual bool IsAuthenticated() = 0;
171
172 bool CanSetBreakpoint();
173
174 virtual size_t Decode(const Disassembler &disassembler,
175 const DataExtractor &data,
176 lldb::offset_t data_offset) = 0;
177
178 virtual void SetDescription(llvm::StringRef) {
179 } // May be overridden in sub-classes that have descriptions.
180
181 lldb::OptionValueSP ReadArray(FILE *in_file, Stream &out_stream,
182 OptionValue::Type data_type);
183
184 lldb::OptionValueSP ReadDictionary(FILE *in_file, Stream &out_stream);
185
186 bool DumpEmulation(const ArchSpec &arch);
187
188 virtual bool TestEmulation(Stream &stream, const char *test_file_name);
189
190 bool Emulate(const ArchSpec &arch, uint32_t evaluate_options, void *baton,
195
196 const Opcode &GetOpcode() const { return m_opcode; }
197
198 uint32_t GetData(DataExtractor &data);
199
200 struct Operand {
209 std::vector<Operand> m_children;
212 bool m_negative = false;
213 bool m_clobbered = false;
214
215 bool IsValid() { return m_type != Type::Invalid; }
216
218 static Operand BuildImmediate(lldb::addr_t imm, bool neg);
219 static Operand BuildImmediate(int64_t imm);
220 static Operand BuildDereference(const Operand &ref);
221 static Operand BuildSum(const Operand &lhs, const Operand &rhs);
222 static Operand BuildProduct(const Operand &lhs, const Operand &rhs);
223 };
224
226 return false;
227 }
228
229 virtual bool IsCall() { return false; }
230
231 static const char *GetNameForInstructionControlFlowKind(
232 lldb::InstructionControlFlowKind instruction_control_flow_kind);
233
234protected:
235 Address m_address; // The section offset address of this instruction
236 // We include an address class in the Instruction class to
237 // allow the instruction specify the
238 // AddressClass::eCodeAlternateISA (currently used for
239 // thumb), and also to specify data (AddressClass::eData).
240 // The usual value will be AddressClass::eCode, but often
241 // when disassembling memory, you might run into data.
242 // This can help us to disassemble appropriately.
243private:
244 AddressClass m_address_class; // Use GetAddressClass () accessor function!
245
246protected:
247 Opcode m_opcode; // The opcode for this instruction
248 std::string m_opcode_name;
250 std::string m_mnemonics;
252 std::string m_comment;
254
255 void
262};
263
265std::function<bool(const Instruction::Operand &)>
266MatchBinaryOp(std::function<bool(const Instruction::Operand &)> base,
267 std::function<bool(const Instruction::Operand &)> left,
268 std::function<bool(const Instruction::Operand &)> right);
269
270std::function<bool(const Instruction::Operand &)>
271MatchUnaryOp(std::function<bool(const Instruction::Operand &)> base,
272 std::function<bool(const Instruction::Operand &)> child);
273
274std::function<bool(const Instruction::Operand &)>
275MatchRegOp(const RegisterInfo &info);
276
277std::function<bool(const Instruction::Operand &)> FetchRegOp(ConstString &reg);
278
279std::function<bool(const Instruction::Operand &)> MatchImmOp(int64_t imm);
280
281std::function<bool(const Instruction::Operand &)> FetchImmOp(int64_t &imm);
282
283std::function<bool(const Instruction::Operand &)>
285} // namespace OperandMatchers
286
288public:
291
292 size_t GetSize() const;
293
294 size_t GetTotalByteSize() const;
295
296 uint32_t GetMaxOpcocdeByteSize() const;
297
299
300 /// Get the instruction at the given address.
301 ///
302 /// \return
303 /// A valid \a InstructionSP if the address could be found, or null
304 /// otherwise.
306
307 //------------------------------------------------------------------
308 /// Get the index of the next branch instruction.
309 ///
310 /// Given a list of instructions, find the next branch instruction
311 /// in the list by returning an index.
312 ///
313 /// @param[in] start
314 /// The instruction index of the first instruction to check.
315 ///
316 /// @param[in] ignore_calls
317 /// It true, then fine the first branch instruction that isn't
318 /// a function call (a branch that calls and returns to the next
319 /// instruction). If false, find the instruction index of any
320 /// branch in the list.
321 ///
322 /// @param[out] found_calls
323 /// If non-null, this will be set to true if any calls were found in
324 /// extending the range.
325 ///
326 /// @return
327 /// The instruction index of the first branch that is at or past
328 /// \a start. Returns UINT32_MAX if no matching branches are
329 /// found.
330 //------------------------------------------------------------------
331 uint32_t GetIndexOfNextBranchInstruction(uint32_t start, bool ignore_calls,
332 bool *found_calls) const;
333
335 Target &target);
336
337 uint32_t GetIndexOfInstructionAtAddress(const Address &addr);
338
339 void Clear();
340
341 void Append(lldb::InstructionSP &inst_sp);
342
343 void Dump(Stream *s, bool show_address, bool show_bytes,
344 bool show_control_flow_kind, const ExecutionContext *exe_ctx);
345
346private:
347 typedef std::vector<lldb::InstructionSP> collection;
348 typedef collection::iterator iterator;
349 typedef collection::const_iterator const_iterator;
350
352};
353
355public:
357
359
360 bool DoesBranch() override;
361
362 bool HasDelaySlot() override;
363
364 bool IsLoad() override;
365
366 bool IsAuthenticated() override;
367
369 const ExecutionContext *exe_ctx) override {
370 // TODO: fill this in and put opcode name into Instruction::m_opcode_name,
371 // mnemonic into Instruction::m_mnemonics, and any comment into
372 // Instruction::m_comment
373 }
374
375 size_t Decode(const Disassembler &disassembler, const DataExtractor &data,
376 lldb::offset_t data_offset) override;
377
378 void SetOpcode(size_t opcode_size, void *opcode_data);
379
380 void SetDescription(llvm::StringRef description) override;
381
382protected:
383 std::string m_description;
384
387};
388
389class Disassembler : public std::enable_shared_from_this<Disassembler>,
390 public PluginInterface {
391public:
392 enum {
394 eOptionShowBytes = (1u << 0),
395 eOptionRawOuput = (1u << 1),
396 eOptionMarkPCSourceLine = (1u << 2), // Mark the source line that contains
397 // the current PC (mixed mode only)
399 (1u << 3), // Mark the disassembly line the contains the PC
402 };
403
408
409 // FindPlugin should be lax about the flavor string (it is too annoying to
410 // have various internal uses of the disassembler fail because the global
411 // flavor string gets set wrong. Instead, if you get a flavor string you
412 // don't understand, use the default. Folks who care to check can use the
413 // FlavorValidForArchSpec method on the disassembler they got back.
414 static lldb::DisassemblerSP FindPlugin(const ArchSpec &arch,
415 const char *flavor, const char *cpu,
416 const char *features,
417 const char *plugin_name);
418
419 // This version will use the value in the Target settings if flavor is NULL;
421 FindPluginForTarget(const Target &target, const ArchSpec &arch,
422 const char *flavor, const char *cpu, const char *features,
423 const char *plugin_name);
424
429
431 DisassembleRange(const ArchSpec &arch, const char *plugin_name,
432 const char *flavor, const char *cpu, const char *features,
433 Target &target, llvm::ArrayRef<AddressRange> disasm_ranges,
434 bool force_live_memory = false);
435
437 DisassembleBytes(const ArchSpec &arch, const char *plugin_name,
438 const char *flavor, const char *cpu, const char *features,
439 const Address &start, const void *bytes, size_t length,
440 uint32_t max_num_instructions, bool data_from_file);
441
442 static bool Disassemble(Debugger &debugger, const ArchSpec &arch,
443 const char *plugin_name, const char *flavor,
444 const char *cpu, const char *features,
445 const ExecutionContext &exe_ctx, const Address &start,
446 Limit limit, bool mixed_source_and_assembly,
447 uint32_t num_mixed_context_lines, uint32_t options,
448 Stream &strm);
449
450 static bool Disassemble(Debugger &debugger, const ArchSpec &arch,
451 StackFrame &frame, Stream &strm);
452
453 // Constructors and Destructors
454 Disassembler(const ArchSpec &arch, const char *flavor);
455 ~Disassembler() override;
456
457 void PrintInstructions(Debugger &debugger, const ArchSpec &arch,
458 const ExecutionContext &exe_ctx,
459 bool mixed_source_and_assembly,
460 uint32_t num_mixed_context_lines, uint32_t options,
461 Stream &strm);
462
463 size_t ParseInstructions(Target &target, Address address, Limit limit,
464 Stream *error_strm_ptr,
465 bool force_live_memory = false) {
466 m_instruction_list.Clear();
467 return AppendInstructions(target, address, limit, error_strm_ptr,
468 force_live_memory);
469 }
470
471 virtual size_t DecodeInstructions(const Address &base_addr,
472 const DataExtractor &data,
473 lldb::offset_t data_offset,
474 size_t num_instructions, bool append,
475 bool data_from_file) = 0;
476
478
479 const InstructionList &GetInstructionList() const;
480
481 const ArchSpec &GetArchitecture() const { return m_arch; }
482
483 const char *GetFlavor() const { return m_flavor.c_str(); }
484
486 const char *flavor) = 0;
487
488protected:
489 size_t AppendInstructions(Target &target, Address address, Limit limit,
490 Stream *error_strm_ptr, bool force_live_memory);
491
492 // SourceLine and SourceLinesToDisplay structures are only used in the mixed
493 // source and assembly display methods internal to this class.
494
495 struct SourceLine {
498 uint32_t column = 0;
499
500 SourceLine() = default;
501
502 bool operator==(const SourceLine &rhs) const {
503 return file == rhs.file && line == rhs.line && rhs.column == column;
504 }
505
506 bool operator!=(const SourceLine &rhs) const {
507 return file != rhs.file || line != rhs.line || column != rhs.column;
508 }
509
510 bool IsValid() const { return line != LLDB_INVALID_LINE_NUMBER; }
511 };
512
514 std::vector<SourceLine> lines;
515
516 // index of the "current" source line, if we want to highlight that when
517 // displaying the source lines. (as opposed to the surrounding source
518 // lines provided to give context)
520
521 // Whether to print a blank line at the end of the source lines.
523
525 };
526
527 // Get the function's declaration line number, hopefully a line number
528 // earlier than the opening curly brace at the start of the function body.
530
531 // Add the provided SourceLine to the map of filenames-to-source-lines-seen.
532 static void AddLineToSourceLineTables(
533 SourceLine &line,
534 std::map<FileSpec, std::set<uint32_t>> &source_lines_seen);
535
536 // Given a source line, determine if we should print it when we're doing
537 // mixed source & assembly output. We're currently using the
538 // target.process.thread.step-avoid-regexp setting (which is used for
539 // stepping over inlined STL functions by default) to determine what source
540 // lines to avoid showing.
541 //
542 // Returns true if this source line should be elided (if the source line
543 // should not be displayed).
544 static bool
546 const SymbolContext &sc, SourceLine &line);
547
548 static bool
550 const SymbolContext &sc, LineEntry &line) {
551 SourceLine sl;
552 sl.file = line.GetFile();
553 sl.line = line.line;
554 sl.column = line.column;
555 return ElideMixedSourceAndDisassemblyLine(exe_ctx, sc, sl);
556 };
557
558 // Classes that inherit from Disassembler can see and modify these
561 std::string m_flavor;
562
563private:
564 // For Disassembler only
565 Disassembler(const Disassembler &) = delete;
566 const Disassembler &operator=(const Disassembler &) = delete;
567};
568
569/// Tracks live variable annotations across instructions and produces
570/// per-instruction "events" like `name = RDI` or `name = <undef>`.
572 struct VarState {
573 /// Display name.
574 std::string name;
575 /// Last printed location (empty means <undef>).
576 std::string last_loc;
577 };
578
579 // Live state from the previous instruction, keyed by Variable::GetID().
580 llvm::DenseMap<lldb::user_id_t, VarState> Live_;
581
582public:
583 /// Compute annotation strings for a single instruction and update `Live_`.
584 /// Returns only the events that should be printed *at this instruction*.
585 std::vector<std::string> annotate(Instruction &inst, Target &target,
586 const lldb::ModuleSP &module_sp);
587};
588
589} // namespace lldb_private
590
591#endif // LLDB_CORE_DISASSEMBLER_H
A section + offset based address class.
Definition Address.h:62
An architecture specification class.
Definition ArchSpec.h:31
A uniqued constant string class.
Definition ConstString.h:40
An data extractor class.
A class to manage flag bits.
Definition Debugger.h:80
static lldb::DisassemblerSP FindPluginForTarget(const Target &target, const ArchSpec &arch, const char *flavor, const char *cpu, const char *features, const char *plugin_name)
static lldb::DisassemblerSP DisassembleRange(const ArchSpec &arch, const char *plugin_name, const char *flavor, const char *cpu, const char *features, Target &target, llvm::ArrayRef< AddressRange > disasm_ranges, bool force_live_memory=false)
static lldb::DisassemblerSP FindPlugin(const ArchSpec &arch, const char *flavor, const char *cpu, const char *features, const char *plugin_name)
InstructionList m_instruction_list
void PrintInstructions(Debugger &debugger, const ArchSpec &arch, const ExecutionContext &exe_ctx, bool mixed_source_and_assembly, uint32_t num_mixed_context_lines, uint32_t options, Stream &strm)
static bool Disassemble(Debugger &debugger, const ArchSpec &arch, const char *plugin_name, const char *flavor, const char *cpu, const char *features, const ExecutionContext &exe_ctx, const Address &start, Limit limit, bool mixed_source_and_assembly, uint32_t num_mixed_context_lines, uint32_t options, Stream &strm)
size_t AppendInstructions(Target &target, Address address, Limit limit, Stream *error_strm_ptr, bool force_live_memory)
const ArchSpec & GetArchitecture() const
static void AddLineToSourceLineTables(SourceLine &line, std::map< FileSpec, std::set< uint32_t > > &source_lines_seen)
static bool ElideMixedSourceAndDisassemblyLine(const ExecutionContext &exe_ctx, const SymbolContext &sc, LineEntry &line)
size_t ParseInstructions(Target &target, Address address, Limit limit, Stream *error_strm_ptr, bool force_live_memory=false)
static bool ElideMixedSourceAndDisassemblyLine(const ExecutionContext &exe_ctx, const SymbolContext &sc, SourceLine &line)
Disassembler(const Disassembler &)=delete
Disassembler(const ArchSpec &arch, const char *flavor)
static SourceLine GetFunctionDeclLineEntry(const SymbolContext &sc)
virtual size_t DecodeInstructions(const Address &base_addr, const DataExtractor &data, lldb::offset_t data_offset, size_t num_instructions, bool append, bool data_from_file)=0
const Disassembler & operator=(const Disassembler &)=delete
virtual bool FlavorValidForArchSpec(const lldb_private::ArchSpec &arch, const char *flavor)=0
const char * GetFlavor() const
InstructionList & GetInstructionList()
static lldb::DisassemblerSP DisassembleBytes(const ArchSpec &arch, const char *plugin_name, const char *flavor, const char *cpu, const char *features, const Address &start, const void *bytes, size_t length, uint32_t max_num_instructions, bool data_from_file)
bool(* WriteRegisterCallback)(EmulateInstruction *instruction, void *baton, const Context &context, const RegisterInfo *reg_info, const RegisterValue &reg_value)
size_t(* WriteMemoryCallback)(EmulateInstruction *instruction, void *baton, const Context &context, lldb::addr_t addr, const void *dst, size_t length)
size_t(* ReadMemoryCallback)(EmulateInstruction *instruction, void *baton, const Context &context, lldb::addr_t addr, void *dst, size_t length)
bool(* ReadRegisterCallback)(EmulateInstruction *instruction, void *baton, const RegisterInfo *reg_info, RegisterValue &reg_value)
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
A file utility class.
Definition FileSpec.h:57
void Append(lldb::InstructionSP &inst_sp)
uint32_t GetIndexOfInstructionAtAddress(const Address &addr)
collection::iterator iterator
collection::const_iterator const_iterator
lldb::InstructionSP GetInstructionAtIndex(size_t idx) const
uint32_t GetIndexOfInstructionAtLoadAddress(lldb::addr_t load_addr, Target &target)
std::vector< lldb::InstructionSP > collection
lldb::InstructionSP GetInstructionAtAddress(const Address &addr)
Get the instruction at the given address.
void Dump(Stream *s, bool show_address, bool show_bytes, bool show_control_flow_kind, const ExecutionContext *exe_ctx)
uint32_t GetIndexOfNextBranchInstruction(uint32_t start, bool ignore_calls, bool *found_calls) const
Get the index of the next branch instruction.
uint32_t GetMaxOpcocdeByteSize() const
uint32_t GetData(DataExtractor &data)
Instruction(const Address &address, AddressClass addr_class=AddressClass::eInvalid)
virtual bool ParseOperands(llvm::SmallVectorImpl< Operand > &operands)
virtual void CalculateMnemonicOperandsAndComment(const ExecutionContext *exe_ctx)=0
static const char * GetNameForInstructionControlFlowKind(lldb::InstructionControlFlowKind instruction_control_flow_kind)
virtual bool TestEmulation(Stream &stream, const char *test_file_name)
virtual size_t Decode(const Disassembler &disassembler, const DataExtractor &data, lldb::offset_t data_offset)=0
virtual lldb::InstructionControlFlowKind GetControlFlowKind(const ExecutionContext *exe_ctx)
void CalculateMnemonicOperandsAndCommentIfNeeded(const ExecutionContext *exe_ctx)
void SetAddress(const Address &addr)
lldb::OptionValueSP ReadArray(FILE *in_file, Stream &out_stream, OptionValue::Type data_type)
const Address & GetAddress() const
const char * GetMnemonic(const ExecutionContext *exe_ctx, bool markup=false)
bool DumpEmulation(const ArchSpec &arch)
const char * GetComment(const ExecutionContext *exe_ctx)
const char * GetOperands(const ExecutionContext *exe_ctx, bool markup=false)
virtual bool DoesBranch()=0
lldb::OptionValueSP ReadDictionary(FILE *in_file, Stream &out_stream)
virtual void SetDescription(llvm::StringRef)
const Opcode & GetOpcode() const
virtual void Dump(Stream *s, uint32_t max_opcode_byte_size, bool show_address, bool show_bytes, bool show_control_flow_kind, const ExecutionContext *exe_ctx, const SymbolContext *sym_ctx, const SymbolContext *prev_sym_ctx, const FormatEntity::Entry *disassembly_addr_format, size_t max_address_text_size)
Dump the text representation of this Instruction to a Stream.
bool Emulate(const ArchSpec &arch, uint32_t evaluate_options, void *baton, EmulateInstruction::ReadMemoryCallback read_mem_callback, EmulateInstruction::WriteMemoryCallback write_mem_calback, EmulateInstruction::ReadRegisterCallback read_reg_callback, EmulateInstruction::WriteRegisterCallback write_reg_callback)
virtual bool IsLoad()=0
virtual bool IsAuthenticated()=0
const PseudoInstruction & operator=(const PseudoInstruction &)=delete
void SetOpcode(size_t opcode_size, void *opcode_data)
void SetDescription(llvm::StringRef description) override
void CalculateMnemonicOperandsAndComment(const ExecutionContext *exe_ctx) override
PseudoInstruction(const PseudoInstruction &)=delete
size_t Decode(const Disassembler &disassembler, const DataExtractor &data, lldb::offset_t data_offset) override
This base class provides an interface to stack frames.
Definition StackFrame.h:44
A stream class that can stream formatted output to a file.
Definition Stream.h:28
Defines a symbol context baton that can be handed other debug core functions.
Tracks live variable annotations across instructions and produces per-instruction "events" like name ...
llvm::DenseMap< lldb::user_id_t, VarState > Live_
std::vector< std::string > annotate(Instruction &inst, Target &target, const lldb::ModuleSP &module_sp)
Compute annotation strings for a single instruction and update Live_.
#define LLDB_INVALID_LINE_NUMBER
std::function< bool(const Instruction::Operand &)> MatchRegOp(const RegisterInfo &info)
std::function< bool(const Instruction::Operand &)> FetchRegOp(ConstString &reg)
std::function< bool(const Instruction::Operand &)> MatchImmOp(int64_t imm)
std::function< bool(const Instruction::Operand &)> FetchImmOp(int64_t &imm)
std::function< bool(const Instruction::Operand &)> MatchOpType(Instruction::Operand::Type type)
std::function< bool(const Instruction::Operand &)> MatchBinaryOp(std::function< bool(const Instruction::Operand &)> base, std::function< bool(const Instruction::Operand &)> left, std::function< bool(const Instruction::Operand &)> right)
std::function< bool(const Instruction::Operand &)> MatchUnaryOp(std::function< bool(const Instruction::Operand &)> base, std::function< bool(const Instruction::Operand &)> child)
A class that represents a running process on the host machine.
uint64_t offset_t
Definition lldb-types.h:85
std::shared_ptr< lldb_private::Instruction > InstructionSP
std::shared_ptr< lldb_private::Disassembler > DisassemblerSP
InstructionControlFlowKind
Architecture-agnostic categorization of instructions for traversing the control flow of a trace.
@ eInstructionControlFlowKindUnknown
The instruction could not be classified.
uint64_t addr_t
Definition lldb-types.h:80
std::shared_ptr< lldb_private::Module > ModuleSP
std::shared_ptr< lldb_private::OptionValue > OptionValueSP
enum lldb_private::Disassembler::Limit::@074264254305040353250152340202075156127302012033 kind
bool operator==(const SourceLine &rhs) const
bool operator!=(const SourceLine &rhs) const
enum lldb_private::Instruction::Operand::Type m_type
static Operand BuildImmediate(lldb::addr_t imm, bool neg)
static Operand BuildDereference(const Operand &ref)
std::vector< Operand > m_children
static Operand BuildProduct(const Operand &lhs, const Operand &rhs)
static Operand BuildSum(const Operand &lhs, const Operand &rhs)
static Operand BuildRegister(ConstString &r)
A line table entry class.
Definition LineEntry.h:21
uint16_t column
The column number of the source line, or zero if there is no column information.
Definition LineEntry.h:151
uint32_t line
The source line number, or LLDB_INVALID_LINE_NUMBER if there is no line number information.
Definition LineEntry.h:147
const FileSpec & GetFile() const
Helper to access the file.
Definition LineEntry.h:134
Every register is described in detail including its name, alternate name (optional),...
std::string last_loc
Last printed location (empty means <undef>).