@@ -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' : {
@@ -326,8 +331,8 @@ class CommandObjectBreakpointSet : public CommandObjectParsed {
326
331
error_context = " Unsupported language type for exception breakpoint" ;
327
332
}
328
333
if (!error_context.empty ())
329
- error = CreateOptionParsingError (option_arg, short_option,
330
- long_option, error_context);
334
+ error = Status::FromError ( CreateOptionParsingError (
335
+ option_arg, short_option, long_option, error_context) );
331
336
} break ;
332
337
333
338
case ' f' :
@@ -343,9 +348,9 @@ class CommandObjectBreakpointSet : public CommandObjectParsed {
343
348
bool success;
344
349
m_catch_bp = OptionArgParser::ToBoolean (option_arg, true , &success);
345
350
if (!success)
346
- error =
351
+ error = Status::FromError (
347
352
CreateOptionParsingError (option_arg, short_option, long_option,
348
- g_bool_parsing_error_message);
353
+ g_bool_parsing_error_message)) ;
349
354
} break ;
350
355
351
356
case ' H' :
@@ -362,24 +367,24 @@ class CommandObjectBreakpointSet : public CommandObjectParsed {
362
367
m_skip_prologue = eLazyBoolNo;
363
368
364
369
if (!success)
365
- error =
370
+ error = Status::FromError (
366
371
CreateOptionParsingError (option_arg, short_option, long_option,
367
- g_bool_parsing_error_message);
372
+ g_bool_parsing_error_message)) ;
368
373
} break ;
369
374
370
375
case ' l' :
371
376
if (option_arg.getAsInteger (0 , m_line_num))
372
- error =
377
+ error = Status::FromError (
373
378
CreateOptionParsingError (option_arg, short_option, long_option,
374
- g_int_parsing_error_message);
379
+ g_int_parsing_error_message)) ;
375
380
break ;
376
381
377
382
case ' L' :
378
383
m_language = Language::GetLanguageTypeFromString (option_arg);
379
384
if (m_language == eLanguageTypeUnknown)
380
- error =
385
+ error = Status::FromError (
381
386
CreateOptionParsingError (option_arg, short_option, long_option,
382
- g_language_parsing_error_message);
387
+ g_language_parsing_error_message)) ;
383
388
break ;
384
389
385
390
case ' m' : {
@@ -392,9 +397,9 @@ class CommandObjectBreakpointSet : public CommandObjectParsed {
392
397
m_move_to_nearest_code = eLazyBoolNo;
393
398
394
399
if (!success)
395
- error =
400
+ error = Status::FromError (
396
401
CreateOptionParsingError (option_arg, short_option, long_option,
397
- g_bool_parsing_error_message);
402
+ g_bool_parsing_error_message)) ;
398
403
break ;
399
404
}
400
405
@@ -412,8 +417,9 @@ class CommandObjectBreakpointSet : public CommandObjectParsed {
412
417
if (BreakpointID::StringIsBreakpointName (option_arg, error))
413
418
m_breakpoint_names.push_back (std::string (option_arg));
414
419
else
415
- error = CreateOptionParsingError (
416
- option_arg, short_option, long_option, " Invalid breakpoint name" );
420
+ error = Status::FromError (
421
+ CreateOptionParsingError (option_arg, short_option, long_option,
422
+ " Invalid breakpoint name" ));
417
423
break ;
418
424
}
419
425
@@ -451,9 +457,9 @@ class CommandObjectBreakpointSet : public CommandObjectParsed {
451
457
bool success;
452
458
m_throw_bp = OptionArgParser::ToBoolean (option_arg, true , &success);
453
459
if (!success)
454
- error =
460
+ error = Status::FromError (
455
461
CreateOptionParsingError (option_arg, short_option, long_option,
456
- g_bool_parsing_error_message);
462
+ g_bool_parsing_error_message)) ;
457
463
} break ;
458
464
459
465
case ' X' :
@@ -465,8 +471,8 @@ class CommandObjectBreakpointSet : public CommandObjectParsed {
465
471
OptionValueFileColonLine value;
466
472
Status fcl_err = value.SetValueFromString (option_arg);
467
473
if (!fcl_err.Success ()) {
468
- error = CreateOptionParsingError (option_arg, short_option,
469
- long_option, fcl_err.AsCString ());
474
+ error = Status::FromError ( CreateOptionParsingError (
475
+ option_arg, short_option, long_option, fcl_err.AsCString () ));
470
476
} else {
471
477
m_filenames.AppendIfUnique (value.GetFileSpec ());
472
478
m_line_num = value.GetLineNumber ();
@@ -1551,13 +1557,15 @@ class BreakpointNameOptionGroup : public OptionGroup {
1551
1557
break ;
1552
1558
case ' B' :
1553
1559
if (m_breakpoint.SetValueFromString (option_arg).Fail ())
1554
- error = CreateOptionParsingError (option_arg, short_option, long_option,
1555
- g_int_parsing_error_message);
1560
+ error = Status::FromError (
1561
+ CreateOptionParsingError (option_arg, short_option, long_option,
1562
+ g_int_parsing_error_message));
1556
1563
break ;
1557
1564
case ' D' :
1558
1565
if (m_use_dummy.SetValueFromString (option_arg).Fail ())
1559
- error = CreateOptionParsingError (option_arg, short_option, long_option,
1560
- g_bool_parsing_error_message);
1566
+ error = Status::FromError (
1567
+ CreateOptionParsingError (option_arg, short_option, long_option,
1568
+ g_bool_parsing_error_message));
1561
1569
break ;
1562
1570
case ' H' :
1563
1571
m_help_string.SetValueFromString (option_arg);
@@ -1610,26 +1618,29 @@ class BreakpointAccessOptionGroup : public OptionGroup {
1610
1618
if (success) {
1611
1619
m_permissions.SetAllowList (value);
1612
1620
} else
1613
- error = CreateOptionParsingError (option_arg, short_option, long_option,
1614
- g_bool_parsing_error_message);
1621
+ error = Status::FromError (
1622
+ CreateOptionParsingError (option_arg, short_option, long_option,
1623
+ g_bool_parsing_error_message));
1615
1624
} break ;
1616
1625
case ' A' : {
1617
1626
bool value, success;
1618
1627
value = OptionArgParser::ToBoolean (option_arg, false , &success);
1619
1628
if (success) {
1620
1629
m_permissions.SetAllowDisable (value);
1621
1630
} else
1622
- error = CreateOptionParsingError (option_arg, short_option, long_option,
1623
- g_bool_parsing_error_message);
1631
+ error = Status::FromError (
1632
+ CreateOptionParsingError (option_arg, short_option, long_option,
1633
+ g_bool_parsing_error_message));
1624
1634
} break ;
1625
1635
case ' D' : {
1626
1636
bool value, success;
1627
1637
value = OptionArgParser::ToBoolean (option_arg, false , &success);
1628
1638
if (success) {
1629
1639
m_permissions.SetAllowDelete (value);
1630
1640
} else
1631
- error = CreateOptionParsingError (option_arg, short_option, long_option,
1632
- g_bool_parsing_error_message);
1641
+ error = Status::FromError (
1642
+ CreateOptionParsingError (option_arg, short_option, long_option,
1643
+ g_bool_parsing_error_message));
1633
1644
} break ;
1634
1645
default :
1635
1646
llvm_unreachable (" Unimplemented option" );
@@ -2113,8 +2124,8 @@ class CommandObjectBreakpointRead : public CommandObjectParsed {
2113
2124
Status name_error;
2114
2125
if (!BreakpointID::StringIsBreakpointName (llvm::StringRef (option_arg),
2115
2126
name_error)) {
2116
- error = CreateOptionParsingError (option_arg, short_option,
2117
- long_option, name_error.AsCString ());
2127
+ error = Status::FromError ( CreateOptionParsingError (
2128
+ option_arg, short_option, long_option, name_error.AsCString () ));
2118
2129
}
2119
2130
m_names.push_back (std::string (option_arg));
2120
2131
break ;
0 commit comments