@@ -113,7 +113,6 @@ const char *CommandInterpreter::g_no_argument = "<no-argument>";
113
113
const char *CommandInterpreter::g_need_argument = " <need-argument>" ;
114
114
const char *CommandInterpreter::g_argument = " <argument>" ;
115
115
116
-
117
116
#define LLDB_PROPERTIES_interpreter
118
117
#include " InterpreterProperties.inc"
119
118
@@ -447,16 +446,17 @@ void CommandInterpreter::Initialize() {
447
446
CommandAlias *parray_alias =
448
447
AddAlias (" parray" , cmd_obj_sp, " --element-count %1 --" );
449
448
if (parray_alias) {
450
- parray_alias->SetHelp
451
- ( " parray <COUNT> <EXPRESSION> -- lldb will evaluate EXPRESSION "
452
- " to get a typed-pointer-to-an-array in memory, and will display "
453
- " COUNT elements of that type from the array." );
454
- parray_alias->SetHelpLong (" " );
455
- }
456
- CommandAlias *poarray_alias = AddAlias (" poarray " , cmd_obj_sp,
457
- " --object-description --element-count %1 --" );
449
+ parray_alias->SetHelp (
450
+ " parray <COUNT> <EXPRESSION> -- lldb will evaluate EXPRESSION "
451
+ " to get a typed-pointer-to-an-array in memory, and will display "
452
+ " COUNT elements of that type from the array." );
453
+ parray_alias->SetHelpLong (" " );
454
+ }
455
+ CommandAlias *poarray_alias = AddAlias (
456
+ " poarray " , cmd_obj_sp, " --object-description --element-count %1 --" );
458
457
if (poarray_alias) {
459
- poarray_alias->SetHelp (" poarray <COUNT> <EXPRESSION> -- lldb will "
458
+ poarray_alias->SetHelp (
459
+ " poarray <COUNT> <EXPRESSION> -- lldb will "
460
460
" evaluate EXPRESSION to get the address of an array of COUNT "
461
461
" objects in memory, and will call po on them." );
462
462
poarray_alias->SetHelpLong (" " );
@@ -536,9 +536,7 @@ void CommandInterpreter::Initialize() {
536
536
}
537
537
}
538
538
539
- void CommandInterpreter::Clear () {
540
- m_command_io_handler_sp.reset ();
541
- }
539
+ void CommandInterpreter::Clear () { m_command_io_handler_sp.reset (); }
542
540
543
541
const char *CommandInterpreter::ProcessEmbeddedScriptCommands (const char *arg) {
544
542
// This function has not yet been implemented.
@@ -851,9 +849,12 @@ void CommandInterpreter::LoadCommandDictionary() {
851
849
// now "bt 3" is the preferred form, in line with gdb.
852
850
if (bt_regex_cmd_up->AddRegexCommand (" ^([[:digit:]]+)[[:space:]]*$" ,
853
851
" thread backtrace -c %1" ) &&
854
- bt_regex_cmd_up->AddRegexCommand (" ^(-[^[:space:]].*)$" , " thread backtrace %1" ) &&
855
- bt_regex_cmd_up->AddRegexCommand (" ^all[[:space:]]*$" , " thread backtrace all" ) &&
856
- bt_regex_cmd_up->AddRegexCommand (" ^[[:space:]]*$" , " thread backtrace" )) {
852
+ bt_regex_cmd_up->AddRegexCommand (" ^(-[^[:space:]].*)$" ,
853
+ " thread backtrace %1" ) &&
854
+ bt_regex_cmd_up->AddRegexCommand (" ^all[[:space:]]*$" ,
855
+ " thread backtrace all" ) &&
856
+ bt_regex_cmd_up->AddRegexCommand (" ^[[:space:]]*$" ,
857
+ " thread backtrace" )) {
857
858
CommandObjectSP command_sp (bt_regex_cmd_up.release ());
858
859
m_command_dict[std::string (command_sp->GetCommandName ())] = command_sp;
859
860
}
@@ -954,13 +955,14 @@ int CommandInterpreter::GetCommandNamesMatchingPartialString(
954
955
return matches.GetSize ();
955
956
}
956
957
957
- CommandObjectMultiword *CommandInterpreter::VerifyUserMultiwordCmdPath (
958
- Args &path, bool leaf_is_command, Status &result) {
958
+ CommandObjectMultiword *
959
+ CommandInterpreter::VerifyUserMultiwordCmdPath (Args &path, bool leaf_is_command,
960
+ Status &result) {
959
961
result.Clear ();
960
962
961
963
auto get_multi_or_report_error =
962
964
[&result](CommandObjectSP cmd_sp,
963
- const char *name) -> CommandObjectMultiword * {
965
+ const char *name) -> CommandObjectMultiword * {
964
966
if (!cmd_sp) {
965
967
result = Status::FromErrorStringWithFormat (
966
968
" Path component: '%s' not found" , name);
@@ -1265,8 +1267,8 @@ CommandInterpreter::GetCommandObject(llvm::StringRef cmd_str,
1265
1267
// Try to find a match among commands and aliases. Allowing inexact matches,
1266
1268
// but perferring exact matches.
1267
1269
return GetCommandSP (cmd_str, /* include_aliases=*/ true , /* exact=*/ false ,
1268
- matches, descriptions)
1269
- .get ();
1270
+ matches, descriptions)
1271
+ .get ();
1270
1272
}
1271
1273
1272
1274
CommandObject *CommandInterpreter::GetUserCommandObject (
@@ -1299,8 +1301,8 @@ CommandObject *CommandInterpreter::GetUserCommandObject(
1299
1301
StringList tmp_list;
1300
1302
StringList *matches_ptr = matches ? matches : &tmp_list;
1301
1303
AddNamesMatchingPartialString (GetUserCommands (), cmd_str, *matches_ptr);
1302
- AddNamesMatchingPartialString (GetUserMultiwordCommands (),
1303
- cmd_str, *matches_ptr);
1304
+ AddNamesMatchingPartialString (GetUserMultiwordCommands (), cmd_str,
1305
+ *matches_ptr);
1304
1306
1305
1307
return {};
1306
1308
}
@@ -1798,8 +1800,7 @@ Status CommandInterpreter::PreprocessCommand(std::string &command) {
1798
1800
return error;
1799
1801
}
1800
1802
1801
- Status
1802
- CommandInterpreter::PreprocessToken (std::string &expr_str) {
1803
+ Status CommandInterpreter::PreprocessToken (std::string &expr_str) {
1803
1804
Status error;
1804
1805
ExecutionContext exe_ctx (GetExecutionContext ());
1805
1806
@@ -1819,9 +1820,8 @@ CommandInterpreter::PreprocessToken(std::string &expr_str) {
1819
1820
options.SetTryAllThreads (true );
1820
1821
options.SetTimeout (std::nullopt);
1821
1822
1822
- ExpressionResults expr_result =
1823
- target.EvaluateExpression (expr_str.c_str (), exe_ctx.GetFramePtr (),
1824
- expr_result_valobj_sp, options);
1823
+ ExpressionResults expr_result = target.EvaluateExpression (
1824
+ expr_str.c_str (), exe_ctx.GetFramePtr (), expr_result_valobj_sp, options);
1825
1825
1826
1826
if (expr_result == eExpressionCompleted) {
1827
1827
Scalar scalar;
@@ -1890,7 +1890,7 @@ bool CommandInterpreter::HandleCommand(const char *command_line,
1890
1890
1891
1891
Log *log = GetLog (LLDBLog::Commands);
1892
1892
llvm::PrettyStackTraceFormat stack_trace (" HandleCommand(command = \" %s\" )" ,
1893
- command_line);
1893
+ command_line);
1894
1894
1895
1895
LLDB_LOGF (log, " Processing command: %s" , command_line);
1896
1896
LLDB_SCOPED_TIMERF (" Processing command: %s." , command_line);
@@ -2011,7 +2011,8 @@ bool CommandInterpreter::HandleCommand(const char *command_line,
2011
2011
// has the command expanded to the full name. For example, if the input was
2012
2012
// "br s -n main", command_string is now "breakpoint set -n main".
2013
2013
if (log) {
2014
- llvm::StringRef command_name = cmd_obj ? cmd_obj->GetCommandName () : " <not found>" ;
2014
+ llvm::StringRef command_name =
2015
+ cmd_obj ? cmd_obj->GetCommandName () : " <not found>" ;
2015
2016
LLDB_LOGF (log, " HandleCommand, cmd_obj : '%s'" , command_name.str ().c_str ());
2016
2017
LLDB_LOGF (log, " HandleCommand, (revised) command_string: '%s'" ,
2017
2018
command_string.c_str ());
@@ -2216,11 +2217,15 @@ CommandInterpreter::GetAlias(llvm::StringRef alias_name) const {
2216
2217
return nullptr ;
2217
2218
}
2218
2219
2219
- bool CommandInterpreter::HasCommands () const { return (!m_command_dict.empty ()); }
2220
+ bool CommandInterpreter::HasCommands () const {
2221
+ return (!m_command_dict.empty ());
2222
+ }
2220
2223
2221
2224
bool CommandInterpreter::HasAliases () const { return (!m_alias_dict.empty ()); }
2222
2225
2223
- bool CommandInterpreter::HasUserCommands () const { return (!m_user_dict.empty ()); }
2226
+ bool CommandInterpreter::HasUserCommands () const {
2227
+ return (!m_user_dict.empty ());
2228
+ }
2224
2229
2225
2230
bool CommandInterpreter::HasUserMultiwordCommands () const {
2226
2231
return (!m_user_mw_dict.empty ());
@@ -2578,20 +2583,18 @@ bool CommandInterpreter::DidProcessStopAbnormally() const {
2578
2583
return false ;
2579
2584
}
2580
2585
2581
- void
2582
- CommandInterpreter::HandleCommands (const StringList &commands,
2583
- const ExecutionContext &override_context,
2584
- const CommandInterpreterRunOptions &options,
2585
- CommandReturnObject &result) {
2586
+ void CommandInterpreter::HandleCommands (
2587
+ const StringList &commands, const ExecutionContext &override_context,
2588
+ const CommandInterpreterRunOptions &options, CommandReturnObject &result) {
2586
2589
2587
2590
OverrideExecutionContext (override_context);
2588
2591
HandleCommands (commands, options, result);
2589
2592
RestoreExecutionContext ();
2590
2593
}
2591
2594
2592
- void CommandInterpreter::HandleCommands (const StringList &commands,
2593
- const CommandInterpreterRunOptions &options,
2594
- CommandReturnObject &result) {
2595
+ void CommandInterpreter::HandleCommands (
2596
+ const StringList &commands, const CommandInterpreterRunOptions &options,
2597
+ CommandReturnObject &result) {
2595
2598
size_t num_lines = commands.GetSize ();
2596
2599
2597
2600
// If we are going to continue past a "continue" then we need to run the
@@ -2728,8 +2731,9 @@ void CommandInterpreter::HandleCommandsFromFile(
2728
2731
RestoreExecutionContext ();
2729
2732
}
2730
2733
2731
- void CommandInterpreter::HandleCommandsFromFile (FileSpec &cmd_file,
2732
- const CommandInterpreterRunOptions &options, CommandReturnObject &result) {
2734
+ void CommandInterpreter::HandleCommandsFromFile (
2735
+ FileSpec &cmd_file, const CommandInterpreterRunOptions &options,
2736
+ CommandReturnObject &result) {
2733
2737
if (!FileSystem::Instance ().Exists (cmd_file)) {
2734
2738
result.AppendErrorWithFormat (
2735
2739
" Error reading commands from file %s - file not found.\n " ,
@@ -3134,9 +3138,9 @@ bool CommandInterpreter::EchoCommandNonInteractive(
3134
3138
3135
3139
void CommandInterpreter::IOHandlerInputComplete (IOHandler &io_handler,
3136
3140
std::string &line) {
3137
- // If we were interrupted, bail out...
3138
- if (WasInterrupted ())
3139
- return ;
3141
+ // If we were interrupted, bail out...
3142
+ if (WasInterrupted ())
3143
+ return ;
3140
3144
3141
3145
const bool is_interactive = io_handler.GetIsInteractive ();
3142
3146
const bool allow_repeats =
0 commit comments