dwarf-synthesis/DwarfSynth/c_bindings/test_dw.c
Théophile Bastian 8fa2bc5952 ml_dwarf_write: write to a separate file
Don't try to write into the ELF file directly, use objcopy.

Updated README
2019-03-18 14:20:53 +01:00

19 lines
432 B
C

#include <stdlib.h>
#include <stdio.h>
#include "dwarf_write.h"
int main() {
struct pre_dwarf_entry entries[3] = {
{ 0x1300, DW_REG_RSP, 8 },
{ 0x1310, DW_REG_RSP, 16 },
{ 0x1340, DW_REG_RSP, 8 }
};
struct pre_dwarf_fde fde = {
3, entries, 0x1300, 0x1342
};
struct pre_dwarf dwarf_data = {1, &fde};
write_dwarf("test.bin", "test.bin.eh_frame", &dwarf_data);
return 0;
}