Skip to content

Commit 2340fb7

Browse files
committed
export StopDisassemblyType enum
1 parent 460d82c commit 2340fb7

File tree

15 files changed

+68
-58
lines changed

15 files changed

+68
-58
lines changed

lldb/include/lldb/Core/Debugger.h

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -232,14 +232,6 @@ class Debugger : public std::enable_shared_from_this<Debugger>,
232232

233233
void SetLoggingCallback(lldb::LogOutputCallback log_callback, void *baton);
234234

235-
// Properties Functions
236-
enum StopDisassemblyType {
237-
eStopDisassemblyTypeNever = 0,
238-
eStopDisassemblyTypeNoDebugInfo,
239-
eStopDisassemblyTypeNoSource,
240-
eStopDisassemblyTypeAlways
241-
};
242-
243235
Status SetPropertyValue(const ExecutionContext *exe_ctx,
244236
VarSetOperationType op, llvm::StringRef property_path,
245237
llvm::StringRef value) override;
@@ -336,7 +328,7 @@ class Debugger : public std::enable_shared_from_this<Debugger>,
336328

337329
uint64_t GetStopSourceLineCount(bool before) const;
338330

339-
StopDisassemblyType GetStopDisassemblyDisplay() const;
331+
lldb::StopDisassemblyType GetStopDisassemblyDisplay() const;
340332

341333
uint64_t GetDisassemblyLineCount() const;
342334

lldb/include/lldb/lldb-enumerations.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1383,6 +1383,14 @@ enum CommandReturnObjectCallbackResult {
13831383
eCommandReturnObjectPrintCallbackHandled = 1,
13841384
};
13851385

1386+
// Used to determine when to show disassembly
1387+
enum StopDisassemblyType {
1388+
eStopDisassemblyTypeNever = 0,
1389+
eStopDisassemblyTypeNoDebugInfo,
1390+
eStopDisassemblyTypeNoSource,
1391+
eStopDisassemblyTypeAlways
1392+
};
1393+
13861394
} // namespace lldb
13871395

13881396
#endif // LLDB_LLDB_ENUMERATIONS_H

