binutils-gdb/gdb/nat
Simon Marchi bb82e93484 Fix iov_len calculation in aarch64_linux_set_debug_regs
There is this build failure when building in C++:

/home/simark/src/binutils-gdb/gdb/nat/aarch64-linux-hw-point.c: In function ‘void aarch64_linux_set_debug_regs(const aarch64_debug_reg_state*, int, int)’:
/home/simark/src/binutils-gdb/gdb/nat/aarch64-linux-hw-point.c:564:64: error: ‘count’ cannot appear in a constant-expression
   iov.iov_len = (offsetof (struct user_hwdebug_state, dbg_regs[count - 1])
                                                                ^
We can simplify the computation and make g++ happy at the same time by
formulating as:

  size of fixed part + size of variable part

thus...

  size of fixed part + count * size of one variable part element

thus...

  offsetof (struct user_hwdebug_state, dbg_regs) + count * sizeof (regs.dbg_reg[0]);

gdb/ChangeLog:

	* nat/aarch64-linux-hw-point.c (aarch64_linux_set_debug_regs): Change
	form of iov_len computation.
2015-11-19 10:17:46 -05:00
..
aarch64-linux-hw-point.c Fix iov_len calculation in aarch64_linux_set_debug_regs 2015-11-19 10:17:46 -05:00
aarch64-linux-hw-point.h [aarch64] Check region OK for HW watchpoint in GDBserver 2015-09-03 14:01:49 +01:00
aarch64-linux.c aarch64 multi-arch (part 3): get thread area 2015-09-18 13:59:42 +01:00
aarch64-linux.h aarch64 multi-arch (part 3): get thread area 2015-09-18 13:59:42 +01:00
gdb_ptrace.h
gdb_thread_db.h
glibc_thread_db.h
linux-btrace.c Add mmap casts in linux-btrace.c 2015-10-23 19:54:09 -04:00
linux-btrace.h btrace: kernel address filtering 2015-09-09 10:35:35 +02:00
linux-namespaces.c Fix stale cleanup left by linux_mntns_access_fs 2015-08-21 16:56:22 +01:00
linux-namespaces.h
linux-nat.h Move __SIGRTMIN. 2015-10-26 13:30:57 -07:00
linux-osdata.c Add casts to memory allocation related calls 2015-09-25 14:08:06 -04:00
linux-osdata.h
linux-personality.c
linux-personality.h
linux-procfs.c
linux-procfs.h
linux-ptrace.c Replace (void *) cast with (gdb_byte *) 2015-10-24 18:36:26 -04:00
linux-ptrace.h Extended-remote follow-exec 2015-09-11 11:12:46 -07:00
linux-waitpid.c
linux-waitpid.h
mips-linux-watch.c
mips-linux-watch.h
ppc-linux.c
ppc-linux.h
x86-cpuid.h
x86-dregs.c
x86-dregs.h
x86-gcc-cpuid.h
x86-linux-dregs.c
x86-linux-dregs.h
x86-linux.c
x86-linux.h