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
use libc::{c_char, c_int, c_long, c_uchar, c_uint, c_void, ptrdiff_t, size_t};

use crate::*;

c_enum! {
    Dwarf_Cmd {
        DWARF_C_READ = 0,
        DWARF_C_RDWR = 1,
        DWARF_C_WRITE = 2,
    }
}

pub const DWARF_CB_OK: c_int = 0;
pub const DWARF_CB_ABORT: c_int = 1;

pub const DW_TAG_invalid: c_int = 0;

pub type Dwarf_Off = GElf_Off;

pub type Dwarf_Addr = GElf_Addr;

pub type Dwarf_Word = GElf_Xword;
pub type Dwarf_Sword = GElf_Sxword;
pub type Dwarf_Half = GElf_Half;

pub enum Dwarf_Abbrev {}

pub const DWARF_END_ABBREV: *mut Dwarf_Abbrev = -1isize as *mut Dwarf_Abbrev;

pub enum Dwarf_Lines {}

pub enum Dwarf_Line {}

pub enum Dwarf_Files {}

pub enum Dwarf_Arange {}

pub enum Dwarf_Aranges {}

pub enum Dwarf_CU {}

pub enum Dwarf_Macro {}

#[repr(C)]
#[derive(Copy, Clone)]
pub struct Dwarf_Attribute {
    pub code: c_uint,
    pub form: c_uint,
    pub valp: *mut c_uchar,
    pub cu: *mut Dwarf_CU,
}

#[repr(C)]
#[derive(Copy, Clone)]
pub struct Dwarf_Block {
    pub length: Dwarf_Word,
    pub data: *mut c_uchar,
}

#[repr(C)]
#[derive(Copy, Clone)]
pub struct Dwarf_Die {
    pub addr: *mut c_void,
    pub cu: *mut Dwarf_CU,
    pub abbrev: *mut Dwarf_Abbrev,
    pub padding__: c_long,
}

pub const DWARF_END_DIE: *mut Dwarf_Die = -1isize as *mut Dwarf_Die;

#[repr(C)]
#[derive(Copy, Clone)]
pub struct Dwarf_Global {
    pub cu_offset: Dwarf_Off,
    pub die_offset: Dwarf_Off,
    pub name: *const c_char,
}

#[repr(C)]
#[derive(Copy, Clone)]
pub struct Dwarf_Op {
    pub atom: u8,
    pub number: Dwarf_Word,
    pub number2: Dwarf_Word,
    pub offset: Dwarf_Word,
}

#[repr(C)]
#[derive(Copy, Clone)]
pub struct Dwarf_CIE {
    pub CIE_id: Dwarf_Off,
    pub initial_instructions: *const u8,
    pub initial_instructions_end: *const u8,
    pub code_alignment_factor: Dwarf_Word,
    pub data_alignment_factor: Dwarf_Sword,
    pub return_address_register: Dwarf_Word,
    pub augmentation: *const c_char,
    pub augmentation_data: *const u8,
    pub augmentation_data_size: size_t,
    pub fde_augmentation_data_size: size_t,
}

#[repr(C)]
#[derive(Copy, Clone)]
pub struct Dwarf_FDE {
    pub CIE_pointer: Dwarf_Off,
    pub start: *const u8,
    pub end: *const u8,
}

#[repr(C)]
pub union Dwarf_CFI_Entry {
    pub CIE_id: Dwarf_Off,
    pub cie: Dwarf_CIE,
    pub fde: Dwarf_FDE,
}

pub enum Dwarf_Frame {}

pub enum Dwarf_CFI {}

pub enum Dwarf {}

pub type Dwarf_OOM = unsafe extern "C" fn() -> !;

