GDB (API)
/home/stan/gdb/src/gdb/amd64-dicos-tdep.c
Go to the documentation of this file.
00001 /* Target-dependent code for DICOS running on x86-64's, for GDB.
00002 
00003    Copyright (C) 2009-2013 Free Software Foundation, Inc.
00004 
00005    This file is part of GDB.
00006 
00007    This program is free software; you can redistribute it and/or modify
00008    it under the terms of the GNU General Public License as published by
00009    the Free Software Foundation; either version 3 of the License, or
00010    (at your option) any later version.
00011 
00012    This program is distributed in the hope that it will be useful,
00013    but WITHOUT ANY WARRANTY; without even the implied warranty of
00014    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015    GNU General Public License for more details.
00016 
00017    You should have received a copy of the GNU General Public License
00018    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
00019 
00020 #include "defs.h"
00021 #include "osabi.h"
00022 #include "gdb_string.h"
00023 #include "amd64-tdep.h"
00024 #include "dicos-tdep.h"
00025 
00026 static void
00027 amd64_dicos_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
00028 {
00029   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
00030 
00031   amd64_init_abi (info, gdbarch);
00032 
00033   dicos_init_abi (gdbarch);
00034 }
00035 
00036 static enum gdb_osabi
00037 amd64_dicos_osabi_sniffer (bfd *abfd)
00038 {
00039   char *target_name = bfd_get_target (abfd);
00040 
00041   /* On amd64-DICOS, the Load Module's "header" section is 72
00042      bytes.  */
00043   if (strcmp (target_name, "elf64-x86-64") == 0
00044       && dicos_load_module_p (abfd, 72))
00045     return GDB_OSABI_DICOS;
00046 
00047   return GDB_OSABI_UNKNOWN;
00048 }
00049 
00050 /* Provide a prototype to silence -Wmissing-prototypes.  */
00051 void _initialize_amd64_dicos_tdep (void);
00052 
00053 void
00054 _initialize_amd64_dicos_tdep (void)
00055 {
00056   gdbarch_register_osabi_sniffer (bfd_arch_i386, bfd_target_elf_flavour,
00057                                   amd64_dicos_osabi_sniffer);
00058 
00059   gdbarch_register_osabi (bfd_arch_i386, bfd_mach_x86_64,
00060                           GDB_OSABI_DICOS,
00061                           amd64_dicos_init_abi);
00062 }
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines