1 /* OS ABI variant handling for GDB.
2 Copyright (C) 2001-2024 Free Software Foundation, Inc.
4 This file is part of GDB.
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>. */
22 #include "gdbsupport/osabi.h"
24 /* Register an OS ABI sniffer. Each arch/flavour may have more than
25 one sniffer. This is used to e.g. differentiate one OS's a.out from
26 another. The first sniffer to return something other than
27 GDB_OSABI_UNKNOWN wins, so a sniffer should be careful to claim a file
28 only if it knows for sure what it is. */
29 void gdbarch_register_osabi_sniffer (enum bfd_architecture
,
31 enum gdb_osabi (*)(bfd
*));
33 /* Register a handler for an OS ABI variant for a given architecture
34 and machine type. There should be only one handler for a given OS
35 ABI for each architecture and machine type combination. */
36 void gdbarch_register_osabi (enum bfd_architecture
, unsigned long,
38 void (*)(struct gdbarch_info
,
41 /* Lookup the OS ABI corresponding to the specified BFD. */
42 enum gdb_osabi
gdbarch_lookup_osabi (bfd
*);
44 /* Return true if there's an OS ABI handler for INFO. */
45 bool has_gdb_osabi_handler (struct gdbarch_info info
);
47 /* Initialize the gdbarch for the specified OS ABI variant. */
48 void gdbarch_init_osabi (struct gdbarch_info
, struct gdbarch
*);
50 /* Helper routine for ELF file sniffers. This looks at ABI tag note
51 sections to determine the OS ABI from the note. */
52 void generic_elf_osabi_sniff_abi_tag_sections (bfd
*, asection
*,
55 /* Return a string version of OSABI. This is used when generating code
56 which calls set_tdesc_osabi and an 'enum gdb_osabi' value is needed. */
57 const char *gdbarch_osabi_enum_name (enum gdb_osabi osabi
);
59 #endif /* GDB_OSABI_H */