[00/31] Turn gdbserver's linux low targets into classes

Message ID cover.1583529166.git.tankut.baris.aktemur@intel.com
Headers show
Series
  • Turn gdbserver's linux low targets into classes
Related show

Message

Tankut Baris Aktemur March 6, 2020, 9:31 p.m.
Hi,

This is a series that converts the linux low target definitions of
gdbserver into classes that derive from 'linux_process_target'.
Previously, gdbserver's target definition was converted into a class
and the following class hierarchy was obtained:

process_stratum_target
^
|-- linux_process_target
|-- win32_process_target
|-- nto_process_target
|-- lynx_process_target

This is a continuation of that work.  At the end of the series we
obtain

process_stratum_target
^
|-- linux_process_target
    ^
    |-- x86_target (defined in linux-x86-low.cc)
    |-- aarch64_target (defined in linux-aarch64-low.cc)
    |-- riscv_target (defined in linux-riscv-low.cc)
    |-- ...
|-- win32_process_target
|-- nto_process_target
|-- lynx_process_target

Please see Patch 03 for more details about the approach.  The series
is also available at

https://github.com/barisaktemur/gdb/commits/gdbserver/cppify/linux-low/v1

in case one wants to check out.

Regards.
Baris


Tankut Baris Aktemur (31):
  gdbserver: make linux target op 'cannot_store_register' a predicate
    function
  gdbserver/linux-low: turn some static functions into private methods
  gdbserver/linux-low: start turning linux target ops into methods
  gdbserver/linux-low: turn 'arch_setup' into a method
  gdbserver/linux-low: turn 'regs_info' into a method
  gdbserver/linux-low: turn 'cannot_{fetch/store}_register' into methods
  gdbserver/linux-low: turn 'fetch_register' into a method
  gdbserver/linux-low: turn some more static functions into private
    methods
  gdbserver/linux-low: turn 'get_pc' and 'set_pc' into methods
  gdbserver/linux-low: turn 'breakpoint_kind_from_{pc, current_state}'
    into methods
  gdbserver/linux-low: turn 'sw_breakpoint_from_kind' into a method
  gdbserver/linux-low: turn 'supports_software_single_step' and
    'get_next_pcs' into methods
  gdbserver/linux-low: move 'decr_pc_after_break' into
    linux_process_target
  gdbserver/linux-low: turn 'breakpoint_at' into a method
  gdbserver/linux-low: turn 'supports_z_point_type' into a method
  gdbserver/linux-low: turn 'insert_point' and 'remove_point' into
    methods
  gdbserver/linux-low: turn watchpoint ops into methods
  gdbserver/linux-low: turn '{collect, supply}_ptrace_register' into
    methods
  gdbserver/linux-low: turn 'siginfo_fixup' into a method
  gdbserver/linux-low: turn process/thread addition/deletion ops into
    methods
  gdbserver/linux-low: turn 'prepare_to_resume' into a method
  gdbserver/linux-low: turn 'process_qsupported' into a method
  gdbserver/linux-low: turn 'supports_tracepoints' into a method
  gdbserver/linux-low: turn 'get_thread_area' into a method
  gdbserver/linux-low: turn fast tracepoint ops into methods
  gdbserver/linux-low: turn 'emit_ops' into a method
  gdbserver/linux-low: turn 'supports_range_stepping' into a method
  gdbserver/linux-low: turn 'supports_hardware_single_step' into a
    method
  gdbserver/linux-low: turn 'get_syscall_trapinfo' into a method
  gdbserver/linux-low: turn 'get_ipa_tdesc_idx' into a method
  gdbserver/linux-low: delete 'linux_target_ops' and 'the_low_target'

 gdbserver/linux-aarch64-low.cc |  378 ++++++-----
 gdbserver/linux-arm-low.cc     |  264 +++++---
 gdbserver/linux-bfin-low.cc    |  132 ++--
 gdbserver/linux-cris-low.cc    |  109 +++-
 gdbserver/linux-crisv32-low.cc |  182 +++---
 gdbserver/linux-ia64-low.cc    |   88 ++-
 gdbserver/linux-low.cc         | 1105 ++++++++++++--------------------
 gdbserver/linux-low.h          |  551 +++++++++++-----
 gdbserver/linux-m32r-low.cc    |  136 ++--
 gdbserver/linux-m68k-low.cc    |  131 ++--
 gdbserver/linux-mips-low.cc    |  292 +++++----
 gdbserver/linux-nios2-low.cc   |  127 ++--
 gdbserver/linux-ppc-low.cc     |  283 ++++----
 gdbserver/linux-riscv-low.cc   |  140 ++--
 gdbserver/linux-s390-low.cc    |  258 ++++----
 gdbserver/linux-sh-low.cc      |  139 ++--
 gdbserver/linux-sparc-low.cc   |  102 +--
 gdbserver/linux-tic6x-low.cc   |  135 ++--
 gdbserver/linux-tile-low.cc    |  147 +++--
 gdbserver/linux-x86-low.cc     |  364 +++++++----
 gdbserver/linux-xtensa-low.cc  |  137 ++--
 gdbserver/proc-service.cc      |    2 +-
 gdbserver/thread-db.cc         |    2 +-
 23 files changed, 2898 insertions(+), 2306 deletions(-)

-- 
2.17.1

Comments

Jose E. Marchesi via Gdb-patches April 1, 2020, 9:16 p.m. | #1
On 3/6/20 9:31 PM, Tankut Baris Aktemur wrote:

> This is a series that converts the linux low target definitions of

> gdbserver into classes that derive from 'linux_process_target'.


This is excellent, thanks much for doing this.  Excellent work
splitting things up, and I like how you used the pattern
of calling the low virtual methods "low_xxx", like gdb/linux-nat.h does.

Other than the two patches I replied to, this all looks great to me.

Thanks,
Pedro Alves
Jose E. Marchesi via Gdb-patches April 2, 2020, 7:33 a.m. | #2
On Wednesday, April 1, 2020 11:17 PM, Pedro Alves wrote:
> On 3/6/20 9:31 PM, Tankut Baris Aktemur wrote:

> 

> > This is a series that converts the linux low target definitions of

> > gdbserver into classes that derive from 'linux_process_target'.

> 

> This is excellent, thanks much for doing this.  Excellent work

> splitting things up, and I like how you used the pattern

> of calling the low virtual methods "low_xxx", like gdb/linux-nat.h does.

> 

> Other than the two patches I replied to, this all looks great to me.

> 

> Thanks,

> Pedro Alves


Thank you for the thorough reviews.  I'll push after fixing those two things.

-Baris


Intel Deutschland GmbH
Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de
Managing Directors: Christin Eisenschmid, Gary Kershaw
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928