Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH 0/3] Create arch_lwp_info class hierarchy
@ 2017-07-24 10:40 Simon Marchi
  2017-07-24 10:40 ` [PATCH 2/3] gdbserver lwp_info: Initialize fields, use new/delete Simon Marchi
                   ` (3 more replies)
  0 siblings, 4 replies; 15+ messages in thread
From: Simon Marchi @ 2017-07-24 10:40 UTC (permalink / raw)
  To: gdb-patches; +Cc: Simon Marchi

I have the goal of "poisoning" the XNEW/xfree-family of functions, so
that we catch their usages with non-POD types.  A few things need to be
fixed in the mean time, this is one.

The common lwp code in linux-nat.c and gdbserver/linux-low.c xfrees the
private lwp data of type arch_lwp_info.  However, that type is opaque
from its point of view, as its defined differently in each arch-specific
implementation.  This trips on the std::is_pod<T> check, since the
compiler can't tell whether the type is POD or not if it doesn't know
about it.

I think the right fix going forward is to make a hierachy out of these
structs, so that they all inherit from a common base.  That's what patch
3 does.  Patches 1 and 2 simply C++ify the GDB and GDBserver lwp_info
structures so that it's possible to use unique_ptr fields.

Simon Marchi (3):
  gdb lwp_info: Add destructor, initialize fields, use new/delete
  gdbserver lwp_info: Initialize fields, use new/delete
  Create arch_lwp_info class hierarchy

 gdb/arm-linux-nat.c              |  21 ++++----
 gdb/gdbserver/linux-arm-low.c    |  31 ++++++------
 gdb/gdbserver/linux-low.c        | 101 +++++++++++++++++++--------------------
 gdb/gdbserver/linux-low.h        |  52 ++++++++++----------
 gdb/gdbserver/linux-mips-low.c   |  16 ++++---
 gdb/gdbserver/thread-db.c        |   4 +-
 gdb/linux-nat.c                  |  99 +++++++++++++++++---------------------
 gdb/linux-nat.h                  |  54 +++++++++++----------
 gdb/nat/aarch64-linux-hw-point.c |   4 +-
 gdb/nat/aarch64-linux-hw-point.h |   6 +--
 gdb/nat/aarch64-linux.c          |   4 +-
 gdb/nat/linux-nat.h              |   7 ++-
 gdb/nat/x86-linux.c              |  12 +++--
 gdb/s390-linux-nat.c             |  11 +++--
 14 files changed, 213 insertions(+), 209 deletions(-)

-- 
2.7.4


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2017-08-18 11:23 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-24 10:40 [PATCH 0/3] Create arch_lwp_info class hierarchy Simon Marchi
2017-07-24 10:40 ` [PATCH 2/3] gdbserver lwp_info: Initialize fields, use new/delete Simon Marchi
2017-07-25  9:58   ` Yao Qi
2017-07-25 10:19     ` Simon Marchi
2017-07-25 15:25       ` Yao Qi
2017-07-24 10:40 ` [PATCH 1/3] gdb lwp_info: Add destructor, initialize " Simon Marchi
2017-07-24 10:43   ` Simon Marchi
2017-07-25  9:39   ` Yao Qi
2017-07-24 10:40 ` [PATCH 3/3] Create arch_lwp_info class hierarchy Simon Marchi
2017-08-09 20:47   ` Simon Marchi
2017-08-11 20:13 ` [PATCH 0/3] " Pedro Alves
2017-08-12 11:31   ` Simon Marchi
2017-08-14 11:53     ` Pedro Alves
2017-08-16 18:44       ` Simon Marchi
2017-08-18 11:23         ` Pedro Alves

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox