@@ -263,8 +263,8 @@ Status Debugger::SetPropertyValue(const ExecutionContext *exe_ctx,
263
263
264
264
bool Debugger::GetAutoConfirm () const {
265
265
const uint32_t idx = ePropertyAutoConfirm;
266
- return m_collection_sp->GetPropertyAtIndexAsBoolean (
267
- nullptr , idx, g_debugger_properties[idx].default_uint_value != 0 );
266
+ return m_collection_sp->GetPropertyAtIndexAsBoolean (nullptr , idx)
267
+ . value_or ( g_debugger_properties[idx].default_uint_value != 0 );
268
268
}
269
269
270
270
const FormatEntity::Entry *Debugger::GetDisassemblyFormat () const {
@@ -284,20 +284,20 @@ const FormatEntity::Entry *Debugger::GetFrameFormatUnique() const {
284
284
285
285
uint32_t Debugger::GetStopDisassemblyMaxSize () const {
286
286
const uint32_t idx = ePropertyStopDisassemblyMaxSize;
287
- return m_collection_sp->GetPropertyAtIndexAsUInt64 (
288
- nullptr , idx, g_debugger_properties[idx].default_uint_value );
287
+ return m_collection_sp->GetPropertyAtIndexAsUInt64 (nullptr , idx)
288
+ . value_or ( g_debugger_properties[idx].default_uint_value );
289
289
}
290
290
291
291
bool Debugger::GetNotifyVoid () const {
292
292
const uint32_t idx = ePropertyNotiftVoid;
293
- return m_collection_sp->GetPropertyAtIndexAsBoolean (
294
- nullptr , idx, g_debugger_properties[idx].default_uint_value != 0 );
293
+ return m_collection_sp->GetPropertyAtIndexAsBoolean (nullptr , idx)
294
+ . value_or ( g_debugger_properties[idx].default_uint_value != 0 );
295
295
}
296
296
297
297
llvm::StringRef Debugger::GetPrompt () const {
298
298
const uint32_t idx = ePropertyPrompt;
299
- return m_collection_sp->GetPropertyAtIndexAsString (
300
- nullptr , idx, g_debugger_properties[idx].default_cstr_value );
299
+ return m_collection_sp->GetPropertyAtIndexAsString (nullptr , idx)
300
+ . value_or ( g_debugger_properties[idx].default_cstr_value );
301
301
}
302
302
303
303
void Debugger::SetPrompt (llvm::StringRef p) {
@@ -323,8 +323,9 @@ const FormatEntity::Entry *Debugger::GetThreadStopFormat() const {
323
323
324
324
lldb::ScriptLanguage Debugger::GetScriptLanguage () const {
325
325
const uint32_t idx = ePropertyScriptLanguage;
326
- return (lldb::ScriptLanguage)m_collection_sp->GetPropertyAtIndexAsEnumeration (
327
- nullptr , idx, g_debugger_properties[idx].default_uint_value );
326
+ return (lldb::ScriptLanguage)m_collection_sp
327
+ ->GetPropertyAtIndexAsEnumeration (nullptr , idx)
328
+ .value_or (g_debugger_properties[idx].default_uint_value );
328
329
}
329
330
330
331
bool Debugger::SetScriptLanguage (lldb::ScriptLanguage script_lang) {
@@ -349,8 +350,8 @@ bool Debugger::SetREPLLanguage(lldb::LanguageType repl_lang) {
349
350
350
351
uint32_t Debugger::GetTerminalWidth () const {
351
352
const uint32_t idx = ePropertyTerminalWidth;
352
- return m_collection_sp->GetPropertyAtIndexAsSInt64 (
353
- nullptr , idx, g_debugger_properties[idx].default_uint_value );
353
+ return m_collection_sp->GetPropertyAtIndexAsSInt64 (nullptr , idx)
354
+ . value_or ( g_debugger_properties[idx].default_uint_value );
354
355
}
355
356
356
357
bool Debugger::SetTerminalWidth (uint32_t term_width) {
@@ -363,8 +364,8 @@ bool Debugger::SetTerminalWidth(uint32_t term_width) {
363
364
364
365
bool Debugger::GetUseExternalEditor () const {
365
366
const uint32_t idx = ePropertyUseExternalEditor;
366
- return m_collection_sp->GetPropertyAtIndexAsBoolean (
367
- nullptr , idx, g_debugger_properties[idx].default_uint_value != 0 );
367
+ return m_collection_sp->GetPropertyAtIndexAsBoolean (nullptr , idx)
368
+ . value_or ( g_debugger_properties[idx].default_uint_value != 0 );
368
369
}
369
370
370
371
bool Debugger::SetUseExternalEditor (bool b) {
@@ -374,7 +375,8 @@ bool Debugger::SetUseExternalEditor(bool b) {
374
375
375
376
llvm::StringRef Debugger::GetExternalEditor () const {
376
377
const uint32_t idx = ePropertyExternalEditor;
377
- return m_collection_sp->GetPropertyAtIndexAsString (nullptr , idx, " " );
378
+ return m_collection_sp->GetPropertyAtIndexAsString (nullptr , idx)
379
+ .value_or (g_debugger_properties[idx].default_cstr_value );
378
380
}
379
381
380
382
bool Debugger::SetExternalEditor (llvm::StringRef editor) {
@@ -384,8 +386,8 @@ bool Debugger::SetExternalEditor(llvm::StringRef editor) {
384
386
385
387
bool Debugger::GetUseColor () const {
386
388
const uint32_t idx = ePropertyUseColor;
387
- return m_collection_sp->GetPropertyAtIndexAsBoolean (
388
- nullptr , idx, g_debugger_properties[idx].default_uint_value != 0 );
389
+ return m_collection_sp->GetPropertyAtIndexAsBoolean (nullptr , idx)
390
+ . value_or ( g_debugger_properties[idx].default_uint_value != 0 );
389
391
}
390
392
391
393
bool Debugger::SetUseColor (bool b) {
@@ -397,8 +399,8 @@ bool Debugger::SetUseColor(bool b) {
397
399
398
400
bool Debugger::GetShowProgress () const {
399
401
const uint32_t idx = ePropertyShowProgress;
400
- return m_collection_sp->GetPropertyAtIndexAsBoolean (
401
- nullptr , idx, g_debugger_properties[idx].default_uint_value != 0 );
402
+ return m_collection_sp->GetPropertyAtIndexAsBoolean (nullptr , idx)
403
+ . value_or ( g_debugger_properties[idx].default_uint_value != 0 );
402
404
}
403
405
404
406
bool Debugger::SetShowProgress (bool show_progress) {
@@ -409,34 +411,38 @@ bool Debugger::SetShowProgress(bool show_progress) {
409
411
410
412
llvm::StringRef Debugger::GetShowProgressAnsiPrefix () const {
411
413
const uint32_t idx = ePropertyShowProgressAnsiPrefix;
412
- return m_collection_sp->GetPropertyAtIndexAsString (nullptr , idx, " " );
414
+ return m_collection_sp->GetPropertyAtIndexAsString (nullptr , idx)
415
+ .value_or (g_debugger_properties[idx].default_cstr_value );
413
416
}
414
417
415
418
llvm::StringRef Debugger::GetShowProgressAnsiSuffix () const {
416
419
const uint32_t idx = ePropertyShowProgressAnsiSuffix;
417
- return m_collection_sp->GetPropertyAtIndexAsString (nullptr , idx, " " );
420
+ return m_collection_sp->GetPropertyAtIndexAsString (nullptr , idx)
421
+ .value_or (g_debugger_properties[idx].default_cstr_value );
418
422
}
419
423
420
424
bool Debugger::GetUseAutosuggestion () const {
421
425
const uint32_t idx = ePropertyShowAutosuggestion;
422
- return m_collection_sp->GetPropertyAtIndexAsBoolean (
423
- nullptr , idx, g_debugger_properties[idx].default_uint_value != 0 );
426
+ return m_collection_sp->GetPropertyAtIndexAsBoolean (nullptr , idx)
427
+ . value_or ( g_debugger_properties[idx].default_uint_value != 0 );
424
428
}
425
429
426
430
llvm::StringRef Debugger::GetAutosuggestionAnsiPrefix () const {
427
431
const uint32_t idx = ePropertyShowAutosuggestionAnsiPrefix;
428
- return m_collection_sp->GetPropertyAtIndexAsString (nullptr , idx, " " );
432
+ return m_collection_sp->GetPropertyAtIndexAsString (nullptr , idx)
433
+ .value_or (g_debugger_properties[idx].default_cstr_value );
429
434
}
430
435
431
436
llvm::StringRef Debugger::GetAutosuggestionAnsiSuffix () const {
432
437
const uint32_t idx = ePropertyShowAutosuggestionAnsiSuffix;
433
- return m_collection_sp->GetPropertyAtIndexAsString (nullptr , idx, " " );
438
+ return m_collection_sp->GetPropertyAtIndexAsString (nullptr , idx)
439
+ .value_or (g_debugger_properties[idx].default_cstr_value );
434
440
}
435
441
436
442
bool Debugger::GetUseSourceCache () const {
437
443
const uint32_t idx = ePropertyUseSourceCache;
438
- return m_collection_sp->GetPropertyAtIndexAsBoolean (
439
- nullptr , idx, g_debugger_properties[idx].default_uint_value != 0 );
444
+ return m_collection_sp->GetPropertyAtIndexAsBoolean (nullptr , idx)
445
+ . value_or ( g_debugger_properties[idx].default_uint_value != 0 );
440
446
}
441
447
442
448
bool Debugger::SetUseSourceCache (bool b) {
@@ -449,69 +455,77 @@ bool Debugger::SetUseSourceCache(bool b) {
449
455
}
450
456
bool Debugger::GetHighlightSource () const {
451
457
const uint32_t idx = ePropertyHighlightSource;
452
- return m_collection_sp->GetPropertyAtIndexAsBoolean (
453
- nullptr , idx, g_debugger_properties[idx].default_uint_value );
458
+ return m_collection_sp->GetPropertyAtIndexAsBoolean (nullptr , idx)
459
+ . value_or ( g_debugger_properties[idx].default_uint_value );
454
460
}
455
461
456
462
StopShowColumn Debugger::GetStopShowColumn () const {
457
463
const uint32_t idx = ePropertyStopShowColumn;
458
- return (lldb::StopShowColumn)m_collection_sp->GetPropertyAtIndexAsEnumeration (
459
- nullptr , idx, g_debugger_properties[idx].default_uint_value );
464
+ return (lldb::StopShowColumn)m_collection_sp
465
+ ->GetPropertyAtIndexAsEnumeration (nullptr , idx)
466
+ .value_or (g_debugger_properties[idx].default_uint_value );
460
467
}
461
468
462
469
llvm::StringRef Debugger::GetStopShowColumnAnsiPrefix () const {
463
470
const uint32_t idx = ePropertyStopShowColumnAnsiPrefix;
464
- return m_collection_sp->GetPropertyAtIndexAsString (nullptr , idx, " " );
471
+ return m_collection_sp->GetPropertyAtIndexAsString (nullptr , idx)
472
+ .value_or (g_debugger_properties[idx].default_cstr_value );
465
473
}
466
474
467
475
llvm::StringRef Debugger::GetStopShowColumnAnsiSuffix () const {
468
476
const uint32_t idx = ePropertyStopShowColumnAnsiSuffix;
469
- return m_collection_sp->GetPropertyAtIndexAsString (nullptr , idx, " " );
477
+ return m_collection_sp->GetPropertyAtIndexAsString (nullptr , idx)
478
+ .value_or (g_debugger_properties[idx].default_cstr_value );
470
479
}
471
480
472
481
llvm::StringRef Debugger::GetStopShowLineMarkerAnsiPrefix () const {
473
482
const uint32_t idx = ePropertyStopShowLineMarkerAnsiPrefix;
474
- return m_collection_sp->GetPropertyAtIndexAsString (nullptr , idx, " " );
483
+ return m_collection_sp->GetPropertyAtIndexAsString (nullptr , idx)
484
+ .value_or (g_debugger_properties[idx].default_cstr_value );
475
485
}
476
486
477
487
llvm::StringRef Debugger::GetStopShowLineMarkerAnsiSuffix () const {
478
488
const uint32_t idx = ePropertyStopShowLineMarkerAnsiSuffix;
479
- return m_collection_sp->GetPropertyAtIndexAsString (nullptr , idx, " " );
489
+ return m_collection_sp->GetPropertyAtIndexAsString (nullptr , idx)
490
+ .value_or (g_debugger_properties[idx].default_cstr_value );
480
491
}
481
492
482
493
uint32_t Debugger::GetStopSourceLineCount (bool before) const {
483
494
const uint32_t idx =
484
495
before ? ePropertyStopLineCountBefore : ePropertyStopLineCountAfter;
485
- return m_collection_sp->GetPropertyAtIndexAsSInt64 (
486
- nullptr , idx, g_debugger_properties[idx].default_uint_value );
496
+ return m_collection_sp->GetPropertyAtIndexAsSInt64 (nullptr , idx)
497
+ . value_or ( g_debugger_properties[idx].default_uint_value );
487
498
}
488
499
489
500
Debugger::StopDisassemblyType Debugger::GetStopDisassemblyDisplay () const {
490
501
const uint32_t idx = ePropertyStopDisassemblyDisplay;
491
- return (Debugger ::StopDisassemblyType)
492
- m_collection_sp ->GetPropertyAtIndexAsEnumeration (
493
- nullptr , idx, g_debugger_properties[idx].default_uint_value );
502
+ return (Debugger ::StopDisassemblyType)m_collection_sp
503
+ ->GetPropertyAtIndexAsEnumeration (nullptr , idx)
504
+ . value_or ( g_debugger_properties[idx].default_uint_value );
494
505
}
495
506
496
507
uint32_t Debugger::GetDisassemblyLineCount () const {
497
508
const uint32_t idx = ePropertyStopDisassemblyCount;
498
- return m_collection_sp->GetPropertyAtIndexAsSInt64 (
499
- nullptr , idx, g_debugger_properties[idx].default_uint_value );
509
+ return m_collection_sp->GetPropertyAtIndexAsSInt64 (nullptr , idx)
510
+ . value_or ( g_debugger_properties[idx].default_uint_value );
500
511
}
501
512
502
513
bool Debugger::GetAutoOneLineSummaries () const {
503
514
const uint32_t idx = ePropertyAutoOneLineSummaries;
504
- return m_collection_sp->GetPropertyAtIndexAsBoolean (nullptr , idx, true );
515
+ return m_collection_sp->GetPropertyAtIndexAsBoolean (nullptr , idx)
516
+ .value_or (g_debugger_properties[idx].default_uint_value != 0 );
505
517
}
506
518
507
519
bool Debugger::GetEscapeNonPrintables () const {
508
520
const uint32_t idx = ePropertyEscapeNonPrintables;
509
- return m_collection_sp->GetPropertyAtIndexAsBoolean (nullptr , idx, true );
521
+ return m_collection_sp->GetPropertyAtIndexAsBoolean (nullptr , idx)
522
+ .value_or (g_debugger_properties[idx].default_uint_value != 0 );
510
523
}
511
524
512
525
bool Debugger::GetAutoIndent () const {
513
526
const uint32_t idx = ePropertyAutoIndent;
514
- return m_collection_sp->GetPropertyAtIndexAsBoolean (nullptr , idx, true );
527
+ return m_collection_sp->GetPropertyAtIndexAsBoolean (nullptr , idx)
528
+ .value_or (g_debugger_properties[idx].default_uint_value != 0 );
515
529
}
516
530
517
531
bool Debugger::SetAutoIndent (bool b) {
@@ -521,7 +535,8 @@ bool Debugger::SetAutoIndent(bool b) {
521
535
522
536
bool Debugger::GetPrintDecls () const {
523
537
const uint32_t idx = ePropertyPrintDecls;
524
- return m_collection_sp->GetPropertyAtIndexAsBoolean (nullptr , idx, true );
538
+ return m_collection_sp->GetPropertyAtIndexAsBoolean (nullptr , idx)
539
+ .value_or (g_debugger_properties[idx].default_uint_value != 0 );
525
540
}
526
541
527
542
bool Debugger::SetPrintDecls (bool b) {
@@ -531,8 +546,8 @@ bool Debugger::SetPrintDecls(bool b) {
531
546
532
547
uint32_t Debugger::GetTabSize () const {
533
548
const uint32_t idx = ePropertyTabSize;
534
- return m_collection_sp->GetPropertyAtIndexAsUInt64 (
535
- nullptr , idx, g_debugger_properties[idx].default_uint_value );
549
+ return m_collection_sp->GetPropertyAtIndexAsUInt64 (nullptr , idx)
550
+ . value_or ( g_debugger_properties[idx].default_uint_value );
536
551
}
537
552
538
553
bool Debugger::SetTabSize (uint32_t tab_size) {
@@ -542,9 +557,9 @@ bool Debugger::SetTabSize(uint32_t tab_size) {
542
557
543
558
lldb::DWIMPrintVerbosity Debugger::GetDWIMPrintVerbosity () const {
544
559
const uint32_t idx = ePropertyDWIMPrintVerbosity;
545
- return (lldb::DWIMPrintVerbosity)
546
- m_collection_sp ->GetPropertyAtIndexAsEnumeration (
547
- nullptr , idx, g_debugger_properties[idx].default_uint_value );
560
+ return (lldb::DWIMPrintVerbosity)m_collection_sp
561
+ ->GetPropertyAtIndexAsEnumeration (nullptr , idx)
562
+ . value_or ( g_debugger_properties[idx].default_uint_value );
548
563
}
549
564
550
565
#pragma mark Debugger
0 commit comments