/* Machine independent variables that describe the core file under GDB.
- Copyright (C) 1986-1987, 1989-2001, 2004, 2007-2012 Free Software
- Foundation, Inc.
+ Copyright (C) 1986-2017 Free Software Foundation, Inc.
This file is part of GDB.
#include "bfd.h"
#include "exec.h"
+#include "target.h"
/* Return the name of the executable file as a string.
ERR nonzero means get error if there is none specified;
/* Report a memory error with error(). */
-extern void memory_error (int status, CORE_ADDR memaddr);
+extern void memory_error (enum target_xfer_status status, CORE_ADDR memaddr);
+
+/* The string 'memory_error' would use as exception message. Space
+ for the result is malloc'd, caller must free. */
+
+extern char *memory_error_message (enum target_xfer_status err,
+ struct gdbarch *gdbarch, CORE_ADDR memaddr);
/* Like target_read_memory, but report an error if can't read. */
extern void read_stack (CORE_ADDR memaddr, gdb_byte *myaddr, ssize_t len);
+/* Like target_read_code, but report an error if can't read. */
+
+extern void read_code (CORE_ADDR memaddr, gdb_byte *myaddr, ssize_t len);
+
/* Read an integer from debugged memory, given address and number of
bytes. */
extern ULONGEST read_memory_unsigned_integer (CORE_ADDR memaddr,
int len,
enum bfd_endian byte_order);
+extern int safe_read_memory_unsigned_integer (CORE_ADDR memaddr, int len,
+ enum bfd_endian byte_order,
+ ULONGEST *return_value);
+
+/* Read an integer from debugged code memory, given address,
+ number of bytes, and byte order for code. */
+
+extern LONGEST read_code_integer (CORE_ADDR memaddr, int len,
+ enum bfd_endian byte_order);
+
+/* Read an unsigned integer from debugged code memory, given address,
+ number of bytes, and byte order for code. */
+
+extern ULONGEST read_code_unsigned_integer (CORE_ADDR memaddr,
+ int len,
+ enum bfd_endian byte_order);
/* Read a null-terminated string from the debuggee's memory, given
address, a buffer into which to place the string, and the maximum
CORE_ADDR read_memory_typed_address (CORE_ADDR addr, struct type *type);
-/* This takes a char *, not void *. This is probably right, because
- passing in an int * or whatever is wrong with respect to
- byteswapping, alignment, different sizes for host vs. target types,
- etc. */
+/* Same as target_write_memory, but report an error if can't
+ write. */
extern void write_memory (CORE_ADDR memaddr, const gdb_byte *myaddr,
ssize_t len);
+/* Same as write_memory, but notify 'memory_changed' observers. */
+
+extern void write_memory_with_notification (CORE_ADDR memaddr,
+ const bfd_byte *myaddr,
+ ssize_t len);
+
/* Store VALUE at ADDR in the inferior as a LEN-byte unsigned integer. */
extern void write_memory_unsigned_integer (CORE_ADDR addr, int len,
enum bfd_endian byte_order,
\f
/* Hook for `exec_file_command' command to call. */
-extern void (*deprecated_exec_file_display_hook) (char *filename);
+extern void (*deprecated_exec_file_display_hook) (const char *filename);
/* Hook for "file_command", which is more useful than above
(because it is invoked AFTER symbols are read, not before). */
extern void (*deprecated_file_changed_hook) (char *filename);
-extern void specify_exec_file_hook (void (*hook) (char *filename));
+extern void specify_exec_file_hook (void (*hook) (const char *filename));
/* Binary File Diddler for the core file. */
extern void core_file_command (char *filename, int from_tty);
-extern void exec_file_attach (char *filename, int from_tty);
+extern void exec_file_attach (const char *filename, int from_tty);
+
+/* If the filename of the main executable is unknown, attempt to
+ determine it. If a filename is determined, proceed as though
+ it was just specified with the "file" command. Do nothing if
+ the filename of the main executable is already known.
+ DEFER_BP_RESET uses SYMFILE_DEFER_BP_RESET for the main symbol file. */
+
+extern void exec_file_locate_attach (int pid, int defer_bp_reset, int from_tty);
extern void exec_file_clear (int from_tty);
extern int default_core_sniffer (struct core_fns *cf, bfd * abfd);
extern int default_check_format (bfd * abfd);
-struct target_section *deprecated_core_resize_section_table (int num_added);
-
#endif /* !defined (GDBCORE_H) */