[PATCH 00/10] Further reduction of language_data struct

Andrew Burgess andrew.burgess@embecosm.com
Thu Jul 9 11:36:57 GMT 2020


In previous commits GDB's languages were converted to C++ classes, and
all attributes were placed into the language_data struct.

We then removed all of the function pointers from language_data and
converted these into virtual methods within the language_defn class,
this left the language_data base class containing nothing but member
variables.

This commit starts the process of converting the member variables from
language_data into virtual methods in language_defn.

I'm less confident about this set of changes.  I'm never sure when
using virtual methods that return simple data values is the best
strategy, and when we should be passing parameters to the constructor,
in which case the current model of placing all the data into the
language_data class is probably not that bad.

So, I'm interested in feedback.  Is this an improvement or not?

All thoughts / feedback welcome.

Thanks,
Andrew



---

Andrew Burgess (10):
  gdb: Convert la_struct_too_deep_ellipsis to a method
  gdb: Convert la_name_of_this to a method
  gdb: Convert la_name and la_natural_name to methods
  gdb: Convert la_filename_extensions to a method
  gdb: Move la_language into the language_defn class
  gdb: Convert language_data::c_style_arrays to a method
  gdb: Fix an incorrect comment
  gdb: Convert language_data::string_lower_bound to a method
  gdb: Convert la_store_sym_names_in_linkage_form_p to a method
  gdb: Override store_sym_names_in_linkage_form_p for Go language

 gdb/ChangeLog         | 349 ++++++++++++++++++++++++++++++++++++++++++
 gdb/ada-lang.c        |  47 ++++--
 gdb/ax-gdb.c          |   2 +-
 gdb/c-exp.y           |   2 +-
 gdb/c-lang.c          | 137 +++++++++++------
 gdb/compile/compile.c |   2 +-
 gdb/cp-valprint.c     |   4 +-
 gdb/d-lang.c          |  37 +++--
 gdb/dwarf2/read.c     |   8 +-
 gdb/eval.c            |   2 +-
 gdb/expprint.c        |  10 +-
 gdb/f-lang.c          |  47 ++++--
 gdb/go-lang.c         |  23 +--
 gdb/infcall.c         |   2 +-
 gdb/language.c        |  89 ++++++-----
 gdb/language.h        | 141 +++++++++--------
 gdb/m2-lang.c         |  30 ++--
 gdb/mi/mi-cmd-var.c   |   2 +-
 gdb/objc-lang.c       |  37 +++--
 gdb/opencl-lang.c     |  19 +--
 gdb/p-lang.c          |  38 +++--
 gdb/rust-lang.c       |  32 ++--
 gdb/symfile.c         |   1 +
 gdb/symtab.c          |   8 +-
 gdb/valarith.c        |   6 +-
 gdb/valops.c          |  14 +-
 gdb/valprint.c        |   4 +-
 gdb/value.c           |   7 +-
 28 files changed, 797 insertions(+), 303 deletions(-)

-- 
2.25.4



More information about the Gdb-patches mailing list