This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 06/10] Java language
>>>>> "Sergio" == Sergio Durigan Junior <sergiodj@redhat.com> writes:
Tom> IMNSHO language parsers should not be manipulating the expout data
Tom> structure like this. copy_exp is likewise naughty.
Sergio> Hm, do you have some idea here? Some kind of abstraction, like putting
Sergio> these functions on gdb/{parser-defs.h,parse.c}, or something better?
I think that accessors and mutators for a data structure should all live
in one place. Spreading them out makes it harder to find them all when
doing refactorings. (In many cases you can rely on the compiler to
catch problems -- but you can still have planning difficulties due to
not seeing the code).
In the longer term, I think struct expression is just a crazy,
old-school data structure that should be replaced with something more
straightforward, even at the expense of using more memory.
I think the reason it has stayed this way so long is that the
cost/benefit for changing it is pretty low. This could be said of many
of the goofier areas of gdb.
Tom