GDB (API)
/home/stan/gdb/src/gdb/i386-dicos-tdep.c
Go to the documentation of this file.
00001 /* Target-dependent code for DICOS running on i386's, for GDB.
00002 
00003    Copyright (C) 2008-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 "dicos-tdep.h"
00024 
00025 static void
00026 i386_dicos_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
00027 {
00028   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
00029 
00030   dicos_init_abi (gdbarch);
00031 }
00032 
00033 static enum gdb_osabi
00034 i386_dicos_osabi_sniffer (bfd *abfd)
00035 {
00036   char *target_name = bfd_get_target (abfd);
00037 
00038   /* On x86-DICOS, the Load Module's "header" section is 36 bytes.  */
00039   if (strcmp (target_name, "elf32-i386") == 0
00040       && dicos_load_module_p (abfd, 36))
00041     return GDB_OSABI_DICOS;
00042 
00043   return GDB_OSABI_UNKNOWN;
00044 }
00045 
00046 /* Provide a prototype to silence -Wmissing-prototypes.  */
00047 void _initialize_i386_dicos_tdep (void);
00048 
00049 void
00050 _initialize_i386_dicos_tdep (void)
00051 {
00052   gdbarch_register_osabi_sniffer (bfd_arch_i386, bfd_target_elf_flavour,
00053                                   i386_dicos_osabi_sniffer);
00054 
00055   gdbarch_register_osabi (bfd_arch_i386, 0, GDB_OSABI_DICOS,
00056                           i386_dicos_init_abi);
00057 }
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines