aboutsummaryrefslogtreecommitdiff
path: root/gdb/i386-fbsd-tdep.c
diff options
context:
space:
mode:
authorLuis Machado <luis.machado@linaro.org>2021-01-15 13:16:04 -0300
committerLuis Machado <luis.machado@linaro.org>2021-01-19 14:42:23 -0300
commitbdec2917b1e94c7198ba39919f45060067952f43 (patch)
tree808f5e6ba99e684a6c2328e25f338dc0731970e1 /gdb/i386-fbsd-tdep.c
parentc65ca138c4be913964dbd332c44e861fced991cd (diff)
downloadgdb-bdec2917b1e94c7198ba39919f45060067952f43.zip
gdb-bdec2917b1e94c7198ba39919f45060067952f43.tar.gz
gdb-bdec2917b1e94c7198ba39919f45060067952f43.tar.bz2
Convert some frame functions to use gdb::array_view.
This patch converts the most obvious functions from gdb/frame.h to use the gdb::array_view abstraction. I've converted the ones that used buffer + length. There are others using only the buffer, with an implicit size. I did not touch those for now. But it would be nice to pass the size for safety. Tested with --enable-targets=all on Ubuntu 18.04/20.04 aarch64-linux. gdb/ChangeLog 2021-01-19 Luis Machado <luis.machado@linaro.org> * frame.h (get_frame_register_bytes): Pass a gdb::array_view instead of buffer + length. (put_frame_register_bytes): Likewise. Adjust documentation. (get_frame_memory): Pass a gdb::array_view instead of buffer + length. (safe_frame_unwind_memory): Likewise. * frame.c (get_frame_register_bytes, put_frame_register_bytes) (get_frame_memory, safe_frame_unwind_memory): Adjust to use gdb::array_view. * amd64-fbsd-tdep.c (amd64fbsd_sigtramp_p): Likewise. * amd64-linux-tdep.c (amd64_linux_sigtramp_start): Likewise. * amd64-obsd-tdep.c (amd64obsd_sigtramp_p): Likewise. * arc-linux-tdep.c (arc_linux_is_sigtramp): Likewise. * cris-tdep.c (cris_sigtramp_start, cris_rt_sigtramp_start): Likewise. * dwarf2/loc.c (rw_pieced_value): Likewise. * hppa-tdep.c (hppa_frame_cache): Likewise. * i386-fbsd-tdep.c (i386fbsd_sigtramp_p): Likewise. * i386-gnu-tdep.c (i386_gnu_sigtramp_start): Likewise. * i386-linux-tdep.c (i386_linux_sigtramp_start) (i386_linux_rt_sigtramp_start): Likewise. * i386-obsd-tdep.c (i386obsd_sigtramp_p): Likewise. * i386-tdep.c (i386_register_to_value): Likewise. * i387-tdep.c (i387_register_to_value): Likewise. * ia64-tdep.c (ia64_register_to_value): Likewise. * m32r-linux-tdep.c (m32r_linux_sigtramp_start) (m32r_linux_rt_sigtramp_start): Likewise. * m68k-linux-tdep.c (m68k_linux_pc_in_sigtramp): Likewise. * m68k-tdep.c (m68k_register_to_value): Likewise. * mips-tdep.c (mips_register_to_value) (mips_value_to_register): Likewise. * ppc-fbsd-tdep.c (ppcfbsd_sigtramp_frame_sniffer) (ppcfbsd_sigtramp_frame_cache): Likewise. * ppc-obsd-tdep.c (ppcobsd_sigtramp_frame_sniffer) (ppcobsd_sigtramp_frame_cache): Likewise. * rs6000-tdep.c (rs6000_in_function_epilogue_frame_p) (rs6000_register_to_value): Likewise. * tilegx-tdep.c (tilegx_analyze_prologue): Likewise. * tramp-frame.c (tramp_frame_start): Likewise. * valops.c (value_assign): Likewise.
Diffstat (limited to 'gdb/i386-fbsd-tdep.c')
-rw-r--r--gdb/i386-fbsd-tdep.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/gdb/i386-fbsd-tdep.c b/gdb/i386-fbsd-tdep.c
index bb0c622..1039724 100644
--- a/gdb/i386-fbsd-tdep.c
+++ b/gdb/i386-fbsd-tdep.c
@@ -135,8 +135,8 @@ i386fbsd_sigtramp_p (struct frame_info *this_frame)
const gdb_byte *middle, *end;
/* Look for a matching start. */
- if (!safe_frame_unwind_memory (this_frame, pc, buf,
- sizeof i386fbsd_sigtramp_start))
+ if (!safe_frame_unwind_memory (this_frame, pc,
+ {buf, sizeof i386fbsd_sigtramp_start}))
return 0;
if (memcmp (buf, i386fbsd_sigtramp_start, sizeof i386fbsd_sigtramp_start)
== 0)
@@ -162,23 +162,23 @@ i386fbsd_sigtramp_p (struct frame_info *this_frame)
/* Since the end is shorter than the middle, check for a matching end
next. */
pc += sizeof i386fbsd_sigtramp_start;
- if (!safe_frame_unwind_memory (this_frame, pc, buf,
- sizeof i386fbsd_sigtramp_end))
+ if (!safe_frame_unwind_memory (this_frame, pc,
+ {buf, sizeof i386fbsd_sigtramp_end}))
return 0;
if (memcmp (buf, end, sizeof i386fbsd_sigtramp_end) == 0)
return 1;
/* If the end didn't match, check for a matching middle. */
- if (!safe_frame_unwind_memory (this_frame, pc, buf,
- sizeof i386fbsd_sigtramp_middle))
+ if (!safe_frame_unwind_memory (this_frame, pc,
+ {buf, sizeof i386fbsd_sigtramp_middle}))
return 0;
if (memcmp (buf, middle, sizeof i386fbsd_sigtramp_middle) != 0)
return 0;
/* The middle matched, check for a matching end. */
pc += sizeof i386fbsd_sigtramp_middle;
- if (!safe_frame_unwind_memory (this_frame, pc, buf,
- sizeof i386fbsd_sigtramp_end))
+ if (!safe_frame_unwind_memory (this_frame, pc,
+ {buf, sizeof i386fbsd_sigtramp_end}))
return 0;
if (memcmp (buf, end, sizeof i386fbsd_sigtramp_end) != 0)
return 0;