#include "gdb_stat.h"
#include "completer.h"
#include "exceptions.h"
+#include "observer.h"
/* Local function declarations. */
bfd *core_bfd = NULL;
-/* corelow.c target (if included for this gdb target). */
+/* corelow.c target. It is never NULL after GDB initialization. */
struct target_ops *core_target;
\f
{
dont_repeat (); /* Either way, seems bogus. */
- if (core_target == NULL)
- error (_("GDB can't read core files on this machine."));
+ gdb_assert (core_target != NULL);
if (!filename)
(core_target->to_detach) (core_target, filename, from_tty);
bounds. */
throw_error (MEMORY_ERROR,
_("Cannot access memory at address %s"),
- paddress (target_gdbarch, memaddr));
+ paddress (target_gdbarch (), memaddr));
else
throw_error (MEMORY_ERROR,
_("Error accessing memory address %s: %s."),
- paddress (target_gdbarch, memaddr),
+ paddress (target_gdbarch (), memaddr),
safe_strerror (status));
}
/* Same as target_read_memory, but report an error if can't read. */
void
-read_memory (CORE_ADDR memaddr, gdb_byte *myaddr, int len)
+read_memory (CORE_ADDR memaddr, gdb_byte *myaddr, ssize_t len)
{
int status;
/* Same as target_read_stack, but report an error if can't read. */
void
-read_stack (CORE_ADDR memaddr, gdb_byte *myaddr, int len)
+read_stack (CORE_ADDR memaddr, gdb_byte *myaddr, ssize_t len)
{
int status;
write. */
void
write_memory (CORE_ADDR memaddr,
- const bfd_byte *myaddr, int len)
+ const bfd_byte *myaddr, ssize_t len)
{
int status;
memory_error (status, memaddr);
}
+/* Same as write_memory, but notify 'memory_changed' observers. */
+
+void
+write_memory_with_notification (CORE_ADDR memaddr, const bfd_byte *myaddr,
+ ssize_t len)
+{
+ write_memory (memaddr, myaddr, len);
+ observer_notify_memory_changed (current_inferior (), memaddr, len, myaddr);
+}
+
/* Store VALUE at ADDR in the inferior as a LEN-byte unsigned
integer. */
void