x86 Linux/ptrace: fix offsetof usage in C++ mode
authorPedro Alves <palves@redhat.com>
Wed, 22 Oct 2014 12:51:07 +0000 (13:51 +0100)
committerPedro Alves <palves@redhat.com>
Fri, 27 Feb 2015 17:30:09 +0000 (17:30 +0000)
commit4180215b9db1549b88da2da2fcc320fe28233481
treed9be89fd130a2c8c727f8e091753ee3567bff668
parent2f56f7c302c8d4012cc47d8bd261b151b2ddfa22
x86 Linux/ptrace: fix offsetof usage in C++ mode

In C++ mode, we get:

  gdb/gdbserver/linux-x86-low.c: In function ‘void x86_linux_dr_set(ptid_t, int, long unsigned int)’:
  gdb/gdbserver/linux-x86-low.c:558:38: error: ‘regnum’ cannot appear in a constant-expression
      offsetof (struct user, u_debugreg[regnum]), value);
                                      ^
gdb/gdbserver/ChangeLog:
2015-02-27  Pedro Alves  <palves@redhat.com>

* linux-x86-low.c (u_debugreg_offset): New function.
(x86_linux_dr_get, x86_linux_dr_set): Use it.

gdb/ChangeLog:
2015-02-27  Pedro Alves  <palves@redhat.com>

* x86-linux-nat.c (u_debugreg_offset): New function.
(x86_linux_dr_get, x86_linux_dr_set): Use it.
gdb/ChangeLog
gdb/gdbserver/ChangeLog
gdb/gdbserver/linux-x86-low.c
gdb/x86-linux-nat.c