LLDB mainline
CommandObjectDisassemble.h
Go to the documentation of this file.
1//===-- CommandObjectDisassemble.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_SOURCE_COMMANDS_COMMANDOBJECTDISASSEMBLE_H
10#define LLDB_SOURCE_COMMANDS_COMMANDOBJECTDISASSEMBLE_H
11
15
16namespace lldb_private {
17
18// CommandObjectDisassemble
19
21public:
22 class CommandOptions : public Options {
23 public:
25
26 ~CommandOptions() override;
27
28 Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg,
29 ExecutionContext *execution_context) override;
30
31 void OptionParsingStarting(ExecutionContext *execution_context) override;
32
33 llvm::ArrayRef<OptionDefinition> GetDefinitions() override;
34
35 const char *GetPluginName() {
36 return (plugin_name.empty() ? nullptr : plugin_name.c_str());
37 }
38
39 const char *GetFlavorString() {
40 if (flavor_string.empty() || flavor_string == "default")
41 return nullptr;
42 return flavor_string.c_str();
43 }
44
45 Status OptionParsingFinished(ExecutionContext *execution_context) override;
46
47 bool show_mixed; // Show mixed source/assembly
50 uint32_t num_lines_context = 0;
51 uint32_t num_instructions = 0;
52 bool raw;
53 std::string func_name;
54 bool current_function = false;
57 bool at_pc = false;
58 bool frame_line = false;
59 std::string plugin_name;
60 std::string flavor_string;
62 bool some_location_specified = false; // If no location was specified, we'll
63 // select "at_pc". This should be set
64 // in SetOptionValue if anything the selects a location is set.
66 bool force = false;
67 };
68
70
72
73 Options *GetOptions() override { return &m_options; }
74
75protected:
76 void DoExecute(Args &command, CommandReturnObject &result) override;
77
78 llvm::Expected<std::vector<AddressRange>>
80
81 llvm::Expected<std::vector<AddressRange>> GetContainingAddressRanges();
82 llvm::Expected<std::vector<AddressRange>> GetCurrentFunctionRanges();
83 llvm::Expected<std::vector<AddressRange>> GetCurrentLineRanges();
84 llvm::Expected<std::vector<AddressRange>>
86 llvm::Expected<std::vector<AddressRange>> GetPCRanges();
87 llvm::Expected<std::vector<AddressRange>> GetStartEndAddressRanges();
88
89 llvm::Error CheckRangeSize(const AddressRange &range, llvm::StringRef what);
90
92};
93
94} // namespace lldb_private
95
96#endif // LLDB_SOURCE_COMMANDS_COMMANDOBJECTDISASSEMBLE_H
A section + offset based address range class.
Definition: AddressRange.h:25
An architecture specification class.
Definition: ArchSpec.h:31
A command line argument class.
Definition: Args.h:33
Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override
Set the value of an option.
void OptionParsingStarting(ExecutionContext *execution_context) override
Status OptionParsingFinished(ExecutionContext *execution_context) override
llvm::ArrayRef< OptionDefinition > GetDefinitions() override
llvm::Expected< std::vector< AddressRange > > GetCurrentFunctionRanges()
void DoExecute(Args &command, CommandReturnObject &result) override
llvm::Expected< std::vector< AddressRange > > GetStartEndAddressRanges()
llvm::Error CheckRangeSize(const AddressRange &range, llvm::StringRef what)
llvm::Expected< std::vector< AddressRange > > GetNameRanges(CommandReturnObject &result)
llvm::Expected< std::vector< AddressRange > > GetPCRanges()
llvm::Expected< std::vector< AddressRange > > GetCurrentLineRanges()
llvm::Expected< std::vector< AddressRange > > GetContainingAddressRanges()
llvm::Expected< std::vector< AddressRange > > GetRangesForSelectedMode(CommandReturnObject &result)
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
A command line option parsing protocol class.
Definition: Options.h:58
An error handling class.
Definition: Status.h:44
A class that represents a running process on the host machine.
uint64_t addr_t
Definition: lldb-types.h:80