public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 0/9] Starting to convert languages to separate classes
@ 2020-05-11 22:35 Andrew Burgess
  2020-05-11 22:35 ` [PATCH 1/9] gdb: Represent all languages as sub-classes of language_defn Andrew Burgess
                   ` (12 more replies)
  0 siblings, 13 replies; 37+ messages in thread
From: Andrew Burgess @ 2020-05-11 22:35 UTC (permalink / raw)
  To: gdb-patches

This series starts the process of converting GDB's language structures
into separate classes, one for each supported language.

In the first commit I actually perform the conversion, but do so in a
way that basically doesn't change anything.  All the data is held in
the base class, and accessed just as it was before.

In the following commits I begin converting function pointer fields
within the language base class into real member functions.

I haven't converted all of the function pointers yet, I want to see
what feedback this series gets before I invest any more time.

Further into the future I think it's possible that we could tweak the
class hierarchy of languages, I do wonder if there will be some
obvious inheritance around the c_language maybe, but I figure I'll
convert all of the function pointers to methods first, then see what
everyone implements.

My hope is that be performing this conversion it will be easier for
people to add new methods into the language classes, to allow easier
language specific specialisation, hopefully we should be able to
remove some of the places where we check the language enum, and
instead replace this with a method on the language class.

Further into the future, I wonder if some things like expression
parsing, and maybe some of the value manipulation/printing code would
be better off as methods within the language classes.

Anyway, I'd be interested to hear peoples thoughts on the series so,
and of this as a piece of work in general, is this a good change or
not.

Thanks,
Andrew

---

Andrew Burgess (9):
  gdb: Represent all languages as sub-classes of language_defn
  gdb: Convert language la_print_array_index field to a method
  gdb: Convert language la_read_var_value field to a method
  gdb: Convert language la_pass_by_reference field to a method
  gdb: Convert language la_language_arch_info field to a method
  gdb: Convert language la_lookup_transparent_type field to a method
  gdb: Convert language la_iterate_over_symbols field to a method
  gdb: Convert language la_get_compile_instance field to a method
  gdb: Convert language la_search_name_hash field to a method

 gdb/ChangeLog         | 361 ++++++++++++++++++++++++++++++++++++++++++
 gdb/ada-lang.c        | 264 +++++++++++++++---------------
 gdb/c-lang.c          | 283 +++++++++++++++++++++------------
 gdb/c-lang.h          |   4 +-
 gdb/compile/compile.c |   8 +-
 gdb/d-lang.c          | 157 +++++++++---------
 gdb/f-lang.c          | 108 +++++++------
 gdb/findvar.c         |   5 +-
 gdb/go-lang.c         | 130 ++++++++-------
 gdb/language.c        | 170 ++++++++++++--------
 gdb/language.h        | 223 ++++++++++++++------------
 gdb/linespec.c        |   2 +-
 gdb/m2-lang.c         |  78 +++++----
 gdb/objc-lang.c       |  34 ++--
 gdb/opencl-lang.c     |  59 ++++---
 gdb/p-lang.c          | 124 ++++++++-------
 gdb/rust-exp.y        |   4 +-
 gdb/rust-lang.c       | 112 ++++++-------
 gdb/symtab.c          |   4 +-
 19 files changed, 1351 insertions(+), 779 deletions(-)

-- 
2.25.3


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

end of thread, other threads:[~2020-06-01 16:02 UTC | newest]

Thread overview: 37+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-11 22:35 [PATCH 0/9] Starting to convert languages to separate classes Andrew Burgess
2020-05-11 22:35 ` [PATCH 1/9] gdb: Represent all languages as sub-classes of language_defn Andrew Burgess
2020-05-11 22:35 ` [PATCH 2/9] gdb: Convert language la_print_array_index field to a method Andrew Burgess
2020-05-11 22:35 ` [PATCH 3/9] gdb: Convert language la_read_var_value " Andrew Burgess
2020-05-14 19:43   ` Tom Tromey
2020-05-11 22:35 ` [PATCH 4/9] gdb: Convert language la_pass_by_reference " Andrew Burgess
2020-05-14 11:00   ` Aktemur, Tankut Baris
2020-05-14 19:49     ` Tom Tromey
2020-05-14 19:48   ` Tom Tromey
2020-05-11 22:35 ` [PATCH 5/9] gdb: Convert language la_language_arch_info " Andrew Burgess
2020-05-11 22:35 ` [PATCH 6/9] gdb: Convert language la_lookup_transparent_type " Andrew Burgess
2020-05-11 22:35 ` [PATCH 7/9] gdb: Convert language la_iterate_over_symbols " Andrew Burgess
2020-05-12 23:21   ` Christian Biesinger
2020-05-11 22:35 ` [PATCH 8/9] gdb: Convert language la_get_compile_instance " Andrew Burgess
2020-05-12 21:11   ` Christian Biesinger
2020-05-11 22:35 ` [PATCH 9/9] gdb: Convert language la_search_name_hash " Andrew Burgess
2020-05-12 21:10   ` Christian Biesinger
2020-05-12 23:17 ` [PATCH 0/9] Starting to convert languages to separate classes Christian Biesinger
2020-05-13  1:33 ` Simon Marchi
2020-05-14 19:57 ` Tom Tromey
2020-05-15 15:06 ` [PATCHv2 00/13] " Andrew Burgess
2020-05-15 15:06   ` [PATCHv2 01/13] gdb: Represent all languages as sub-classes of language_defn Andrew Burgess
2020-05-15 15:06   ` [PATCHv2 02/13] gdb: Convert language la_print_array_index field to a method Andrew Burgess
2020-05-15 15:06   ` [PATCHv2 03/13] gdb: Convert language la_read_var_value " Andrew Burgess
2020-05-15 15:06   ` [PATCHv2 04/13] gdb: Convert language la_pass_by_reference " Andrew Burgess
2020-05-15 15:06   ` [PATCHv2 05/13] gdb: Convert language la_language_arch_info " Andrew Burgess
2020-05-15 15:06   ` [PATCHv2 06/13] gdb: Convert language la_lookup_transparent_type " Andrew Burgess
2020-05-15 15:06   ` [PATCHv2 07/13] gdb: Convert language la_iterate_over_symbols " Andrew Burgess
2020-05-15 15:06   ` [PATCHv2 08/13] gdb: Convert language la_get_compile_instance " Andrew Burgess
2020-05-15 15:06   ` [PATCHv2 09/13] gdb: Convert language la_search_name_hash " Andrew Burgess
2020-05-15 17:47     ` Christian Biesinger
2020-05-15 15:06   ` [PATCHv2 10/13] gdb: Convert language la_sniff_from_mangled_name " Andrew Burgess
2020-05-15 15:06   ` [PATCHv2 11/13] gdb: Convert language la_print_type " Andrew Burgess
2020-05-15 15:06   ` [PATCHv2 12/13] gdb: Convert language la_demangle " Andrew Burgess
2020-05-15 15:06   ` [PATCHv2 13/13] gdb: Convert language skip_trampoline " Andrew Burgess
2020-05-15 17:06   ` [PATCHv2 00/13] Starting to convert languages to separate classes Tom Tromey
2020-06-01 16:02   ` Andrew Burgess

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).