Port to GDB-6.7.
-Index: gdb-6.8.50.20090226/gdb/symfile-mem.c
+Index: gdb-6.8.50.20090909/gdb/symfile-mem.c
===================================================================
---- gdb-6.8.50.20090226.orig/gdb/symfile-mem.c 2009-02-21 17:14:49.000000000 +0100
-+++ gdb-6.8.50.20090226/gdb/symfile-mem.c 2009-02-28 07:22:09.000000000 +0100
+--- gdb-6.8.50.20090909.orig/gdb/symfile-mem.c 2009-07-02 19:21:06.000000000 +0200
++++ gdb-6.8.50.20090909/gdb/symfile-mem.c 2009-09-09 19:06:57.000000000 +0200
@@ -56,6 +56,14 @@
#include "elf/common.h"
if (nbfd == NULL)
error (_("Failed to read a valid object file image from memory."));
-Index: gdb-6.8.50.20090226/gdb/target.c
+Index: gdb-6.8.50.20090909/gdb/target.c
===================================================================
---- gdb-6.8.50.20090226.orig/gdb/target.c 2009-02-27 00:04:32.000000000 +0100
-+++ gdb-6.8.50.20090226/gdb/target.c 2009-02-28 07:22:09.000000000 +0100
-@@ -57,7 +57,7 @@ static int nosymbol (char *, CORE_ADDR *
+--- gdb-6.8.50.20090909.orig/gdb/target.c 2009-09-09 19:05:56.000000000 +0200
++++ gdb-6.8.50.20090909/gdb/target.c 2009-09-09 19:08:11.000000000 +0200
+@@ -59,7 +59,7 @@ static int nosymbol (char *, CORE_ADDR *
static void tcomplain (void) ATTR_NORETURN;
static int return_zero (void);
-@@ -286,7 +286,7 @@ target_create_inferior (char *exec_file,
+@@ -492,7 +492,7 @@ target_terminal_inferior (void)
+ (*current_target.to_terminal_inferior) ();
}
-
-static int
+static LONGEST
nomemory (CORE_ADDR memaddr, char *myaddr, int len, int write,
struct target_ops *t)
{
-@@ -507,7 +507,7 @@ update_current_target (void)
+@@ -711,7 +711,7 @@ update_current_target (void)
(void (*) (struct regcache *))
noprocess);
de_fault (deprecated_xfer_memory,
nomemory);
de_fault (to_files_info,
(void (*) (struct target_ops *))
-@@ -1237,7 +1237,7 @@ target_xfer_partial (struct target_ops *
+@@ -1443,7 +1443,7 @@ target_xfer_partial (struct target_ops *
it makes no progress, and then return how much was transferred). */
int
-target_read_memory (CORE_ADDR memaddr, gdb_byte *myaddr, int len)
+target_read_memory (CORE_ADDR memaddr, gdb_byte *myaddr, LONGEST len)
{
- if (target_read (¤t_target, TARGET_OBJECT_MEMORY, NULL,
- myaddr, memaddr, len) == len)
-@@ -1247,7 +1247,7 @@ target_read_memory (CORE_ADDR memaddr, g
+ /* Dispatch to the topmost target, not the flattened current_target.
+ Memory accesses check target->to_has_(all_)memory, and the
+@@ -1459,7 +1459,7 @@ target_read_memory (CORE_ADDR memaddr, g
+ the target's stack. This may trigger different cache behavior. */
+
+ int
+-target_read_stack (CORE_ADDR memaddr, gdb_byte *myaddr, int len)
++target_read_stack (CORE_ADDR memaddr, gdb_byte *myaddr, LONGEST len)
+ {
+ /* Dispatch to the topmost target, not the flattened current_target.
+ Memory accesses check target->to_has_(all_)memory, and the
+@@ -1473,7 +1473,7 @@ target_read_stack (CORE_ADDR memaddr, gd
}
int
-target_write_memory (CORE_ADDR memaddr, const gdb_byte *myaddr, int len)
+target_write_memory (CORE_ADDR memaddr, const gdb_byte *myaddr, LONGEST len)
{
- if (target_write (¤t_target, TARGET_OBJECT_MEMORY, NULL,
- myaddr, memaddr, len) == len)
-@@ -2777,8 +2777,8 @@ debug_to_prepare_to_store (struct regcac
+ /* Dispatch to the topmost target, not the flattened current_target.
+ Memory accesses check target->to_has_(all_)memory, and the
+@@ -2964,8 +2964,8 @@ debug_to_prepare_to_store (struct regcac
fprintf_unfiltered (gdb_stdlog, "target_prepare_to_store ()\n");
}
int write, struct mem_attrib *attrib,
struct target_ops *target)
{
-@@ -2788,8 +2788,8 @@ deprecated_debug_xfer_memory (CORE_ADDR
+@@ -2975,8 +2975,8 @@ deprecated_debug_xfer_memory (CORE_ADDR
attrib, target);
fprintf_unfiltered (gdb_stdlog,
- "target_xfer_memory (%s, xxx, %d, %s, xxx) = %d",
-- paddress (memaddr), len, write ? "write" : "read",
+- paddress (target_gdbarch, memaddr), len,
+ "target_xfer_memory (%s, xxx, %ld, %s, xxx) = %d",
-+ paddress (memaddr), (long) len, write ? "write" : "read",
- retval);
++ paddress (target_gdbarch, memaddr), (long) len,
+ write ? "write" : "read", retval);
if (retval > 0)
-Index: gdb-6.8.50.20090226/gdb/target.h
+Index: gdb-6.8.50.20090909/gdb/target.h
===================================================================
---- gdb-6.8.50.20090226.orig/gdb/target.h 2009-02-27 00:04:32.000000000 +0100
-+++ gdb-6.8.50.20090226/gdb/target.h 2009-02-28 07:22:09.000000000 +0100
-@@ -376,10 +376,10 @@ struct target_ops
+--- gdb-6.8.50.20090909.orig/gdb/target.h 2009-09-09 19:05:56.000000000 +0200
++++ gdb-6.8.50.20090909/gdb/target.h 2009-09-09 19:07:36.000000000 +0200
+@@ -366,10 +366,10 @@ struct target_ops
NOTE: cagney/2004-10-01: This has been entirely superseeded by
to_xfer_partial and inferior inheritance. */
+ struct target_ops *target);
void (*to_files_info) (struct target_ops *);
- int (*to_insert_breakpoint) (struct bp_target_info *);
-@@ -679,13 +679,14 @@ extern DCACHE *target_dcache;
+ int (*to_insert_breakpoint) (struct gdbarch *, struct bp_target_info *);
+@@ -680,12 +680,12 @@ extern void target_dcache_invalidate (vo
extern int target_read_string (CORE_ADDR, char **, int, int *);
-extern int target_read_memory (CORE_ADDR memaddr, gdb_byte *myaddr, int len);
-+extern int target_read_memory (CORE_ADDR memaddr, gdb_byte *myaddr,
-+ LONGEST len);
++extern int target_read_memory (CORE_ADDR memaddr, gdb_byte *myaddr, LONGEST len);
+
+-extern int target_read_stack (CORE_ADDR memaddr, gdb_byte *myaddr, int len);
++extern int target_read_stack (CORE_ADDR memaddr, gdb_byte *myaddr, LONGEST len);
extern int target_write_memory (CORE_ADDR memaddr, const gdb_byte *myaddr,
- int len);
+ LONGEST len);
--extern int xfer_memory (CORE_ADDR, gdb_byte *, int, int,
-- struct mem_attrib *, struct target_ops *);
-+extern LONGEST xfer_memory (CORE_ADDR, gdb_byte *, LONGEST, int,
-+ struct mem_attrib *, struct target_ops *);
-
/* Fetches the target's memory map. If one is found it is sorted
and returned, after some consistency checking. Otherwise, NULL
-Index: gdb-6.8.50.20090226/gdb/dcache.c
+Index: gdb-6.8.50.20090909/gdb/dcache.c
===================================================================
---- gdb-6.8.50.20090226.orig/gdb/dcache.c 2009-01-03 06:57:51.000000000 +0100
-+++ gdb-6.8.50.20090226/gdb/dcache.c 2009-02-28 07:22:09.000000000 +0100
-@@ -524,9 +524,9 @@ dcache_free (DCACHE *dcache)
+--- gdb-6.8.50.20090909.orig/gdb/dcache.c 2009-08-31 22:18:45.000000000 +0200
++++ gdb-6.8.50.20090909/gdb/dcache.c 2009-09-09 19:09:21.000000000 +0200
+@@ -390,10 +390,10 @@ dcache_free (DCACHE *dcache)
- This routine is indended to be called by remote_xfer_ functions. */
+ The meaning of the result is the same as for target_write. */
-int
+LONGEST
- dcache_xfer_memory (DCACHE *dcache, CORE_ADDR memaddr, gdb_byte *myaddr,
+ dcache_xfer_memory (struct target_ops *ops, DCACHE *dcache,
+ CORE_ADDR memaddr, gdb_byte *myaddr,
- int len, int should_write)
+ LONGEST len, int should_write)
{
int i;
- int (*xfunc) (DCACHE *dcache, CORE_ADDR addr, gdb_byte *ptr);
-Index: gdb-6.8.50.20090226/gdb/dcache.h
+ int res;
+Index: gdb-6.8.50.20090909/gdb/dcache.h
===================================================================
---- gdb-6.8.50.20090226.orig/gdb/dcache.h 2009-01-03 06:57:51.000000000 +0100
-+++ gdb-6.8.50.20090226/gdb/dcache.h 2009-02-28 07:22:09.000000000 +0100
-@@ -35,7 +35,7 @@ void dcache_free (DCACHE *);
+--- gdb-6.8.50.20090909.orig/gdb/dcache.h 2009-08-31 22:18:45.000000000 +0200
++++ gdb-6.8.50.20090909/gdb/dcache.h 2009-09-09 19:08:54.000000000 +0200
+@@ -35,8 +35,8 @@ void dcache_free (DCACHE *);
/* Simple to call from <remote>_xfer_memory */
--int dcache_xfer_memory (DCACHE *cache, CORE_ADDR mem, gdb_byte *my,
-- int len, int should_write);
-+LONGEST dcache_xfer_memory (DCACHE *cache, CORE_ADDR mem, gdb_byte *my,
-+ LONGEST len, int should_write);
+-int dcache_xfer_memory (struct target_ops *ops, DCACHE *cache, CORE_ADDR mem,
+- gdb_byte *my, int len, int should_write);
++LONGEST dcache_xfer_memory (struct target_ops *ops, DCACHE *cache, CORE_ADDR mem,
++ gdb_byte *my, LONGEST len, int should_write);
- #endif /* DCACHE_H */
-Index: gdb-6.8.50.20090226/gdb/exec.c
+ void dcache_update (DCACHE *dcache, CORE_ADDR memaddr, gdb_byte *myaddr,
+ int len);
+Index: gdb-6.8.50.20090909/gdb/exec.c
===================================================================
---- gdb-6.8.50.20090226.orig/gdb/exec.c 2009-02-22 20:35:47.000000000 +0100
-+++ gdb-6.8.50.20090226/gdb/exec.c 2009-02-28 07:22:09.000000000 +0100
-@@ -464,8 +464,8 @@ map_vmap (bfd *abfd, bfd *arch)
- The same routine is used to handle both core and exec files;
- we just tail-call it with more arguments to select between them. */
+--- gdb-6.8.50.20090909.orig/gdb/exec.c 2009-07-02 19:21:06.000000000 +0200
++++ gdb-6.8.50.20090909/gdb/exec.c 2009-09-09 19:06:57.000000000 +0200
+@@ -560,7 +560,7 @@ map_vmap (bfd *abfd, bfd *arch)
+ }
+ \f
-int
--xfer_memory (CORE_ADDR memaddr, gdb_byte *myaddr, int len, int write,
+LONGEST
-+xfer_memory (CORE_ADDR memaddr, gdb_byte *myaddr, LONGEST len, int write,
- struct mem_attrib *attrib, struct target_ops *target)
- {
- int res;
-Index: gdb-6.8.50.20090226/gdb/linux-nat.c
+ section_table_xfer_memory_partial (gdb_byte *readbuf, const gdb_byte *writebuf,
+ ULONGEST offset, LONGEST len,
+ struct target_section *sections,
+Index: gdb-6.8.50.20090909/gdb/linux-nat.c
===================================================================
---- gdb-6.8.50.20090226.orig/gdb/linux-nat.c 2009-02-28 07:22:02.000000000 +0100
-+++ gdb-6.8.50.20090226/gdb/linux-nat.c 2009-02-28 07:22:32.000000000 +0100
-@@ -4407,7 +4407,7 @@ linux_xfer_partial (struct target_ops *o
+--- gdb-6.8.50.20090909.orig/gdb/linux-nat.c 2009-09-09 19:06:46.000000000 +0200
++++ gdb-6.8.50.20090909/gdb/linux-nat.c 2009-09-09 19:06:57.000000000 +0200
+@@ -4622,7 +4622,7 @@ linux_xfer_partial (struct target_ops *o
#endif
if (iterate_over_lwps (ia64_linux_check_stack_region, &range) != NULL)
{ /* This region contains ia64 rse registers, we have to re-read. */
/* Re-read register stack area. */
xxfer = super_xfer_partial (ops, object, annex,
-Index: gdb-6.8.50.20090226/gdb/remote.c
+Index: gdb-6.8.50.20090909/gdb/remote.c
===================================================================
---- gdb-6.8.50.20090226.orig/gdb/remote.c 2009-02-25 03:14:22.000000000 +0100
-+++ gdb-6.8.50.20090226/gdb/remote.c 2009-02-28 07:22:09.000000000 +0100
+--- gdb-6.8.50.20090909.orig/gdb/remote.c 2009-08-18 18:17:16.000000000 +0200
++++ gdb-6.8.50.20090909/gdb/remote.c 2009-09-09 19:06:57.000000000 +0200
@@ -25,6 +25,7 @@
#include "gdb_string.h"
#include <ctype.h>
#include "inferior.h"
#include "bfd.h"
#include "symfile.h"
-@@ -5683,12 +5684,19 @@ handle_notification (char *buf, size_t l
+@@ -5764,12 +5765,19 @@ handle_notification (char *buf, size_t l
if SHOULD_WRITE is nonzero. Returns length of data written or
read; 0 for error. TARGET is unused. */
set_general_thread (inferior_ptid);
-@@ -5697,7 +5705,7 @@ remote_xfer_memory (CORE_ADDR mem_addr,
+@@ -5778,7 +5786,7 @@ remote_xfer_memory (CORE_ADDR mem_addr,
else
res = remote_read_bytes (mem_addr, buffer, mem_len);
}
/* Sends a packet with content determined by the printf format string
-Index: gdb-6.8.50.20090226/gdb/remote-sim.c
+Index: gdb-6.8.50.20090909/gdb/remote-sim.c
===================================================================
---- gdb-6.8.50.20090226.orig/gdb/remote-sim.c 2009-02-23 19:31:23.000000000 +0100
-+++ gdb-6.8.50.20090226/gdb/remote-sim.c 2009-02-28 07:22:09.000000000 +0100
-@@ -754,11 +754,14 @@ gdbsim_prepare_to_store (struct regcache
+--- gdb-6.8.50.20090909.orig/gdb/remote-sim.c 2009-07-02 19:21:06.000000000 +0200
++++ gdb-6.8.50.20090909/gdb/remote-sim.c 2009-09-09 19:06:57.000000000 +0200
+@@ -752,11 +752,14 @@ gdbsim_prepare_to_store (struct regcache
Returns the number of bytes transferred. */
/* If no program is running yet, then ignore the simulator for
memory. Pass the request down to the next target, hopefully
an exec file. */
-@@ -774,22 +777,22 @@ gdbsim_xfer_inferior_memory (CORE_ADDR m
- printf_filtered ("gdbsim_xfer_inferior_memory: myaddr 0x");
- gdb_print_host_address (myaddr, gdb_stdout);
- printf_filtered (", memaddr 0x%s, len %d, write %d\n",
-- paddr_nz (memaddr), len, write);
-+ paddr_nz (memaddr), xfer_len, write);
- if (remote_debug && write)
-- dump_mem (myaddr, len);
-+ dump_mem (myaddr, xfer_len);
- }
-
- if (write)
- {
-- len = sim_write (gdbsim_desc, memaddr, myaddr, len);
-+ xfer_len = sim_write (gdbsim_desc, memaddr, myaddr, xfer_len);
- }
- else
- {
-- len = sim_read (gdbsim_desc, memaddr, myaddr, len);
-- if (remote_debug && len > 0)
-- dump_mem (myaddr, len);
-+ xfer_len = sim_read (gdbsim_desc, memaddr, myaddr, xfer_len);
-+ if (remote_debug && xfer_len > 0)
-+ dump_mem (myaddr, xfer_len);
- }
-- return len;
-+ return (LONGEST)xfer_len;
- }
+Index: gdb-6.8.50.20090909/gdb/exec.h
+===================================================================
+--- gdb-6.8.50.20090909.orig/gdb/exec.h 2009-06-12 20:38:36.000000000 +0200
++++ gdb-6.8.50.20090909/gdb/exec.h 2009-09-09 19:06:57.000000000 +0200
+@@ -56,7 +56,7 @@ extern int resize_section_table (struct
+
+ One, and only one, of readbuf or writebuf must be non-NULL. */
- static void
+-extern int section_table_xfer_memory_partial (gdb_byte *, const gdb_byte *,
++extern LONGEST section_table_xfer_memory_partial (gdb_byte *, const gdb_byte *,
+ ULONGEST, LONGEST,
+ struct target_section *,
+ struct target_section *,