lldb-sys 0.0.31

Raw bindings to the LLDB C++ API. LLDB is the debugger that is part of the LLVM project and is the default system debugger on Mac OS X. Building and using this is currently slightly tricky, so be sure to see the README.md in the repository.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
//===-- SBDebuggerBinding.cpp -----------------------------------*- C++ -*-===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#include "lldb/API/LLDB.h"
#include "lldb/API/SBTypeCategory.h"
#include "lldb/API/SBTypeFilter.h"
#include "lldb/API/SBTypeFormat.h"
#include "lldb/API/SBTypeNameSpecifier.h"
#include "lldb/API/SBTypeSummary.h"
#include "lldb/API/SBTypeSynthetic.h"
#include "lldb/Bindings/LLDBBinding.h"

using namespace lldb;

#ifdef __cplusplus
extern "C" {
#endif

SBInputReaderRef CreateSBInputReader() {
  return reinterpret_cast<SBInputReaderRef>(new SBInputReader());
}

SBInputReaderRef CloneSBInputReader(SBInputReaderRef instance) {
  return reinterpret_cast<SBInputReaderRef>(
      new SBInputReader(*reinterpret_cast<SBInputReader *>(instance)));
}

void DisposeSBInputReader(SBInputReaderRef instance) {
  delete reinterpret_cast<SBInputReader *>(instance);
}

SBErrorRef SBInputReaderInitialize(SBInputReaderRef instance,
                                   SBDebuggerRef var0, Callback callback,
                                   void *callback_baton,
                                   lldb::InputReaderGranularity var1,
                                   const char *var2, const char *var3,
                                   bool var4) {
  SBInputReader *unwrapped = reinterpret_cast<SBInputReader *>(instance);
  return reinterpret_cast<SBErrorRef>(new SBError(
      unwrapped->Initialize(*reinterpret_cast<SBDebugger *>(var0), callback,
                            callback_baton, var1, var2, var3, var4)));
}

void SBInputReaderSetIsDone(SBInputReaderRef instance, bool var0) {
  SBInputReader *unwrapped = reinterpret_cast<SBInputReader *>(instance);
  unwrapped->SetIsDone(var0);
}

bool SBInputReaderIsActive(SBInputReaderRef instance) {
  SBInputReader *unwrapped = reinterpret_cast<SBInputReader *>(instance);
  return unwrapped->IsActive();
}

const char *SBDebuggerGetBroadcasterClass() {
  return lldb::SBProcess::GetBroadcasterClass();
}

SBBroadcasterRef SBDebuggerGetBroadcaster(SBDebuggerRef instance) {
  SBDebugger *unwrapped = reinterpret_cast<SBDebugger *>(instance);
  return reinterpret_cast<SBBroadcasterRef>(
      new SBBroadcaster(unwrapped->GetBroadcaster()));
}

const char *SBDebuggerGetProgressFromEvent(SBEventRef event,
                                           uint64_t *progress_id,
                                           uint64_t *completed, uint64_t *total,
                                           bool *is_debugger_specific) {
  return SBDebugger::GetProgressFromEvent(*reinterpret_cast<SBEvent *>(event),
                                          *progress_id, *completed, *total,
                                          *is_debugger_specific);
}

void SBDebuggerInitialize() { lldb::SBDebugger::Initialize(); }

void SBDebuggerTerminate() { lldb::SBDebugger::Terminate(); }

SBDebuggerRef SBDebuggerCreate() {
  return reinterpret_cast<SBDebuggerRef>(
      new SBDebugger(lldb::SBDebugger::Create()));
}

SBDebuggerRef SBDebuggerCreate2(bool source_init_files) {
  return reinterpret_cast<SBDebuggerRef>(
      new SBDebugger(lldb::SBDebugger::Create(source_init_files)));
}

SBDebuggerRef SBDebuggerCreate3(bool source_init_files,
                                LogOutputCallback log_callback, void *baton) {
  return reinterpret_cast<SBDebuggerRef>(new SBDebugger(
      lldb::SBDebugger::Create(source_init_files, log_callback, baton)));
}

void SBDebuggerDestroy(SBDebuggerRef debugger) {
  lldb::SBDebugger::Destroy(*reinterpret_cast<SBDebugger *>(debugger));
}

void SBDebuggerMemoryPressureDetected() {
  lldb::SBDebugger::MemoryPressureDetected();
}

SBDebuggerRef CreateSBDebugger() {
  return reinterpret_cast<SBDebuggerRef>(new SBDebugger());
}

SBDebuggerRef CloneSBDebugger(SBDebuggerRef instance) {
  return reinterpret_cast<SBDebuggerRef>(
      new SBDebugger(*reinterpret_cast<SBDebugger *>(instance)));
}

void DisposeSBDebugger(SBDebuggerRef instance) {
  delete reinterpret_cast<SBDebugger *>(instance);
}

bool SBDebuggerIsValid(SBDebuggerRef instance) {
  SBDebugger *unwrapped = reinterpret_cast<SBDebugger *>(instance);
  return unwrapped->IsValid();
}

void SBDebuggerClear(SBDebuggerRef instance) {
  SBDebugger *unwrapped = reinterpret_cast<SBDebugger *>(instance);
  unwrapped->Clear();
}

void SBDebuggerSetAsync(SBDebuggerRef instance, bool b) {
  SBDebugger *unwrapped = reinterpret_cast<SBDebugger *>(instance);
  unwrapped->SetAsync(b);
}

bool SBDebuggerGetAsync(SBDebuggerRef instance) {
  SBDebugger *unwrapped = reinterpret_cast<SBDebugger *>(instance);
  return unwrapped->GetAsync();
}

void SBDebuggerSkipLLDBInitFiles(SBDebuggerRef instance, bool b) {
  SBDebugger *unwrapped = reinterpret_cast<SBDebugger *>(instance);
  unwrapped->SkipLLDBInitFiles(b);
}

void SBDebuggerSkipAppInitFiles(SBDebuggerRef instance, bool b) {
  SBDebugger *unwrapped = reinterpret_cast<SBDebugger *>(instance);
  unwrapped->SkipAppInitFiles(b);
}

SBErrorRef SBDebuggerSetInputString(SBDebuggerRef instance, const char *data) {
  SBDebugger *unwrapped = reinterpret_cast<SBDebugger *>(instance);
  return reinterpret_cast<SBErrorRef>(
      new SBError(unwrapped->SetInputString(data)));
}

SBErrorRef SBDebuggerSetInputFile(SBDebuggerRef instance, SBFileRef file) {
  SBDebugger *unwrapped = reinterpret_cast<SBDebugger *>(instance);
  return reinterpret_cast<SBErrorRef>(
      new SBError(unwrapped->SetInputFile(*reinterpret_cast<SBFile *>(file))));
}

SBErrorRef SBDebuggerSetOutputFile(SBDebuggerRef instance, SBFileRef file) {
  SBDebugger *unwrapped = reinterpret_cast<SBDebugger *>(instance);
  return reinterpret_cast<SBErrorRef>(
      new SBError(unwrapped->SetOutputFile(*reinterpret_cast<SBFile *>(file))));
}

SBErrorRef SBDebuggerSetErrorFile(SBDebuggerRef instance, SBFileRef file) {
  SBDebugger *unwrapped = reinterpret_cast<SBDebugger *>(instance);
  return reinterpret_cast<SBErrorRef>(
      new SBError(unwrapped->SetErrorFile(*reinterpret_cast<SBFile *>(file))));
}

SBFileRef SBDebuggerGetInputFile(SBDebuggerRef instance) {
  SBDebugger *unwrapped = reinterpret_cast<SBDebugger *>(instance);
  return reinterpret_cast<SBFileRef>(new SBFile(unwrapped->GetInputFile()));
}

SBFileRef SBDebuggerGetOutputFile(SBDebuggerRef instance) {
  SBDebugger *unwrapped = reinterpret_cast<SBDebugger *>(instance);
  return reinterpret_cast<SBFileRef>(new SBFile(unwrapped->GetOutputFile()));
}

SBFileRef SBDebuggerGetErrorFile(SBDebuggerRef instance) {
  SBDebugger *unwrapped = reinterpret_cast<SBDebugger *>(instance);
  return reinterpret_cast<SBFileRef>(new SBFile(unwrapped->GetErrorFile()));
}

void SBDebuggerSaveInputTerminalState(SBDebuggerRef instance) {
  SBDebugger *unwrapped = reinterpret_cast<SBDebugger *>(instance);
  unwrapped->SaveInputTerminalState();
}

void SBDebuggerRestoreInputTerminalState(SBDebuggerRef instance) {
  SBDebugger *unwrapped = reinterpret_cast<SBDebugger *>(instance);
  unwrapped->RestoreInputTerminalState();
}

SBCommandInterpreterRef
SBDebuggerGetCommandInterpreter(SBDebuggerRef instance) {
  SBDebugger *unwrapped = reinterpret_cast<SBDebugger *>(instance);
  return reinterpret_cast<SBCommandInterpreterRef>(
      new SBCommandInterpreter(unwrapped->GetCommandInterpreter()));
}

void SBDebuggerHandleCommand(SBDebuggerRef instance, const char *command) {
  SBDebugger *unwrapped = reinterpret_cast<SBDebugger *>(instance);
  unwrapped->HandleCommand(command);
}

SBListenerRef SBDebuggerGetListener(SBDebuggerRef instance) {
  SBDebugger *unwrapped = reinterpret_cast<SBDebugger *>(instance);
  return reinterpret_cast<SBListenerRef>(
      new SBListener(unwrapped->GetListener()));
}

void SBDebuggerHandleProcessEvent(SBDebuggerRef instance, SBProcessRef process,
                                  SBEventRef event, SBFileRef out,
                                  SBFileRef err) {
  SBDebugger *unwrapped = reinterpret_cast<SBDebugger *>(instance);
  unwrapped->HandleProcessEvent(*reinterpret_cast<SBProcess *>(process),
                                *reinterpret_cast<SBEvent *>(event),
                                *reinterpret_cast<SBFile *>(out),
                                *reinterpret_cast<SBFile *>(err));
}

SBTargetRef SBDebuggerCreateTarget(SBDebuggerRef instance, const char *filename,
                                   const char *target_triple,
                                   const char *platform_name,
                                   bool add_dependent_modules,
                                   SBErrorRef error) {
  SBDebugger *unwrapped = reinterpret_cast<SBDebugger *>(instance);
  return reinterpret_cast<SBTargetRef>(new SBTarget(unwrapped->CreateTarget(
      filename, target_triple, platform_name, add_dependent_modules,
      *reinterpret_cast<SBError *>(error))));
}

SBTargetRef SBDebuggerCreateTargetWithFileAndTargetTriple(
    SBDebuggerRef instance, const char *filename, const char *target_triple) {
  SBDebugger *unwrapped = reinterpret_cast<SBDebugger *>(instance);
  return reinterpret_cast<SBTargetRef>(new SBTarget(
      unwrapped->CreateTargetWithFileAndTargetTriple(filename, target_triple)));
}

SBTargetRef SBDebuggerCreateTargetWithFileAndArch(SBDebuggerRef instance,
                                                  const char *filename,
                                                  const char *archname) {
  SBDebugger *unwrapped = reinterpret_cast<SBDebugger *>(instance);
  return reinterpret_cast<SBTargetRef>(
      new SBTarget(unwrapped->CreateTargetWithFileAndArch(filename, archname)));
}

SBTargetRef SBDebuggerCreateTarget2(SBDebuggerRef instance,
                                    const char *filename) {
  SBDebugger *unwrapped = reinterpret_cast<SBDebugger *>(instance);
  return reinterpret_cast<SBTargetRef>(
      new SBTarget(unwrapped->CreateTarget(filename)));
}

SBTargetRef SBDebuggerGetDummyTarget(SBDebuggerRef instance) {
  SBDebugger *unwrapped = reinterpret_cast<SBDebugger *>(instance);
  return reinterpret_cast<SBTargetRef>(
      new SBTarget(unwrapped->GetDummyTarget()));
}

bool SBDebuggerDeleteTarget(SBDebuggerRef instance, SBTargetRef target) {
  SBDebugger *unwrapped = reinterpret_cast<SBDebugger *>(instance);
  return unwrapped->DeleteTarget(*reinterpret_cast<SBTarget *>(target));
}

SBTargetRef SBDebuggerGetTargetAtIndex(SBDebuggerRef instance, uint32_t idx) {
  SBDebugger *unwrapped = reinterpret_cast<SBDebugger *>(instance);
  return reinterpret_cast<SBTargetRef>(
      new SBTarget(unwrapped->GetTargetAtIndex(idx)));
}

uint32_t SBDebuggerGetIndexOfTarget(SBDebuggerRef instance,
                                    SBTargetRef target) {
  SBDebugger *unwrapped = reinterpret_cast<SBDebugger *>(instance);
  return unwrapped->GetIndexOfTarget(*reinterpret_cast<SBTarget *>(target));
}

SBTargetRef SBDebuggerFindTargetWithProcessID(SBDebuggerRef instance,
                                              lldb_pid_t pid) {
  SBDebugger *unwrapped = reinterpret_cast<SBDebugger *>(instance);
  return reinterpret_cast<SBTargetRef>(
      new SBTarget(unwrapped->FindTargetWithProcessID(pid)));
}

SBTargetRef SBDebuggerFindTargetWithFileAndArch(SBDebuggerRef instance,
                                                const char *filename,
                                                const char *arch) {
  SBDebugger *unwrapped = reinterpret_cast<SBDebugger *>(instance);
  return reinterpret_cast<SBTargetRef>(
      new SBTarget(unwrapped->FindTargetWithFileAndArch(filename, arch)));
}

uint32_t SBDebuggerGetNumTargets(SBDebuggerRef instance) {
  SBDebugger *unwrapped = reinterpret_cast<SBDebugger *>(instance);
  return unwrapped->GetNumTargets();
}

SBTargetRef SBDebuggerGetSelectedTarget(SBDebuggerRef instance) {
  SBDebugger *unwrapped = reinterpret_cast<SBDebugger *>(instance);
  return reinterpret_cast<SBTargetRef>(
      new SBTarget(unwrapped->GetSelectedTarget()));
}

void SBDebuggerSetSelectedTarget(SBDebuggerRef instance, SBTargetRef target) {
  SBDebugger *unwrapped = reinterpret_cast<SBDebugger *>(instance);
  unwrapped->SetSelectedTarget(*reinterpret_cast<SBTarget *>(target));
}

SBPlatformRef SBDebuggerGetSelectedPlatform(SBDebuggerRef instance) {
  SBDebugger *unwrapped = reinterpret_cast<SBDebugger *>(instance);
  return reinterpret_cast<SBPlatformRef>(
      new SBPlatform(unwrapped->GetSelectedPlatform()));
}

void SBDebuggerSetSelectedPlatform(SBDebuggerRef instance,
                                   SBPlatformRef platform) {
  SBDebugger *unwrapped = reinterpret_cast<SBDebugger *>(instance);
  unwrapped->SetSelectedPlatform(*reinterpret_cast<SBPlatform *>(platform));
}

uint32_t SBDebuggerGetNumPlatforms(SBDebuggerRef instance) {
  SBDebugger *unwrapped = reinterpret_cast<SBDebugger *>(instance);
  return unwrapped->GetNumPlatforms();
}

SBPlatformRef SBDebuggerGetPlatformAtIndex(SBDebuggerRef instance,
                                           uint32_t idx) {
  SBDebugger *unwrapped = reinterpret_cast<SBDebugger *>(instance);
  return reinterpret_cast<SBPlatformRef>(
      new SBPlatform(unwrapped->GetPlatformAtIndex(idx)));
}

uint32_t SBDebuggerGetNumAvailablePlatforms(SBDebuggerRef instance) {
  SBDebugger *unwrapped = reinterpret_cast<SBDebugger *>(instance);
  return unwrapped->GetNumAvailablePlatforms();
}

SBStructuredDataRef
SBDebuggerGetAvailablePlatformInfoAtIndex(SBDebuggerRef instance,
                                          uint32_t idx) {
  SBDebugger *unwrapped = reinterpret_cast<SBDebugger *>(instance);
  return reinterpret_cast<SBStructuredDataRef>(
      new SBStructuredData(unwrapped->GetAvailablePlatformInfoAtIndex(idx)));
}

SBSourceManagerRef SBDebuggerGetSourceManager(SBDebuggerRef instance) {
  SBDebugger *unwrapped = reinterpret_cast<SBDebugger *>(instance);
  return reinterpret_cast<SBSourceManagerRef>(
      new SBSourceManager(unwrapped->GetSourceManager()));
}

SBErrorRef SBDebuggerSetCurrentPlatform(SBDebuggerRef instance,
                                        const char *platform_name) {
  SBDebugger *unwrapped = reinterpret_cast<SBDebugger *>(instance);
  return reinterpret_cast<SBErrorRef>(
      new SBError(unwrapped->SetCurrentPlatform(platform_name)));
}

bool SBDebuggerSetCurrentPlatformSDKRoot(SBDebuggerRef instance,
                                         const char *sysroot) {
  SBDebugger *unwrapped = reinterpret_cast<SBDebugger *>(instance);
  return unwrapped->SetCurrentPlatformSDKRoot(sysroot);
}

bool SBDebuggerSetUseExternalEditor(SBDebuggerRef instance, bool input) {
  SBDebugger *unwrapped = reinterpret_cast<SBDebugger *>(instance);
  return unwrapped->SetUseExternalEditor(input);
}

bool SBDebuggerGetUseExternalEditor(SBDebuggerRef instance) {
  SBDebugger *unwrapped = reinterpret_cast<SBDebugger *>(instance);
  return unwrapped->GetUseExternalEditor();
}

bool SBDebuggerSetUseColor(SBDebuggerRef instance, bool use_color) {
  SBDebugger *unwrapped = reinterpret_cast<SBDebugger *>(instance);
  return unwrapped->SetUseColor(use_color);
}

bool SBDebuggerGetUseColor(SBDebuggerRef instance) {
  SBDebugger *unwrapped = reinterpret_cast<SBDebugger *>(instance);
  return unwrapped->GetUseColor();
}

bool SBDebuggerSetUseSourceCache(SBDebuggerRef instance,
                                 bool use_source_cache) {
  SBDebugger *unwrapped = reinterpret_cast<SBDebugger *>(instance);
  return unwrapped->SetUseSourceCache(use_source_cache);
}

bool SBDebuggerGetUseSourceCache(SBDebuggerRef instance) {
  SBDebugger *unwrapped = reinterpret_cast<SBDebugger *>(instance);
  return unwrapped->GetUseSourceCache();
}

bool SBDebuggerGetDefaultArchitecture(char *arch_name, size_t arch_name_len) {
  return lldb::SBDebugger::GetDefaultArchitecture(arch_name, arch_name_len);
}

bool SBDebuggerSetDefaultArchitecture(const char *arch_name) {
  return lldb::SBDebugger::SetDefaultArchitecture(arch_name);
}

enum lldb::ScriptLanguage
SBDebuggerGetScriptingLanguage(SBDebuggerRef instance,
                               const char *script_language_name) {
  SBDebugger *unwrapped = reinterpret_cast<SBDebugger *>(instance);
  return unwrapped->GetScriptingLanguage(script_language_name);
}

SBStructuredDataRef
SBDebuggerGetScriptInterpreterInfo(SBDebuggerRef instance,
                                   lldb::ScriptLanguage language) {
  SBDebugger *unwrapped = reinterpret_cast<SBDebugger *>(instance);
  return reinterpret_cast<SBStructuredDataRef>(
      new SBStructuredData(unwrapped->GetScriptInterpreterInfo(language)));
}

const char *SBDebuggerGetVersionString() {
  return lldb::SBDebugger::GetVersionString();
}

const char *SBDebuggerStateAsCString(lldb::StateType state) {
  return lldb::SBDebugger::StateAsCString(state);
}

bool SBDebuggerStateIsRunningState(lldb::StateType state) {
  return lldb::SBDebugger::StateIsRunningState(state);
}

bool SBDebuggerStateIsStoppedState(lldb::StateType state) {
  return lldb::SBDebugger::StateIsStoppedState(state);
}

bool SBDebuggerEnableLog(SBDebuggerRef instance, const char *channel,
                         const char **categories) {
  SBDebugger *unwrapped = reinterpret_cast<SBDebugger *>(instance);
  return unwrapped->EnableLog(channel, categories);
}

void SBDebuggerSetLoggingCallback(SBDebuggerRef instance,
                                  lldb::LogOutputCallback log_callback,
                                  void *baton) {
  SBDebugger *unwrapped = reinterpret_cast<SBDebugger *>(instance);
  unwrapped->SetLoggingCallback(log_callback, baton);
}

void SBDebuggerDispatchInput(SBDebuggerRef instance, void *baton,
                             const void *data, size_t data_len) {
  SBDebugger *unwrapped = reinterpret_cast<SBDebugger *>(instance);
  unwrapped->DispatchInput(baton, data, data_len);
}

void SBDebuggerDispatchInput2(SBDebuggerRef instance, const void *data,
                              size_t data_len) {
  SBDebugger *unwrapped = reinterpret_cast<SBDebugger *>(instance);
  unwrapped->DispatchInput(data, data_len);
}

void SBDebuggerDispatchInputInterrupt(SBDebuggerRef instance) {
  SBDebugger *unwrapped = reinterpret_cast<SBDebugger *>(instance);
  unwrapped->DispatchInputInterrupt();
}

void SBDebuggerDispatchInputEndOfFile(SBDebuggerRef instance) {
  SBDebugger *unwrapped = reinterpret_cast<SBDebugger *>(instance);
  unwrapped->DispatchInputEndOfFile();
}

void SBDebuggerPushInputReader(SBDebuggerRef instance,
                               SBInputReaderRef reader) {
  SBDebugger *unwrapped = reinterpret_cast<SBDebugger *>(instance);
  unwrapped->PushInputReader(*reinterpret_cast<SBInputReader *>(reader));
}

const char *SBDebuggerGetInstanceName(SBDebuggerRef instance) {
  SBDebugger *unwrapped = reinterpret_cast<SBDebugger *>(instance);
  return unwrapped->GetInstanceName();
}

SBDebuggerRef SBDebuggerFindDebuggerWithID(int id) {
  return reinterpret_cast<SBDebuggerRef>(
      new SBDebugger(lldb::SBDebugger::FindDebuggerWithID(id)));
}

SBErrorRef SBDebuggerSetInternalVariable(const char *var_name,
                                         const char *value,
                                         const char *debugger_instance_name) {
  return reinterpret_cast<SBErrorRef>(
      new SBError(lldb::SBDebugger::SetInternalVariable(
          var_name, value, debugger_instance_name)));
}

SBStringListRef
SBDebuggerGetInternalVariableValue(const char *var_name,
                                   const char *debugger_instance_name) {
  return reinterpret_cast<SBStringListRef>(
      new SBStringList(lldb::SBDebugger::GetInternalVariableValue(
          var_name, debugger_instance_name)));
}

bool SBDebuggerGetDescription(SBDebuggerRef instance, SBStreamRef description) {
  SBDebugger *unwrapped = reinterpret_cast<SBDebugger *>(instance);
  return unwrapped->GetDescription(*reinterpret_cast<SBStream *>(description));
}

uint32_t SBDebuggerGetTerminalWidth(SBDebuggerRef instance) {
  SBDebugger *unwrapped = reinterpret_cast<SBDebugger *>(instance);
  return unwrapped->GetTerminalWidth();
}

void SBDebuggerSetTerminalWidth(SBDebuggerRef instance, uint32_t term_width) {
  SBDebugger *unwrapped = reinterpret_cast<SBDebugger *>(instance);
  unwrapped->SetTerminalWidth(term_width);
}

lldb_user_id_t SBDebuggerGetID(SBDebuggerRef instance) {
  SBDebugger *unwrapped = reinterpret_cast<SBDebugger *>(instance);
  return unwrapped->GetID();
}

const char *SBDebuggerGetPrompt(SBDebuggerRef instance) {
  SBDebugger *unwrapped = reinterpret_cast<SBDebugger *>(instance);
  return unwrapped->GetPrompt();
}

void SBDebuggerSetPrompt(SBDebuggerRef instance, const char *prompt) {
  SBDebugger *unwrapped = reinterpret_cast<SBDebugger *>(instance);
  unwrapped->SetPrompt(prompt);
}

enum lldb::ScriptLanguage SBDebuggerGetScriptLanguage(SBDebuggerRef instance) {
  SBDebugger *unwrapped = reinterpret_cast<SBDebugger *>(instance);
  return unwrapped->GetScriptLanguage();
}

void SBDebuggerSetScriptLanguage(SBDebuggerRef instance,
                                 lldb::ScriptLanguage script_lang) {
  SBDebugger *unwrapped = reinterpret_cast<SBDebugger *>(instance);
  unwrapped->SetScriptLanguage(script_lang);
}

lldb::LanguageType SBDebuggerGetREPLLanguage(SBDebuggerRef instance) {
  SBDebugger *unwrapped = reinterpret_cast<SBDebugger *>(instance);
  return unwrapped->GetREPLLanguage();
}

void SBDebuggerSetREPLLanguage(SBDebuggerRef instance,
                               lldb::LanguageType repl_lang) {
  SBDebugger *unwrapped = reinterpret_cast<SBDebugger *>(instance);
  unwrapped->SetREPLLanguage(repl_lang);
}

bool SBDebuggerGetCloseInputOnEOF(SBDebuggerRef instance) {
  SBDebugger *unwrapped = reinterpret_cast<SBDebugger *>(instance);
  return unwrapped->GetCloseInputOnEOF();
}

void SBDebuggerSetCloseInputOnEOF(SBDebuggerRef instance, bool b) {
  SBDebugger *unwrapped = reinterpret_cast<SBDebugger *>(instance);
  unwrapped->SetCloseInputOnEOF(b);
}

SBTypeCategoryRef SBDebuggerGetCategory(SBDebuggerRef instance,
                                        const char *category_name) {
  SBDebugger *unwrapped = reinterpret_cast<SBDebugger *>(instance);
  return reinterpret_cast<SBTypeCategoryRef>(
      new SBTypeCategory(unwrapped->GetCategory(category_name)));
}

SBTypeCategoryRef SBDebuggerCreateCategory(SBDebuggerRef instance,
                                           const char *category_name) {
  SBDebugger *unwrapped = reinterpret_cast<SBDebugger *>(instance);
  return reinterpret_cast<SBTypeCategoryRef>(
      new SBTypeCategory(unwrapped->CreateCategory(category_name)));
}

bool SBDebuggerDeleteCategory(SBDebuggerRef instance,
                              const char *category_name) {
  SBDebugger *unwrapped = reinterpret_cast<SBDebugger *>(instance);
  return unwrapped->DeleteCategory(category_name);
}

uint32_t SBDebuggerGetNumCategories(SBDebuggerRef instance) {
  SBDebugger *unwrapped = reinterpret_cast<SBDebugger *>(instance);
  return unwrapped->GetNumCategories();
}

SBTypeCategoryRef SBDebuggerGetCategoryAtIndex(SBDebuggerRef instance,
                                               uint32_t var0) {
  SBDebugger *unwrapped = reinterpret_cast<SBDebugger *>(instance);
  return reinterpret_cast<SBTypeCategoryRef>(
      new SBTypeCategory(unwrapped->GetCategoryAtIndex(var0)));
}

SBTypeCategoryRef SBDebuggerGetDefaultCategory(SBDebuggerRef instance) {
  SBDebugger *unwrapped = reinterpret_cast<SBDebugger *>(instance);
  return reinterpret_cast<SBTypeCategoryRef>(
      new SBTypeCategory(unwrapped->GetDefaultCategory()));
}

SBTypeFormatRef SBDebuggerGetFormatForType(SBDebuggerRef instance,
                                           SBTypeNameSpecifierRef var0) {
  SBDebugger *unwrapped = reinterpret_cast<SBDebugger *>(instance);
  return reinterpret_cast<SBTypeFormatRef>(
      new SBTypeFormat(unwrapped->GetFormatForType(
          *reinterpret_cast<SBTypeNameSpecifier *>(var0))));
}

SBTypeSummaryRef SBDebuggerGetSummaryForType(SBDebuggerRef instance,
                                             SBTypeNameSpecifierRef var0) {
  SBDebugger *unwrapped = reinterpret_cast<SBDebugger *>(instance);
  return reinterpret_cast<SBTypeSummaryRef>(
      new SBTypeSummary(unwrapped->GetSummaryForType(
          *reinterpret_cast<SBTypeNameSpecifier *>(var0))));
}

SBTypeFilterRef SBDebuggerGetFilterForType(SBDebuggerRef instance,
                                           SBTypeNameSpecifierRef var0) {
  SBDebugger *unwrapped = reinterpret_cast<SBDebugger *>(instance);
  return reinterpret_cast<SBTypeFilterRef>(
      new SBTypeFilter(unwrapped->GetFilterForType(
          *reinterpret_cast<SBTypeNameSpecifier *>(var0))));
}

SBTypeSyntheticRef SBDebuggerGetSyntheticForType(SBDebuggerRef instance,
                                                 SBTypeNameSpecifierRef var0) {
  SBDebugger *unwrapped = reinterpret_cast<SBDebugger *>(instance);
  return reinterpret_cast<SBTypeSyntheticRef>(
      new SBTypeSynthetic(unwrapped->GetSyntheticForType(
          *reinterpret_cast<SBTypeNameSpecifier *>(var0))));
}

void SBDebuggerRunCommandInterpreter(SBDebuggerRef instance,
                                     bool auto_handle_events,
                                     bool spawn_thread) {
  SBDebugger *unwrapped = reinterpret_cast<SBDebugger *>(instance);
  unwrapped->RunCommandInterpreter(auto_handle_events, spawn_thread);
}

void SBDebuggerRunCommandInterpreter2(SBDebuggerRef instance,
                                      bool auto_handle_events,
                                      bool spawn_thread,
                                      SBCommandInterpreterRunOptionsRef options,
                                      int num_errors, bool quit_requested,
                                      bool stopped_for_crash) {
  SBDebugger *unwrapped = reinterpret_cast<SBDebugger *>(instance);
  unwrapped->RunCommandInterpreter(
      auto_handle_events, spawn_thread,
      *reinterpret_cast<SBCommandInterpreterRunOptions *>(options), num_errors,
      quit_requested, stopped_for_crash);
}

void SBDebuggerRunCommandInterpreter3(
    SBDebuggerRef instance, SBCommandInterpreterRunOptionsRef options) {
  SBDebugger *unwrapped = reinterpret_cast<SBDebugger *>(instance);
  unwrapped->RunCommandInterpreter(
      *reinterpret_cast<SBCommandInterpreterRunOptions *>(options));
}

SBErrorRef SBDebuggerRunREPL(SBDebuggerRef instance,
                             lldb::LanguageType language,
                             const char *repl_options) {
  SBDebugger *unwrapped = reinterpret_cast<SBDebugger *>(instance);
  return reinterpret_cast<SBErrorRef>(
      new SBError(unwrapped->RunREPL(language, repl_options)));
}

#ifdef __cplusplus
}
#endif