/* Machine independent variables that describe the core file under GDB.
Copyright 1986, 1987, 1989, 1990, 1992, 1995 Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
/* Interface routines for core, executable, etc. */
extern void read_memory PARAMS ((CORE_ADDR memaddr, char *myaddr, int len));
extern void read_memory_section PARAMS ((CORE_ADDR memaddr, char *myaddr,
- int len, asection *bfd_section));
+ int len, asection * bfd_section));
/* Read an integer from debugged memory, given address and number of
bytes. */
extern ULONGEST read_memory_unsigned_integer PARAMS ((CORE_ADDR memaddr, int len));
/* Read a null-terminated string from the debuggee's memory, given address,
- * a buffer into which to place the string, and the maximum available space */
+ * a buffer into which to place the string, and the maximum available space */
extern void read_memory_string PARAMS ((CORE_ADDR, char *, int));
/* This takes a char *, not void *. This is probably right, because
extern void generic_search PARAMS ((int len, char *data, char *mask,
CORE_ADDR startaddr, int increment,
CORE_ADDR lorange, CORE_ADDR hirange,
- CORE_ADDR *addr_found, char *data_found));
+ CORE_ADDR * addr_found, char *data_found));
\f
/* Hook for `exec_file_command' command to call. */
/* Structure to keep track of core register reading functions for
various core file types. */
-struct core_fns {
+struct core_fns
+ {
- /* BFD flavour that we handle. Note that bfd_target_unknown_flavour matches
- anything, and if there is no better match, this function will be called
- as the default. */
+ /* BFD flavour that a core file handler is prepared to read. This
+ can be used by the handler's core tasting function as a first
+ level filter to reject BFD's that don't have the right
+ flavour. */
- enum bfd_flavour core_flavour;
+ enum bfd_flavour core_flavour;
- /* Extract the register values out of the core file and store them where
- `read_register' will find them.
+ /* Core file handler function to call to recognize corefile
+ formats that BFD rejects. Some core file format just don't fit
+ into the BFD model, or may require other resources to identify
+ them, that simply aren't available to BFD (such as symbols from
+ another file). Returns nonzero if the handler recognizes the
+ format, zero otherwise. */
- CORE_REG_SECT points to the register values themselves, read into
- memory.
+ int (*check_format) PARAMS ((bfd *));
- CORE_REG_SIZE is the size of that area.
+ /* Core file handler function to call to ask if it can handle a
+ given core file format or not. Returns zero if it can't,
+ nonzero otherwise. */
- WHICH says which set of registers we are handling (0 = int, 2 = float on
- machines where they are discontiguous).
+ int (*core_sniffer) PARAMS ((struct core_fns *, bfd *));
- REG_ADDR is the offset from u.u_ar0 to the register values relative to
- core_reg_sect. This is used with old-fashioned core files to locate the
- registers in a large upage-plus-stack ".reg" section. Original upage
- address X is at location core_reg_sect+x+reg_addr. */
+ /* Extract the register values out of the core file and store them where
+ `read_register' will find them.
- void (*core_read_registers) PARAMS ((char *core_reg_sect, unsigned core_reg_size,
- int which, CORE_ADDR reg_addr));
+ CORE_REG_SECT points to the register values themselves, read into
+ memory.
- /* Finds the next struct core_fns. They are allocated and initialized
- in whatever module implements the functions pointed to; an
- initializer calls add_core_fns to add them to the global chain. */
+ CORE_REG_SIZE is the size of that area.
- struct core_fns *next;
+ WHICH says which set of registers we are handling:
+ 0 --- integer registers
+ 2 --- floating-point registers, on machines where they are
+ discontiguous
+ 3 --- extended floating-point registers, on machines where
+ these are present in yet a third area. (GNU/Linux uses
+ this to get at the SSE registers.)
-};
+ REG_ADDR is the offset from u.u_ar0 to the register values relative to
+ core_reg_sect. This is used with old-fashioned core files to locate the
+ registers in a large upage-plus-stack ".reg" section. Original upage
+ address X is at location core_reg_sect+x+reg_addr. */
-extern void add_core_fns PARAMS ((struct core_fns *cf));
+ void (*core_read_registers) PARAMS ((char *core_reg_sect,
+ unsigned core_reg_size,
+ int which, CORE_ADDR reg_addr));
-#endif /* !defined (GDBCORE_H) */
+ /* Finds the next struct core_fns. They are allocated and initialized
+ in whatever module implements the functions pointed to; an
+ initializer calls add_core_fns to add them to the global chain. */
+
+ struct core_fns *next;
+
+ };
+
+extern void add_core_fns PARAMS ((struct core_fns * cf));
+extern int default_core_sniffer PARAMS ((struct core_fns *cf, bfd *abfd));
+extern int default_check_format PARAMS ((bfd *abfd));
+
+#endif /* !defined (GDBCORE_H) */