lldb/source/Core/CoreProperties.td

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,13 @@ let Definition = "debugger" in {
9191
Global,
9292
DefaultUnsignedValue<4>,
9393
Desc<"The number of disassembly lines to show when displaying a stopped context.">;
94-
def StopDisassemblyDisplay: Property<"stop-disassembly-display", "Enum">,
95-
Global,
96-
DefaultEnumValue<"Debugger::eStopDisassemblyTypeNoDebugInfo">,
97-
EnumValues<"OptionEnumValues(g_show_disassembly_enum_values)">,
98-
Desc<"Control when to display disassembly when displaying a stopped context.">;
94+
def StopDisassemblyDisplay
95+
: Property<"stop-disassembly-display", "Enum">,
96+
Global,
97+
DefaultEnumValue<"eStopDisassemblyTypeNoDebugInfo">,
98+
EnumValues<"OptionEnumValues(g_show_disassembly_enum_values)">,
99+
Desc<"Control when to display disassembly when displaying a stopped "
100+
"context.">;
99101
def StopDisassemblyMaxSize: Property<"stop-disassembly-max-size", "UInt64">,
100102
Global,
101103
DefaultUnsignedValue<32000>,

lldb/source/Core/Debugger.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -112,24 +112,24 @@ static llvm::DefaultThreadPool *g_thread_pool = nullptr;
112112

113113
static constexpr OptionEnumValueElement g_show_disassembly_enum_values[] = {
114114
{
115-
Debugger::eStopDisassemblyTypeNever,
115+
lldb::eStopDisassemblyTypeNever,
116116
"never",
117117
"Never show disassembly when displaying a stop context.",
118118
},
119119
{
120-
Debugger::eStopDisassemblyTypeNoDebugInfo,
120+
lldb::eStopDisassemblyTypeNoDebugInfo,
121121
"no-debuginfo",
122122
"Show disassembly when there is no debug information.",
123123
},
124124
{
125-
Debugger::eStopDisassemblyTypeNoSource,
125+
lldb::eStopDisassemblyTypeNoSource,
126126
"no-source",
127127
"Show disassembly when there is no source information, or the source "
128128
"file "
129129
"is missing when displaying a stop context.",
130130
},
131131
{
132-
Debugger::eStopDisassemblyTypeAlways,
132+
lldb::eStopDisassemblyTypeAlways,
133133
"always",
134134
"Always show disassembly when displaying a stop context.",
135135
},
@@ -611,10 +611,10 @@ uint64_t Debugger::GetStopSourceLineCount(bool before) const {
611611
idx, g_debugger_properties[idx].default_uint_value);
612612
}
613613

614-
Debugger::StopDisassemblyType Debugger::GetStopDisassemblyDisplay() const {
614+
lldb::StopDisassemblyType Debugger::GetStopDisassemblyDisplay() const {
615615
const uint32_t idx = ePropertyStopDisassemblyDisplay;
616-
return GetPropertyAtIndexAs<Debugger::StopDisassemblyType>(
617-
idx, static_cast<Debugger::StopDisassemblyType>(
616+
return GetPropertyAtIndexAs<lldb::StopDisassemblyType>(
617+
idx, static_cast<lldb::StopDisassemblyType>(
618618
g_debugger_properties[idx].default_uint_value));
619619
}
620620

lldb/source/Target/StackFrame.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2030,8 +2030,7 @@ bool StackFrame::GetStatus(Stream &strm, bool show_frame_info, bool show_source,
20302030
if (show_source) {
20312031
ExecutionContext exe_ctx(shared_from_this());
20322032
bool have_source = false, have_debuginfo = false;
2033-
Debugger::StopDisassemblyType disasm_display =
2034-
Debugger::eStopDisassemblyTypeNever;
2033+
lldb::StopDisassemblyType disasm_display = lldb::eStopDisassemblyTypeNever;
20352034
Target *target = exe_ctx.GetTargetPtr();
20362035
if (target) {
20372036
Debugger &debugger = target->GetDebugger();
@@ -2064,20 +2063,20 @@ bool StackFrame::GetStatus(Stream &strm, bool show_frame_info, bool show_source,
20642063
}
20652064
}
20662065
switch (disasm_display) {
2067-
case Debugger::eStopDisassemblyTypeNever:
2066+
case lldb::eStopDisassemblyTypeNever:
20682067
break;
20692068

2070-
case Debugger::eStopDisassemblyTypeNoDebugInfo:
2069+
case lldb::eStopDisassemblyTypeNoDebugInfo:
20712070
if (have_debuginfo)
20722071
break;
20732072
[[fallthrough]];
20742073

2075-
case Debugger::eStopDisassemblyTypeNoSource:
2074+
case lldb::eStopDisassemblyTypeNoSource:
20762075
if (have_source)
20772076
break;
20782077
[[fallthrough]];
20792078

2080-
case Debugger::eStopDisassemblyTypeAlways:
2079+
case lldb::eStopDisassemblyTypeAlways:
20812080
if (target) {
20822081
const uint32_t disasm_lines = debugger.GetDisassemblyLineCount();
20832082
if (disasm_lines > 0) {

lldb/tools/lldb-dap/DAP.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -202,10 +202,6 @@ struct DAP {
202202

203203
lldb::SBFormat frame_format;
204204
lldb::SBFormat thread_format;
205-
206-
/// The value of stop-disassembly-display setting in LLDB.
207-
std::string stop_disassembly_display;
208-
209205
// This is used to allow request_evaluate to handle empty expressions
210206
// (ie the user pressed 'return' and expects the previous expression to
211207
// repeat). If the previous expression was a command, this string will be

lldb/tools/lldb-dap/Handler/AttachRequestHandler.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ void AttachRequestHandler::operator()(const llvm::json::Object &request) const {
108108
}
109109

110110
SetSourceMapFromArguments(*arguments);
111-
SetStopDisassemblyDisplayFromSettings();
112111

113112
lldb::SBError status;
114113
dap.SetTarget(dap.CreateTargetFromArguments(*arguments, status));

lldb/tools/lldb-dap/Handler/LaunchRequestHandler.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ void LaunchRequestHandler::operator()(const llvm::json::Object &request) const {
9595
}
9696

9797
SetSourceMapFromArguments(*arguments);
98-
SetStopDisassemblyDisplayFromSettings();
9998

10099
lldb::SBError status;
101100
dap.SetTarget(dap.CreateTargetFromArguments(*arguments, status));

lldb/tools/lldb-dap/Handler/RequestHandler.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,6 @@ void BaseRequestHandler::SetSourceMapFromArguments(
9999
}
100100
}
101101

102-
void BaseRequestHandler::SetStopDisassemblyDisplayFromSettings() const {
103-
dap.stop_disassembly_display = GetStopDisassemblyDisplay(dap.debugger);
104-
}
105-
106102
static llvm::Error RunInTerminal(DAP &dap,
107103
const llvm::json::Object &launch_request,
108104
const uint64_t timeout_seconds) {

lldb/tools/lldb-dap/Handler/RequestHandler.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,6 @@ class BaseRequestHandler {
6363
/// argument (or neither), from which we need to set the target.source-map.
6464
void SetSourceMapFromArguments(const llvm::json::Object &arguments) const;
6565

66-
/// Sets the stop-disassembly-display setting
67-
void SetStopDisassemblyDisplayFromSettings() const;
68-
6966
/// Prints a welcome message on the editor if the preprocessor variable
7067
/// LLDB_DAP_WELCOME_MESSAGE is defined.
7168
void PrintWelcomeMessage() const;

0 commit comments

Comments
 (0)