@@ -89,14 +89,16 @@ class lldb_private::BreakpointOptionGroup : public OptionGroup {
89
89
if (success)
90
90
m_bp_opts.SetAutoContinue (value);
91
91
else
92
- error = CreateOptionParsingError (option_arg, short_option, long_option,
93
- g_bool_parsing_error_message);
92
+ error = Status::FromError (
93
+ CreateOptionParsingError (option_arg, short_option, long_option,
94
+ g_bool_parsing_error_message));
94
95
} break ;
95
96
case ' i' : {
96
97
uint32_t ignore_count;
97
98
if (option_arg.getAsInteger (0 , ignore_count))
98
- error = CreateOptionParsingError (option_arg, short_option, long_option,
99
- g_int_parsing_error_message);
99
+ error = Status::FromError (
100
+ CreateOptionParsingError (option_arg, short_option, long_option,
101
+ g_int_parsing_error_message));
100
102
else
101
103
m_bp_opts.SetIgnoreCount (ignore_count);
102
104
} break ;
@@ -106,29 +108,31 @@ class lldb_private::BreakpointOptionGroup : public OptionGroup {
106
108
if (success) {
107
109
m_bp_opts.SetOneShot (value);
108
110
} else
109
- error = CreateOptionParsingError (option_arg, short_option, long_option,
110
- g_bool_parsing_error_message);
111
+ error = Status::FromError (
112
+ CreateOptionParsingError (option_arg, short_option, long_option,
113
+ g_bool_parsing_error_message));
111
114
} break ;
112
115
case ' t' : {
113
116
lldb::tid_t thread_id = LLDB_INVALID_THREAD_ID;
114
117
if (option_arg == " current" ) {
115
118
if (!execution_context) {
116
- error = CreateOptionParsingError (
119
+ error = Status::FromError ( CreateOptionParsingError (
117
120
option_arg, short_option, long_option,
118
- " No context to determine current thread" );
121
+ " No context to determine current thread" )) ;
119
122
} else {
120
123
ThreadSP ctx_thread_sp = execution_context->GetThreadSP ();
121
124
if (!ctx_thread_sp || !ctx_thread_sp->IsValid ()) {
122
- error =
125
+ error = Status::FromError (
123
126
CreateOptionParsingError (option_arg, short_option, long_option,
124
- " No currently selected thread" );
127
+ " No currently selected thread" )) ;
125
128
} else {
126
129
thread_id = ctx_thread_sp->GetID ();
127
130
}
128
131
}
129
132
} else if (option_arg.getAsInteger (0 , thread_id)) {
130
- error = CreateOptionParsingError (option_arg, short_option, long_option,
131
- g_int_parsing_error_message);
133
+ error = Status::FromError (
134
+ CreateOptionParsingError (option_arg, short_option, long_option,
135
+ g_int_parsing_error_message));
132
136
}
133
137
if (thread_id != LLDB_INVALID_THREAD_ID)
134
138
m_bp_opts.SetThreadID (thread_id);
@@ -142,8 +146,9 @@ class lldb_private::BreakpointOptionGroup : public OptionGroup {
142
146
case ' x' : {
143
147
uint32_t thread_index = UINT32_MAX;
144
148
if (option_arg.getAsInteger (0 , thread_index)) {
145
- error = CreateOptionParsingError (option_arg, short_option, long_option,
146
- g_int_parsing_error_message);
149
+ error = Status::FromError (
150
+ CreateOptionParsingError (option_arg, short_option, long_option,
151
+ g_int_parsing_error_message));
147
152
} else {
148
153
m_bp_opts.GetThreadSpec ()->SetIndex (thread_index);
149
154
}
@@ -286,9 +291,9 @@ class CommandObjectBreakpointSet : public CommandObjectParsed {
286
291
287
292
case ' u' :
288
293
if (option_arg.getAsInteger (0 , m_column))
289
- error =
294
+ error = Status::FromError (
290
295
CreateOptionParsingError (option_arg, short_option, long_option,
291
- g_int_parsing_error_message);
296
+ g_int_parsing_error_message)) ;
292
297
break ;
293
298
294
299
case ' E' : {
@@ -331,8 +336,8 @@ class CommandObjectBreakpointSet : public CommandObjectParsed {
331
336
error_context = " Unsupported language type for exception breakpoint" ;
332
337
}
333
338
if (!error_context.empty ())
334
- error = CreateOptionParsingError (option_arg, short_option,
335
- long_option, error_context);
339
+ error = Status::FromError ( CreateOptionParsingError (
340
+ option_arg, short_option, long_option, error_context) );
336
341
} break ;
337
342
338
343
case ' f' :
@@ -348,9 +353,9 @@ class CommandObjectBreakpointSet : public CommandObjectParsed {
348
353
bool success;
349
354
m_catch_bp = OptionArgParser::ToBoolean (option_arg, true , &success);
350
355
if (!success)
351
- error =
356
+ error = Status::FromError (
352
357
CreateOptionParsingError (option_arg, short_option, long_option,
353
- g_bool_parsing_error_message);
358
+ g_bool_parsing_error_message)) ;
354
359
} break ;
355
360
356
361
case ' H' :
@@ -367,24 +372,24 @@ class CommandObjectBreakpointSet : public CommandObjectParsed {
367
372
m_skip_prologue = eLazyBoolNo;
368
373
369
374
if (!success)
370
- error =
375
+ error = Status::FromError (
371
376
CreateOptionParsingError (option_arg, short_option, long_option,
372
- g_bool_parsing_error_message);
377
+ g_bool_parsing_error_message)) ;
373
378
} break ;
374
379
375
380
case ' l' :
376
381
if (option_arg.getAsInteger (0 , m_line_num))
377
- error =
382
+ error = Status::FromError (
378
383
CreateOptionParsingError (option_arg, short_option, long_option,
379
- g_int_parsing_error_message);
384
+ g_int_parsing_error_message)) ;
380
385
break ;
381
386
382
387
case ' L' :
383
388
m_language = Language::GetLanguageTypeFromString (option_arg);
384
389
if (m_language == eLanguageTypeUnknown)
385
- error =
390
+ error = Status::FromError (
386
391
CreateOptionParsingError (option_arg, short_option, long_option,
387
- g_language_parsing_error_message);
392
+ g_language_parsing_error_message)) ;
388
393
break ;
389
394
390
395
case ' m' : {
@@ -397,9 +402,9 @@ class CommandObjectBreakpointSet : public CommandObjectParsed {
397
402
m_move_to_nearest_code = eLazyBoolNo;
398
403
399
404
if (!success)
400
- error =
405
+ error = Status::FromError (
401
406
CreateOptionParsingError (option_arg, short_option, long_option,
402
- g_bool_parsing_error_message);
407
+ g_bool_parsing_error_message)) ;
403
408
break ;
404
409
}
405
410
@@ -417,8 +422,9 @@ class CommandObjectBreakpointSet : public CommandObjectParsed {
417
422
if (BreakpointID::StringIsBreakpointName (option_arg, error))
418
423
m_breakpoint_names.push_back (std::string (option_arg));
419
424
else
420
- error = CreateOptionParsingError (
421
- option_arg, short_option, long_option, " Invalid breakpoint name" );
425
+ error = Status::FromError (
426
+ CreateOptionParsingError (option_arg, short_option, long_option,
427
+ " Invalid breakpoint name" ));
422
428
break ;
423
429
}
424
430
@@ -456,9 +462,9 @@ class CommandObjectBreakpointSet : public CommandObjectParsed {
456
462
bool success;
457
463
m_throw_bp = OptionArgParser::ToBoolean (option_arg, true , &success);
458
464
if (!success)
459
- error =
465
+ error = Status::FromError (
460
466
CreateOptionParsingError (option_arg, short_option, long_option,
461
- g_bool_parsing_error_message);
467
+ g_bool_parsing_error_message)) ;
462
468
} break ;
463
469
464
470
case ' X' :
@@ -470,8 +476,8 @@ class CommandObjectBreakpointSet : public CommandObjectParsed {
470
476
OptionValueFileColonLine value;
471
477
Status fcl_err = value.SetValueFromString (option_arg);
472
478
if (!fcl_err.Success ()) {
473
- error = CreateOptionParsingError (option_arg, short_option,
474
- long_option, fcl_err.AsCString ());
479
+ error = Status::FromError ( CreateOptionParsingError (
480
+ option_arg, short_option, long_option, fcl_err.AsCString () ));
475
481
} else {
476
482
m_filenames.AppendIfUnique (value.GetFileSpec ());
477
483
m_line_num = value.GetLineNumber ();
@@ -1552,13 +1558,15 @@ class BreakpointNameOptionGroup : public OptionGroup {
1552
1558
break ;
1553
1559
case ' B' :
1554
1560
if (m_breakpoint.SetValueFromString (option_arg).Fail ())
1555
- error = CreateOptionParsingError (option_arg, short_option, long_option,
1556
- g_int_parsing_error_message);
1561
+ error = Status::FromError (
1562
+ CreateOptionParsingError (option_arg, short_option, long_option,
1563
+ g_int_parsing_error_message));
1557
1564
break ;
1558
1565
case ' D' :
1559
1566
if (m_use_dummy.SetValueFromString (option_arg).Fail ())
1560
- error = CreateOptionParsingError (option_arg, short_option, long_option,
1561
- g_bool_parsing_error_message);
1567
+ error = Status::FromError (
1568
+ CreateOptionParsingError (option_arg, short_option, long_option,
1569
+ g_bool_parsing_error_message));
1562
1570
break ;
1563
1571
case ' H' :
1564
1572
m_help_string.SetValueFromString (option_arg);
@@ -1611,26 +1619,29 @@ class BreakpointAccessOptionGroup : public OptionGroup {
1611
1619
if (success) {
1612
1620
m_permissions.SetAllowList (value);
1613
1621
} else
1614
- error = CreateOptionParsingError (option_arg, short_option, long_option,
1615
- g_bool_parsing_error_message);
1622
+ error = Status::FromError (
1623
+ CreateOptionParsingError (option_arg, short_option, long_option,
1624
+ g_bool_parsing_error_message));
1616
1625
} break ;
1617
1626
case ' A' : {
1618
1627
bool value, success;
1619
1628
value = OptionArgParser::ToBoolean (option_arg, false , &success);
1620
1629
if (success) {
1621
1630
m_permissions.SetAllowDisable (value);
1622
1631
} else
1623
- error = CreateOptionParsingError (option_arg, short_option, long_option,
1624
- g_bool_parsing_error_message);
1632
+ error = Status::FromError (
1633
+ CreateOptionParsingError (option_arg, short_option, long_option,
1634
+ g_bool_parsing_error_message));
1625
1635
} break ;
1626
1636
case ' D' : {
1627
1637
bool value, success;
1628
1638
value = OptionArgParser::ToBoolean (option_arg, false , &success);
1629
1639
if (success) {
1630
1640
m_permissions.SetAllowDelete (value);
1631
1641
} else
1632
- error = CreateOptionParsingError (option_arg, short_option, long_option,
1633
- g_bool_parsing_error_message);
1642
+ error = Status::FromError (
1643
+ CreateOptionParsingError (option_arg, short_option, long_option,
1644
+ g_bool_parsing_error_message));
1634
1645
} break ;
1635
1646
default :
1636
1647
llvm_unreachable (" Unimplemented option" );
@@ -2114,8 +2125,8 @@ class CommandObjectBreakpointRead : public CommandObjectParsed {
2114
2125
Status name_error;
2115
2126
if (!BreakpointID::StringIsBreakpointName (llvm::StringRef (option_arg),
2116
2127
name_error)) {
2117
- error = CreateOptionParsingError (option_arg, short_option,
2118
- long_option, name_error.AsCString ());
2128
+ error = Status::FromError ( CreateOptionParsingError (
2129
+ option_arg, short_option, long_option, name_error.AsCString () ));
2119
2130
}
2120
2131
m_names.push_back (std::string (option_arg));
2121
2132
break ;
0 commit comments