summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChang S. Bae <chang.seok.bae@intel.com>2017-04-08 02:22:05 -0700
committerH. Peter Anvin <hpa@linux.intel.com>2017-04-17 14:00:16 -0700
commit6a912a3c903db14b878a2328a86379b6a0b9266d (patch)
tree0f3448a82929bfbb3d408bc5e04ad98ba52a023b
parent3b26c45e7f17c2d4eb3abc46bcfa20115b0d2df0 (diff)
downloadnasm-6a912a3c903db14b878a2328a86379b6a0b9266d.tar.gz
outmacho: dwarf debug (1/4)
skeletion interfaces MachO Dwarf is basically porting of ELF's DWARF implementations and it includes debug line information and some debug meta data Signed-off-by: Chang S. Bae <chang.seok.bae@intel.com> Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
-rw-r--r--output/outmacho.c61
1 files changed, 57 insertions, 4 deletions
diff --git a/output/outmacho.c b/output/outmacho.c
index 49d42469..7aa519b1 100644
--- a/output/outmacho.c
+++ b/output/outmacho.c
@@ -1727,6 +1727,27 @@ static const struct pragma_facility macho_pragma_list[] = {
{ NULL, macho_pragma } /* Implements macho32/macho64 namespaces */
};
+static void macho_dbg_init(void)
+{
+}
+
+static void macho_dbg_linenum(const char *file_name, int32_t line_num, int32_t segto)
+{
+ (void)file_name;
+ (void)line_num;
+ (void)segto;
+}
+
+static void macho_dbg_output(int type, void *param)
+{
+ (void)type;
+ (void)param;
+}
+
+static void macho_dbg_cleanup(void)
+{
+}
+
#ifdef OF_MACHO32
static const struct macho_fmt macho32_fmt = {
4,
@@ -1751,13 +1772,29 @@ static void macho32_init(void)
macho_gotpcrel_sect = NO_SEG;
}
+static const struct dfmt macho32_df_dwarf = {
+ "MachO32 (i386) dwarf debug format for Darwin/MacOS",
+ "dwarf",
+ macho_dbg_init,
+ macho_dbg_linenum,
+ null_debug_deflabel,
+ null_debug_directive,
+ null_debug_typevalue,
+ macho_dbg_output,
+ macho_dbg_cleanup,
+ NULL /*pragma list*/
+};
+
+static const struct dfmt * const macho32_df_arr[2] =
+ { &macho32_df_dwarf, NULL };
+
const struct ofmt of_macho32 = {
"NeXTstep/OpenStep/Rhapsody/Darwin/MacOS X (i386) object files",
"macho32",
0,
32,
- null_debug_arr,
- &null_debug_form,
+ macho32_df_arr,
+ &macho32_df_dwarf,
macho_stdmac,
macho32_init,
nasm_do_legacy_output,
@@ -1799,13 +1836,29 @@ static void macho64_init(void)
define_label("..gotpcrel", macho_gotpcrel_sect, 0L, NULL, false, false);
}
+static const struct dfmt macho64_df_dwarf = {
+ "MachO64 (x86-64) dwarf debug format for Darwin/MacOS",
+ "dwarf",
+ macho_dbg_init,
+ macho_dbg_linenum,
+ null_debug_deflabel,
+ null_debug_directive,
+ null_debug_typevalue,
+ macho_dbg_output,
+ macho_dbg_cleanup,
+ NULL /*pragma list*/
+};
+
+static const struct dfmt * const macho64_df_arr[2] =
+ { &macho64_df_dwarf, NULL };
+
const struct ofmt of_macho64 = {
"NeXTstep/OpenStep/Rhapsody/Darwin/MacOS X (x86_64) object files",
"macho64",
0,
64,
- null_debug_arr,
- &null_debug_form,
+ macho64_df_arr,
+ &macho64_df_dwarf,
macho_stdmac,
macho64_init,
nasm_do_legacy_output,