diff options
author | Pierre Langlois <pierre.langlois@arm.com> | 2015-07-30 18:05:00 +0100 |
---|---|---|
committer | Pierre Langlois <pierre.langlois@arm.com> | 2015-07-30 18:05:00 +0100 |
commit | 6b940e6a063ac13372b44a03a54b6be33d22a183 (patch) | |
tree | e5caa0ef0a4efe2ab6f4aeaf716b1b3ecbe13bd2 /gdb/i386-tdep.c | |
parent | e8b416815be691cc3fb1212d1a3dcb5d21a0d19d (diff) | |
download | fsf-binutils-gdb-6b940e6a063ac13372b44a03a54b6be33d22a183.zip fsf-binutils-gdb-6b940e6a063ac13372b44a03a54b6be33d22a183.tar.gz fsf-binutils-gdb-6b940e6a063ac13372b44a03a54b6be33d22a183.tar.bz2 |
Remove isize output argument from fast_tracepoint_valid_at
This patch removes the isize output argument from the
fast_tracepoint_valid_at gdbarch hook. It was used to return the size
of the instruction that needs to be replaced when installing a fast
tracepoint. Instead of getting this value from the
fast_tracepoint_valid_at hook, we can call the gdb_insn_length function.
If we do not do this, then architectures which do not have a restriction
on where to install the fast tracepoint will send uninitialized memory
off to GDBserver. See remote_download_tracepoint:
~~~
int isize;
if (gdbarch_fast_tracepoint_valid_at (target_gdbarch (),
tpaddr, &isize, NULL))
xsnprintf (buf + strlen (buf), BUF_SIZE - strlen (buf), ":F%x",
isize);
~~~
The default implementation of fast_tracepoint_valid_at will not set
isize resulting in uninitialized memory being sent. Later on, GDBserver
could use this information to compute a jump offset.
gdb/ChangeLog:
* arch-utils.c (default_fast_tracepoint_valid_at): Remove unused
isize argument.
* arch-utils.h (default_fast_tracepoint_valid_at): Likewise.
* breakpoint.c (check_fast_tracepoint_sals): Adjust call to
gdbarch_fast_tracepoint_valid_at.
* gdbarch.sh (fast_tracepoint_valid_at): Remove isize argument.
* gdbarch.h: Regenerate.
* gdbarch.c: Regenerate.
* i386-tdep.c (i386_fast_tracepoint_valid_at): Remove isize
argument. Do not set it.
* remote.c (remote_download_tracepoint): Adjust call to
gdbarch_fast_tracepoint_valid_at. Call gdb_insn_length to get
the instruction length.
Diffstat (limited to 'gdb/i386-tdep.c')
-rw-r--r-- | gdb/i386-tdep.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c index 371a282..9d52d4a 100644 --- a/gdb/i386-tdep.c +++ b/gdb/i386-tdep.c @@ -8045,8 +8045,8 @@ static const int i386_record_regmap[] = string. */ static int -i386_fast_tracepoint_valid_at (struct gdbarch *gdbarch, - CORE_ADDR addr, int *isize, char **msg) +i386_fast_tracepoint_valid_at (struct gdbarch *gdbarch, CORE_ADDR addr, + char **msg) { int len, jumplen; static struct ui_file *gdb_null = NULL; @@ -8078,8 +8078,6 @@ i386_fast_tracepoint_valid_at (struct gdbarch *gdbarch, /* Check for fit. */ len = gdb_print_insn (gdbarch, addr, gdb_null, NULL); - if (isize) - *isize = len; if (len < jumplen) { |