This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: RFA: Split linespec from symtab


Fernando Nasser writes:
 > This is a first small step towards extricating CLI code from the gdb core.
 > The linespec handling is still a utility routine, but it exists to be used by
 > interpreters (note that some interpreters may just choose not to use linespecs).
 > The three current clients are the GDB CLI, MI and Insight.
 > 
 > A second reason for doing this is to clearly separate two layer's of processing: the
 > basic symbol functionality in symtab, which shall export some through libgdb, and
 > a layer built on top of that to parse linespecs.
 > 
 > Last, but not least, symtab.c is bloated with almost 4,700 lines!  The linespec
 > handling code is about 1,400 lines, so it deserves its own file.
 > 
 > 
 > Notes:
 > 
 > 1) There is a function used by both files that doesn't seem to belong in neither of
 >    them, but on some language support file.  I left it where it is in this patch
 >    so we can discuss what to do with it and make the move on a clearly separated patch.
 >    It is the operator_chars() function.
 > 
 > 2) I left decode_line_1 "extern" definition temporarily in symtab.h because it is
 >    already included in the right places and I could not think of a better place yet
 >    (we may have better places when the CLI code is further organized).
 >    I plan to propose renaming it to parse_linespec, so if that is approved we can move
 >    it to another header file if we so decide.
 > 
 > 
 > Here is the ChangeLog:
 > 
 >         * symtab.c (decode_line_1, total_number_of_methods, find_methods,
 >         build_command_line_spec, find_toplevel_char, decode_line_2):
 >         Move to linespec.c.
 >         * linespec.c: New file. Routines that handle linespecs, formerly
 >         in symtab.c.
 >         * symtab.h: Export find_line_symtab and find_function_start_sal,
 >         * Makefile.in: Add linespec.c.
 > 
 > 


Fernando, this is OK with me.
2 things though:

1. Who's going to maintain this file? 
   I am asking because there are some patches pending from Dan, and I
   don't want those to fall through the cracks. Maybe I can be a
   co-maintainer?

2. Some C++ specific functions will be moved to linespec.c to which they 
   don't really belong, just as they didn't belong to symtab.c.
   So at some stage the c++ functions may be further separated, into
   their own files. But this is not a problem, I would think. Maybe 
   add a comment to that effect in linespec.c.

Elena


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]