[RFC 0/7] Move language-related stuff out of varobj.c

Yao Qi
2013-09-18T13:55:27Z

This patch series is to move language-related stuff out of varobj.c
to ada-varobj.c, c-varobj.c and jv-varobj.c. This will shorten
varobj.c, and make it easier for varobj support for new languages.

Nowadays, we have 'struct language_specific' which is about language
operations in varobj. This can be moved out of varobj.c and shared
for different languages. This is what patch 5/7 does. Operations
of each language need to know 'struct varobj', so 'struct varobj'
should be moved to varobj.h. This is what patch 4/7 does. Note
that we don't move all 'struct varobj' to varobj.h because some fields
are related to dynamic varobj, and make no sense to expose them.
I move basic part of 'struct varobj' to varobj.h, and define a new
struct varobj_dynamic to extend 'struct varobj'.

Then, we can move language related operations out of varobj.c to
c-varobj.c, ada-varobj.c and jv-varobj.c respectively. This is
done by patch 6/7.

Patch 1/7 - 3/7 are cleanups, to remove unused bits in varobj.c.
Patch 7/7 is a cleanup too.

Note that static array 'languages' is still used in varobj.c, which
is not really necessary. We can remove it and move each
'struct lang_varobj_ops *' to be a field of 'struct language_defn'.
I don't include this change in this series because I'd like to post
patches for review before I go too far away.

The whole series is tested on x86_64-linux. Comments?

*** BLURB HERE ***

Yao Qi (7):
Remove field language in struct language_specific
Remove vlang_unknown
Remove field value_of_root
Move struct varobj to varobj.h.
New lang-varobj.h
Move language stuff out of varobj.c
Remove ada-varobj.h.

gdb/Makefile.in | 12 +-
gdb/ada-varobj.c | 151 +++++-
gdb/ada-varobj.h | 55 --
gdb/c-varobj.c | 902 +++++++++++++++++++++++++++
gdb/gdbtypes.c | 16 +
gdb/gdbtypes.h | 4 +
gdb/jv-varobj.c | 104 ++++
gdb/lang-varobj.h | 79 +++
gdb/varobj.c | 1783 +++++++----------------------------------------------
gdb/varobj.h | 98 +++-
10 files changed, 1571 insertions(+), 1633 deletions(-)
delete mode 100644 gdb/ada-varobj.h
create mode 100644 gdb/c-varobj.c
create mode 100644 gdb/jv-varobj.c
create mode 100644 gdb/lang-varobj.h

--
1.7.7.6