diff options
author | Yao Qi <yao@codesourcery.com> | 2013-11-04 17:53:56 +0800 |
---|---|---|
committer | Yao Qi <yao@codesourcery.com> | 2013-12-18 11:47:03 +0800 |
commit | 4ac248ca0beb1dfdb56716a440c4558b89fd7b1a (patch) | |
tree | cddff8dd11f2b414f47ccb5ff1b44e5290121543 /gdb | |
parent | cde33bf1035aac8e2e35c4699544dcc166f2054d (diff) | |
download | gdb-4ac248ca0beb1dfdb56716a440c4558b89fd7b1a.zip gdb-4ac248ca0beb1dfdb56716a440c4558b89fd7b1a.tar.gz gdb-4ac248ca0beb1dfdb56716a440c4558b89fd7b1a.tar.bz2 |
Add target_xfer_partial_ftype
This patch adds a typedef target_xfer_partial_ftype. When we change
the signature of xfer_partial functions (for example, adding a new
parameter), we don't have to modify all of their declarations.
This patch also updates the type of parameters of target_xfer_partial
from "void *" to "gdb_byte *".
gdb:
2013-12-18 Yao Qi <yao@codesourcery.com>
* target.h (target_xfer_partial_ftype): New typedef.
(target_xfer_partial): Update declaration.
* auxv.h (memory_xfer_auxv): Likewise.
* ia64-hpux-nat.c (super_xfer_partial): Likewise.
* ia64-linux-nat.c (super_xfer_partial): Likewise.
* linux-nat.c (super_xfer_partial): Likewise.
* procfs.c (procfs_xfer_partial): Likewise.
* record-full.c (record_full_beneath_to_xfer_partial):
(tmp_to_xfer_partial): Likewise.
* sparc-nat.c (inf_ptrace_xfer_partial): Likewise.
* target.c (default_xfer_partial): Likewise.
(current_xfer_partial): Likewise.
(target_xfer_partial): Change parameter type to 'gdb_byte *'.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 16 | ||||
-rw-r--r-- | gdb/auxv.h | 8 | ||||
-rw-r--r-- | gdb/ia64-hpux-nat.c | 4 | ||||
-rw-r--r-- | gdb/ia64-linux-nat.c | 4 | ||||
-rw-r--r-- | gdb/linux-nat.c | 6 | ||||
-rw-r--r-- | gdb/procfs.c | 7 | ||||
-rw-r--r-- | gdb/record-full.c | 17 | ||||
-rw-r--r-- | gdb/sparc-nat.c | 4 | ||||
-rw-r--r-- | gdb/target.c | 16 | ||||
-rw-r--r-- | gdb/target.h | 16 |
10 files changed, 38 insertions, 60 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 196bcb0..7d9308f 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,21 @@ 2013-12-18 Yao Qi <yao@codesourcery.com> + * target.h (target_xfer_partial_ftype): New typedef. + (target_xfer_partial): Update declaration. + * auxv.h (memory_xfer_auxv): Likewise. + * ia64-hpux-nat.c (super_xfer_partial): Likewise. + * ia64-linux-nat.c (super_xfer_partial): Likewise. + * linux-nat.c (super_xfer_partial): Likewise. + * procfs.c (procfs_xfer_partial): Likewise. + * record-full.c (record_full_beneath_to_xfer_partial): + (tmp_to_xfer_partial): Likewise. + * sparc-nat.c (inf_ptrace_xfer_partial): Likewise. + * target.c (default_xfer_partial): Likewise. + (current_xfer_partial): Likewise. + (target_xfer_partial): Change parameter type to 'gdb_byte *'. + +2013-12-18 Yao Qi <yao@codesourcery.com> + * linux-nat.c (linux_proc_xfer_partial): Call xsnprintf instead of sprintf. (linux_nat_detach, linux_child_pid_to_exec_file): Likewise. @@ -42,13 +42,7 @@ extern int target_auxv_search (struct target_ops *ops, /* Print the contents of the target's AUXV on the specified file. */ extern int fprint_target_auxv (struct ui_file *file, struct target_ops *ops); -extern LONGEST memory_xfer_auxv (struct target_ops *ops, - enum target_object object, - const char *annex, - gdb_byte *readbuf, - const gdb_byte *writebuf, - ULONGEST offset, - LONGEST len); +extern target_xfer_partial_ftype memory_xfer_auxv; #endif diff --git a/gdb/ia64-hpux-nat.c b/gdb/ia64-hpux-nat.c index e4e1d32..48aa6de 100644 --- a/gdb/ia64-hpux-nat.c +++ b/gdb/ia64-hpux-nat.c @@ -337,9 +337,7 @@ ia64_hpux_store_registers (struct target_ops *ops, need to be handled manually. So we override this routine and delegate back if we detect that we are not in a special case. */ -static LONGEST (*super_xfer_partial) (struct target_ops *, enum target_object, - const char *, gdb_byte *, - const gdb_byte *, ULONGEST, LONGEST); +static target_xfer_partial_ftype *super_xfer_partial; /* The "xfer_partial" routine for a memory region that is completely outside of the backing-store region. */ diff --git a/gdb/ia64-linux-nat.c b/gdb/ia64-linux-nat.c index edc1e23..fd3a8de 100644 --- a/gdb/ia64-linux-nat.c +++ b/gdb/ia64-linux-nat.c @@ -833,9 +833,7 @@ ia64_linux_store_registers (struct target_ops *ops, } -static LONGEST (*super_xfer_partial) (struct target_ops *, enum target_object, - const char *, gdb_byte *, - const gdb_byte *, ULONGEST, LONGEST); +static target_xfer_partial_ftype *super_xfer_partial; static LONGEST ia64_linux_xfer_partial (struct target_ops *ops, diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c index a34b29a..88af3b5 100644 --- a/gdb/linux-nat.c +++ b/gdb/linux-nat.c @@ -200,11 +200,7 @@ static int (*linux_nat_siginfo_fixup) (siginfo_t *, /* The saved to_xfer_partial method, inherited from inf-ptrace.c. Called by our to_xfer_partial. */ -static LONGEST (*super_xfer_partial) (struct target_ops *, - enum target_object, - const char *, gdb_byte *, - const gdb_byte *, - ULONGEST, LONGEST); +static target_xfer_partial_ftype *super_xfer_partial; static unsigned int debug_linux_nat; static void diff --git a/gdb/procfs.c b/gdb/procfs.c index ef9bb3d..4ee0fa8 100644 --- a/gdb/procfs.c +++ b/gdb/procfs.c @@ -129,12 +129,7 @@ static ptid_t procfs_wait (struct target_ops *, static int procfs_xfer_memory (CORE_ADDR, gdb_byte *, int, int, struct mem_attrib *attrib, struct target_ops *); -static LONGEST procfs_xfer_partial (struct target_ops *ops, - enum target_object object, - const char *annex, - gdb_byte *readbuf, - const gdb_byte *writebuf, - ULONGEST offset, LONGEST len); +static target_xfer_partial_ftype procfs_xfer_partial; static int procfs_thread_alive (struct target_ops *ops, ptid_t); diff --git a/gdb/record-full.c b/gdb/record-full.c index f9af408..dfb033b 100644 --- a/gdb/record-full.c +++ b/gdb/record-full.c @@ -228,14 +228,7 @@ static void (*record_full_beneath_to_store_registers) (struct target_ops *, struct regcache *, int regno); static struct target_ops *record_full_beneath_to_xfer_partial_ops; -static LONGEST - (*record_full_beneath_to_xfer_partial) (struct target_ops *ops, - enum target_object object, - const char *annex, - gdb_byte *readbuf, - const gdb_byte *writebuf, - ULONGEST offset, - LONGEST len); +static target_xfer_partial_ftype *record_full_beneath_to_xfer_partial; static int (*record_full_beneath_to_insert_breakpoint) (struct gdbarch *, struct bp_target_info *); @@ -807,13 +800,7 @@ static void (*tmp_to_store_registers) (struct target_ops *, struct regcache *, int regno); static struct target_ops *tmp_to_xfer_partial_ops; -static LONGEST (*tmp_to_xfer_partial) (struct target_ops *ops, - enum target_object object, - const char *annex, - gdb_byte *readbuf, - const gdb_byte *writebuf, - ULONGEST offset, - LONGEST len); +static target_xfer_partial_ftype *tmp_to_xfer_partial; static int (*tmp_to_insert_breakpoint) (struct gdbarch *, struct bp_target_info *); static int (*tmp_to_remove_breakpoint) (struct gdbarch *, diff --git a/gdb/sparc-nat.c b/gdb/sparc-nat.c index d90ef96..45a0b54 100644 --- a/gdb/sparc-nat.c +++ b/gdb/sparc-nat.c @@ -313,9 +313,7 @@ sparc_xfer_wcookie (struct target_ops *ops, enum target_object object, return len; } -LONGEST (*inf_ptrace_xfer_partial) (struct target_ops *, enum target_object, - const char *, gdb_byte *, const gdb_byte *, - ULONGEST, LONGEST); +target_xfer_partial_ftype *inf_ptrace_xfer_partial; static LONGEST sparc_xfer_partial (struct target_ops *ops, enum target_object object, diff --git a/gdb/target.c b/gdb/target.c index 85b5037..04dc063 100644 --- a/gdb/target.c +++ b/gdb/target.c @@ -70,17 +70,9 @@ static void target_command (char *, int); static struct target_ops *find_default_run_target (char *); -static LONGEST default_xfer_partial (struct target_ops *ops, - enum target_object object, - const char *annex, gdb_byte *readbuf, - const gdb_byte *writebuf, - ULONGEST offset, LONGEST len); - -static LONGEST current_xfer_partial (struct target_ops *ops, - enum target_object object, - const char *annex, gdb_byte *readbuf, - const gdb_byte *writebuf, - ULONGEST offset, LONGEST len); +static target_xfer_partial_ftype default_xfer_partial; + +static target_xfer_partial_ftype current_xfer_partial; static struct gdbarch *default_thread_architecture (struct target_ops *ops, ptid_t ptid); @@ -1695,7 +1687,7 @@ make_show_memory_breakpoints_cleanup (int show) LONGEST target_xfer_partial (struct target_ops *ops, enum target_object object, const char *annex, - void *readbuf, const void *writebuf, + gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST offset, LONGEST len) { LONGEST retval; diff --git a/gdb/target.h b/gdb/target.h index f22e5c6..5b9b34d 100644 --- a/gdb/target.h +++ b/gdb/target.h @@ -238,6 +238,15 @@ enum trace_find_type typedef struct static_tracepoint_marker *static_tracepoint_marker_p; DEF_VEC_P(static_tracepoint_marker_p); +typedef LONGEST + target_xfer_partial_ftype (struct target_ops *ops, + enum target_object object, + const char *annex, + gdb_byte *readbuf, + const gdb_byte *writebuf, + ULONGEST offset, + LONGEST len); + /* Request that OPS transfer up to LEN 8-bit bytes of the target's OBJECT. The OFFSET, for a seekable object, specifies the starting point. The ANNEX can be used to provide additional @@ -319,12 +328,7 @@ extern char *target_read_stralloc (struct target_ops *ops, const char *annex); /* See target_ops->to_xfer_partial. */ - -extern LONGEST target_xfer_partial (struct target_ops *ops, - enum target_object object, - const char *annex, - void *readbuf, const void *writebuf, - ULONGEST offset, LONGEST len); +extern target_xfer_partial_ftype target_xfer_partial; /* Wrappers to target read/write that perform memory transfers. They throw an error if the memory transfer fails. |