extern "C" {
    pub fn dwarf_begin(fildes: c_int, cmd: Dwarf_Cmd) -> *mut Dwarf;

    pub fn dwarf_begin_elf(elf: *mut Elf, cmd: Dwarf_Cmd, scngrp: *mut Elf_Scn) -> *mut Dwarf;

    pub fn dwarf_getelf(dwarf: *mut Dwarf) -> *mut Elf;

    pub fn dwarf_cu_getdwarf(dcu: *mut Dwarf_CU) -> *mut Dwarf;

    pub fn dwarf_getalt(main: *mut Dwarf) -> *mut Dwarf;

    pub fn dwarf_setalt(main: *mut Dwarf, alt: *mut Dwarf);

    pub fn dwarf_end(dwarf: *mut Dwarf) -> c_int;

    pub fn dwarf_nextcu(
        dwarf: *mut Dwarf,
        off: Dwarf_Off,
        next_off: *mut Dwarf_Off,
        header_sizep: *mut size_t,
        abbrev_offsetp: *mut Dwarf_Off,
        address_sizep: *mut u8,
        offset_sizep: *mut u8,
    ) -> c_int;

    pub fn dwarf_next_unit(
        dwarf: *mut Dwarf,
        off: Dwarf_Off,
        next_off: *mut Dwarf_Off,
        header_sizep: *mut size_t,
        versionp: *mut Dwarf_Half,
        abbrev_offsetp: *mut Dwarf_Off,
        address_sizep: *mut u8,
        offset_sizep: *mut u8,
        type_signaturep: *mut u64,
        type_offsetp: *mut Dwarf_Off,
    ) -> c_int;

    pub fn dwarf_next_cfi(
        e_ident: *const c_uchar,
        data: *mut Elf_Data,
        eh_frame_p: bool,
        offset: Dwarf_Off,
        next_offset: *mut Dwarf_Off,
        entry: *mut Dwarf_CFI_Entry,
    ) -> c_int;

    pub fn dwarf_getcfi(dwarf: *mut Dwarf) -> *mut Dwarf_CFI;

    pub fn dwarf_getcfi_elf(elf: *mut Elf) -> *mut Dwarf_CFI;

    pub fn dwarf_cfi_end(cache: *mut Dwarf_CFI) -> c_int;

    pub fn dwarf_offdie(
        dbg: *mut Dwarf,
        offset: Dwarf_Off,
        result: *mut Dwarf_Die,
    ) -> *mut Dwarf_Die;

    pub fn dwarf_offdie_types(
        dbg: *mut Dwarf,
        offset: Dwarf_Off,
        result: *mut Dwarf_Die,
    ) -> *mut Dwarf_Die;

    pub fn dwarf_dieoffset(die: *mut Dwarf_Die) -> Dwarf_Off;

    pub fn dwarf_cuoffset(die: *mut Dwarf_Die) -> Dwarf_Off;

    pub fn dwarf_diecu(
        die: *mut Dwarf_Die,
        result: *mut Dwarf_Die,
        address_sizep: *mut u8,
        offset_sizep: *mut u8,
    ) -> *mut Dwarf_Die;

    pub fn dwarf_cu_die(
        cu: *mut Dwarf_CU,
        result: *mut Dwarf_Die,
        versionp: *mut Dwarf_Half,
        abbrev_offsetp: *mut Dwarf_Off,
        address_sizep: *mut u8,
        offset_sizep: *mut u8,
        type_signaturep: *mut u64,
        type_offsetp: *mut Dwarf_Off,
    ) -> *mut Dwarf_Die;

    pub fn dwarf_addrdie(
        dbg: *mut Dwarf,
        addr: Dwarf_Addr,
        result: *mut Dwarf_Die,
    ) -> *mut Dwarf_Die;

    pub fn dwarf_child(die: *mut Dwarf_Die, result: *mut Dwarf_Die) -> c_int;

    pub fn dwarf_siblingof(die: *mut Dwarf_Die, result: *mut Dwarf_Die) -> c_int;

    pub fn dwarf_peel_type(die: *mut Dwarf_Die, result: *mut Dwarf_Die) -> c_int;

    pub fn dwarf_haschildren(die: *mut Dwarf_Die) -> c_int;

    pub fn dwarf_getattrs(
        die: *mut Dwarf_Die,
        callback: Option<unsafe extern "C" fn(_: *mut Dwarf_Attribute, _: *mut c_void) -> c_int>,
        arg: *mut c_void,
        offset: ptrdiff_t,
    ) -> ptrdiff_t;

    pub fn dwarf_tag(die: *mut Dwarf_Die) -> c_int;

    pub fn dwarf_attr(
        die: *mut Dwarf_Die,
        search_name: c_uint,
        result: *mut Dwarf_Attribute,
    ) -> *mut Dwarf_Attribute;

    pub fn dwarf_hasattr(die: *mut Dwarf_Die, search_name: c_uint) -> c_int;

    pub fn dwarf_attr_integrate(
        die: *mut Dwarf_Die,
        search_name: c_uint,
        result: *mut Dwarf_Attribute,
    ) -> *mut Dwarf_Attribute;

    pub fn dwarf_hasattr_integrate(die: *mut Dwarf_Die, search_name: c_uint) -> c_int;

    pub fn dwarf_hasform(attr: *mut Dwarf_Attribute, search_form: c_uint) -> c_int;

    pub fn dwarf_whatattr(attr: *mut Dwarf_Attribute) -> c_uint;

    pub fn dwarf_whatform(attr: *mut Dwarf_Attribute) -> c_uint;

    pub fn dwarf_formstring(attrp: *mut Dwarf_Attribute) -> *const c_char;

    pub fn dwarf_formudata(attr: *mut Dwarf_Attribute, return_uval: *mut Dwarf_Word) -> c_int;

    pub fn dwarf_formsdata(attr: *mut Dwarf_Attribute, return_uval: *mut Dwarf_Sword) -> c_int;

    pub fn dwarf_formaddr(attr: *mut Dwarf_Attribute, return_addr: *mut Dwarf_Addr) -> c_int;

    pub fn dwarf_formref_die(attr: *mut Dwarf_Attribute, die_mem: *mut Dwarf_Die)
        -> *mut Dwarf_Die;

    pub fn dwarf_formblock(attr: *mut Dwarf_Attribute, return_block: *mut Dwarf_Block) -> c_int;

    pub fn dwarf_formflag(attr: *mut Dwarf_Attribute, return_bool: *mut bool) -> c_int;

    pub fn dwarf_diename(die: *mut Dwarf_Die) -> *const c_char;

    pub fn dwarf_highpc(die: *mut Dwarf_Die, return_addr: *mut Dwarf_Addr) -> c_int;

    pub fn dwarf_lowpc(die: *mut Dwarf_Die, return_addr: *mut Dwarf_Addr) -> c_int;

    pub fn dwarf_entrypc(die: *mut Dwarf_Die, return_addr: *mut Dwarf_Addr) -> c_int;

    pub fn dwarf_haspc(die: *mut Dwarf_Die, pc: Dwarf_Addr) -> c_int;

    pub fn dwarf_ranges(
        die: *mut Dwarf_Die,
        offset: ptrdiff_t,
        basep: *mut Dwarf_Addr,
        startp: *mut Dwarf_Addr,
        endp: *mut Dwarf_Addr,
    ) -> ptrdiff_t;

    pub fn dwarf_bytesize(die: *mut Dwarf_Die) -> c_int;

    pub fn dwarf_bitsize(die: *mut Dwarf_Die) -> c_int;

    pub fn dwarf_bitoffset(die: *mut Dwarf_Die) -> c_int;

    pub fn dwarf_arrayorder(die: *mut Dwarf_Die) -> c_int;

    pub fn dwarf_srclang(die: *mut Dwarf_Die) -> c_int;

    pub fn dwarf_getabbrev(
        die: *mut Dwarf_Die,
        offset: Dwarf_Off,
        lengthp: *mut size_t,
    ) -> *mut Dwarf_Abbrev;

    pub fn dwarf_offabbrev(
        dbg: *mut Dwarf,
        offset: Dwarf_Off,
        lengthp: *mut size_t,
        abbrevp: *mut Dwarf_Abbrev,
    ) -> c_int;

    pub fn dwarf_getabbrevcode(abbrev: *mut Dwarf_Abbrev) -> c_uint;

    pub fn dwarf_getabbrevtag(abbrev: *mut Dwarf_Abbrev) -> c_uint;

    pub fn dwarf_abbrevhaschildren(abbrev: *mut Dwarf_Abbrev) -> c_int;

    pub fn dwarf_getattrcnt(abbrev: *mut Dwarf_Abbrev, attrcntp: *mut size_t) -> c_int;

    pub fn dwarf_getabbrevattr(
        abbrev: *mut Dwarf_Abbrev,
        idx: size_t,
        namep: *mut c_uint,
        formp: *mut c_uint,
        offset: *mut Dwarf_Off,
    ) -> c_int;

    pub fn dwarf_getstring(dbg: *mut Dwarf, offset: Dwarf_Off, lep: *mut size_t) -> *const c_char;

    pub fn dwarf_getpubnames(
        dbg: *mut Dwarf,
        callback: Option<
            unsafe extern "C" fn(_: *mut Dwarf, _: *mut Dwarf_Global, _: *mut c_void) -> c_int,
        >,
        arg: *mut c_void,
        offset: ptrdiff_t,
    ) -> ptrdiff_t;

    pub fn dwarf_getsrclines(
        cudie: *mut Dwarf_Die,
        lines: *mut *mut Dwarf_Lines,
        nlines: *mut size_t,
    ) -> c_int;

    pub fn dwarf_onesrcline(lines: *mut Dwarf_Lines, idx: size_t) -> *mut Dwarf_Line;

    pub fn dwarf_getsrcfiles(
        cudie: *mut Dwarf_Die,
        files: *mut *mut Dwarf_Files,
        nfiles: *mut size_t,
    ) -> c_int;

    pub fn dwarf_getsrc_die(cudie: *mut Dwarf_Die, addr: Dwarf_Addr) -> *mut Dwarf_Line;

    pub fn dwarf_getsrc_file(
        dbg: *mut Dwarf,
        fname: *const c_char,
        line: c_int,
        col: c_int,
        srcp: *mut *mut *mut Dwarf_Line,
        nsrcs: *mut size_t,
    ) -> c_int;

    pub fn dwarf_lineaddr(line: *mut Dwarf_Line, addrp: *mut Dwarf_Addr) -> c_int;

    pub fn dwarf_lineop_index(line: *mut Dwarf_Line, op_indexp: *mut c_uint) -> c_int;

    pub fn dwarf_lineno(line: *mut Dwarf_Line, linep: *mut c_int) -> c_int;

    pub fn dwarf_linecol(line: *mut Dwarf_Line, colp: *mut c_int) -> c_int;

    pub fn dwarf_linebeginstatement(line: *mut Dwarf_Line, flagp: *mut bool) -> c_int;

    pub fn dwarf_lineendsequence(line: *mut Dwarf_Line, flagp: *mut bool) -> c_int;

    pub fn dwarf_lineblock(line: *mut Dwarf_Line, flagp: *mut bool) -> c_int;

    pub fn dwarf_lineprologueend(line: *mut Dwarf_Line, flagp: *mut bool) -> c_int;

    pub fn dwarf_lineepiloguebegin(line: *mut Dwarf_Line, flagp: *mut bool) -> c_int;

    pub fn dwarf_lineisa(line: *mut Dwarf_Line, isap: *mut c_uint) -> c_int;

    pub fn dwarf_linediscriminator(line: *mut Dwarf_Line, discp: *mut c_uint) -> c_int;

    pub fn dwarf_linesrc(
        line: *mut Dwarf_Line,
        mtime: *mut Dwarf_Word,
        length: *mut Dwarf_Word,
    ) -> *const c_char;

    pub fn dwarf_filesrc(
        file: *mut Dwarf_Files,
        idx: size_t,
        mtime: *mut Dwarf_Word,
        length: *mut Dwarf_Word,
    ) -> *const c_char;

    pub fn dwarf_getsrcdirs(
        files: *mut Dwarf_Files,
        result: *mut *const *const c_char,
        ndirs: *mut size_t,
    ) -> c_int;

    pub fn dwarf_getlocation(
        attr: *mut Dwarf_Attribute,
        expr: *mut *mut Dwarf_Op,
        exprlen: *mut size_t,
    ) -> c_int;

    pub fn dwarf_getlocation_addr(
        attr: *mut Dwarf_Attribute,
        address: Dwarf_Addr,
        exprs: *mut *mut Dwarf_Op,
        exprlens: *mut size_t,
        nlocs: size_t,
    ) -> c_int;

    pub fn dwarf_getlocations(
        attr: *mut Dwarf_Attribute,
        offset: ptrdiff_t,
        basep: *mut Dwarf_Addr,
        startp: *mut Dwarf_Addr,
        endp: *mut Dwarf_Addr,
        expr: *mut *mut Dwarf_Op,
        exprlen: *mut size_t,
    ) -> ptrdiff_t;

    pub fn dwarf_getlocation_implicit_value(
        attr: *mut Dwarf_Attribute,
        op: *const Dwarf_Op,
        return_block: *mut Dwarf_Block,
    ) -> c_int;

    pub fn dwarf_getlocation_implicit_pointer(
        attr: *mut Dwarf_Attribute,
        op: *const Dwarf_Op,
        result: *mut Dwarf_Attribute,
    ) -> c_int;

    pub fn dwarf_getlocation_die(
        attr: *mut Dwarf_Attribute,
        op: *const Dwarf_Op,
        result: *mut Dwarf_Die,
    ) -> c_int;

    pub fn dwarf_getlocation_attr(
        attr: *mut Dwarf_Attribute,
        op: *const Dwarf_Op,
        result: *mut Dwarf_Attribute,
    ) -> c_int;

    pub fn dwarf_aggregate_size(die: *mut Dwarf_Die, size: *mut Dwarf_Word) -> c_int;

    pub fn dwarf_getscopes(
        cudie: *mut Dwarf_Die,
        pc: Dwarf_Addr,
        scopes: *mut *mut Dwarf_Die,
    ) -> c_int;

    pub fn dwarf_getscopes_die(die: *mut Dwarf_Die, scopes: *mut *mut Dwarf_Die) -> c_int;

    pub fn dwarf_getscopevar(
        scopes: *mut Dwarf_Die,
        nscopes: c_int,
        name: *const c_char,
        skip_shadows: c_int,
        match_file: *const c_char,
        match_lineno: c_int,
        match_linecol: c_int,
        result: *mut Dwarf_Die,
    ) -> c_int;

    pub fn dwarf_getaranges(
        dbg: *mut Dwarf,
        aranges: *mut *mut Dwarf_Aranges,
        naranges: *mut size_t,
    ) -> c_int;

    pub fn dwarf_onearange(aranges: *mut Dwarf_Aranges, idx: size_t) -> *mut Dwarf_Arange;

    pub fn dwarf_getarangeinfo(
        arange: *mut Dwarf_Arange,
        addrp: *mut Dwarf_Addr,
        lengthp: *mut Dwarf_Word,
        offsetp: *mut Dwarf_Off,
    ) -> c_int;

    pub fn dwarf_getarange_addr(aranges: *mut Dwarf_Aranges, addr: Dwarf_Addr)
        -> *mut Dwarf_Arange;

    pub fn dwarf_getfuncs(
        cudie: *mut Dwarf_Die,
        callback: Option<unsafe extern "C" fn(_: *mut Dwarf_Die, _: *mut c_void) -> c_int>,
        arg: *mut c_void,
        offset: ptrdiff_t,
    ) -> ptrdiff_t;

    pub fn dwarf_decl_file(decl: *mut Dwarf_Die) -> *const c_char;

    pub fn dwarf_decl_line(decl: *mut Dwarf_Die, linep: *mut c_int) -> c_int;

    pub fn dwarf_decl_column(decl: *mut Dwarf_Die, colp: *mut c_int) -> c_int;

    pub fn dwarf_func_inline(func: *mut Dwarf_Die) -> c_int;

    pub fn dwarf_func_inline_instances(
        func: *mut Dwarf_Die,
        callback: Option<unsafe extern "C" fn(_: *mut Dwarf_Die, _: *mut c_void) -> c_int>,
        arg: *mut c_void,
    ) -> c_int;

    pub fn dwarf_entry_breakpoints(die: *mut Dwarf_Die, bkpts: *mut *mut Dwarf_Addr) -> c_int;

    pub fn dwarf_getmacros(
        cudie: *mut Dwarf_Die,
        callback: Option<unsafe extern "C" fn(_: *mut Dwarf_Macro, _: *mut c_void) -> c_int>,
        arg: *mut c_void,
        token: ptrdiff_t,
    ) -> ptrdiff_t;

    pub fn dwarf_getmacros_off(
        dbg: *mut Dwarf,
        macoff: Dwarf_Off,
        callback: Option<unsafe extern "C" fn(_: *mut Dwarf_Macro, _: *mut c_void) -> c_int>,
        arg: *mut c_void,
        token: ptrdiff_t,
    ) -> ptrdiff_t;

    pub fn dwarf_macro_getsrcfiles(
        dbg: *mut Dwarf,
        macro_: *mut Dwarf_Macro,
        files: *mut *mut Dwarf_Files,
        nfiles: *mut size_t,
    ) -> c_int;

    pub fn dwarf_macro_opcode(macro_: *mut Dwarf_Macro, opcodeop: *mut c_uint) -> c_int;

    pub fn dwarf_macro_getparamcnt(macro_: *mut Dwarf_Macro, paramcntp: *mut size_t) -> c_int;

    pub fn dwarf_macro_param(
        macro_: *mut Dwarf_Macro,
        idx: size_t,
        attribute: *mut Dwarf_Attribute,
    ) -> c_int;

    pub fn dwarf_macro_param1(macro_: *mut Dwarf_Macro, paramp: *mut Dwarf_Word) -> c_int;

    pub fn dwarf_macro_param2(
        macro_: *mut Dwarf_Macro,
        paramp: *mut Dwarf_Word,
        strp: *mut *const c_char,
    ) -> c_int;

    pub fn dwarf_cfi_addrframe(
        cache: *mut Dwarf_CFI,
        address: Dwarf_Addr,
        frame: *mut *mut Dwarf_Frame,
    ) -> c_int;

    pub fn dwarf_frame_info(
        frame: *mut Dwarf_Frame,
        start: *mut Dwarf_Addr,
        end: *mut Dwarf_Addr,
        signalp: *mut bool,
    ) -> c_int;

    pub fn dwarf_frame_cfa(
        frame: *mut Dwarf_Frame,
        ops: *mut *mut Dwarf_Op,
        nops: *mut size_t,
    ) -> c_int;

    pub fn dwarf_frame_register(
        frame: *mut Dwarf_Frame,
        regno: c_int,
        ops_mem: *mut [Dwarf_Op; 3],
        ops: *mut *mut Dwarf_Op,
        nops: *mut size_t,
    ) -> c_int;

    pub fn dwarf_errno() -> c_int;

    pub fn dwarf_errmsg(err: c_int) -> *const c_char;

    pub fn dwarf_new_oom_handler(dbg: *mut Dwarf, handler: Dwarf_OOM) -> Dwarf_OOM;
}