15796c8dcSSimon Schubert /* OS ABI variant handling for GDB. 2*ef5ccd6cSJohn Marino Copyright (C) 2001-2013 Free Software Foundation, Inc. 35796c8dcSSimon Schubert 45796c8dcSSimon Schubert This file is part of GDB. 55796c8dcSSimon Schubert 65796c8dcSSimon Schubert This program is free software; you can redistribute it and/or modify 75796c8dcSSimon Schubert it under the terms of the GNU General Public License as published by 85796c8dcSSimon Schubert the Free Software Foundation; either version 3 of the License, or 95796c8dcSSimon Schubert (at your option) any later version. 105796c8dcSSimon Schubert 115796c8dcSSimon Schubert This program is distributed in the hope that it will be useful, 125796c8dcSSimon Schubert but WITHOUT ANY WARRANTY; without even the implied warranty of 135796c8dcSSimon Schubert MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 145796c8dcSSimon Schubert GNU General Public License for more details. 155796c8dcSSimon Schubert 165796c8dcSSimon Schubert You should have received a copy of the GNU General Public License 175796c8dcSSimon Schubert along with this program. If not, see <http://www.gnu.org/licenses/>. */ 185796c8dcSSimon Schubert 195796c8dcSSimon Schubert #ifndef OSABI_H 205796c8dcSSimon Schubert #define OSABI_H 215796c8dcSSimon Schubert 225796c8dcSSimon Schubert /* Register an OS ABI sniffer. Each arch/flavour may have more than 235796c8dcSSimon Schubert one sniffer. This is used to e.g. differentiate one OS's a.out from 245796c8dcSSimon Schubert another. The first sniffer to return something other than 255796c8dcSSimon Schubert GDB_OSABI_UNKNOWN wins, so a sniffer should be careful to claim a file 265796c8dcSSimon Schubert only if it knows for sure what it is. */ 275796c8dcSSimon Schubert void gdbarch_register_osabi_sniffer (enum bfd_architecture, 285796c8dcSSimon Schubert enum bfd_flavour, 295796c8dcSSimon Schubert enum gdb_osabi (*)(bfd *)); 305796c8dcSSimon Schubert 315796c8dcSSimon Schubert /* Register a handler for an OS ABI variant for a given architecture 325796c8dcSSimon Schubert and machine type. There should be only one handler for a given OS 335796c8dcSSimon Schubert ABI for each architecture and machine type combination. */ 345796c8dcSSimon Schubert void gdbarch_register_osabi (enum bfd_architecture, unsigned long, 355796c8dcSSimon Schubert enum gdb_osabi, 365796c8dcSSimon Schubert void (*)(struct gdbarch_info, 375796c8dcSSimon Schubert struct gdbarch *)); 385796c8dcSSimon Schubert 395796c8dcSSimon Schubert /* Lookup the OS ABI corresponding to the specified BFD. */ 405796c8dcSSimon Schubert enum gdb_osabi gdbarch_lookup_osabi (bfd *); 415796c8dcSSimon Schubert 425796c8dcSSimon Schubert /* Lookup the OS ABI corresponding to the specified target description 435796c8dcSSimon Schubert string. */ 445796c8dcSSimon Schubert enum gdb_osabi osabi_from_tdesc_string (const char *text); 455796c8dcSSimon Schubert 465796c8dcSSimon Schubert /* Initialize the gdbarch for the specified OS ABI variant. */ 475796c8dcSSimon Schubert void gdbarch_init_osabi (struct gdbarch_info, struct gdbarch *); 485796c8dcSSimon Schubert 495796c8dcSSimon Schubert /* Return the name of the specified OS ABI. */ 505796c8dcSSimon Schubert const char *gdbarch_osabi_name (enum gdb_osabi); 515796c8dcSSimon Schubert 525796c8dcSSimon Schubert /* Helper routine for ELF file sniffers. This looks at ABI tag note 535796c8dcSSimon Schubert sections to determine the OS ABI from the note. It should be called 545796c8dcSSimon Schubert via bfd_map_over_sections. */ 555796c8dcSSimon Schubert void generic_elf_osabi_sniff_abi_tag_sections (bfd *, asection *, void *); 565796c8dcSSimon Schubert 575796c8dcSSimon Schubert #endif /* OSABI_H */ 58