This is the mail archive of the gdb@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: RFC: CLI files naming


Fernando Nasser wrote:
> 
> As part of the separation of the command line interface code from the
> gdb core (libgdb), I will need to create files related to this interpreter.
> 
> We have placed MI related files in the gdb/mi subdirectory,
> the TUI related files in the gdb/tui and the Insight files in the
> gdb/gdbtk one.  Of course, CLI files should go into the gdb/cli subdir.

The TUI isn't exactly a source of good examples :-)

> However, for historical reasons, the MI and Insight files got prefixes
> in their names.  The reason was that they previously resided in the gdb
> directory itself and this was a way to group them together.
> 
> So, do I follow the tradition and name files like:
> 
> gdb/cli/cli-cmds.c

The tradition also dates back to the days when the debug info didn't
contain the path to the file and, consequently, you needed to have
globally unique file names.

> or do I eliminate the redundancy and go for shorter names like:
> 
> gdb/cli/cmds.c
> 
> Note that the long names have an advantage when debugging.  The MI,
> for instance, have a file called mi-main.c.  If it was just main.c
> (of course we could choose another name) it would clash with the
> gdb/main.c when we tried to set a breakpoint at main.c:36 for instance.

I've this memory of regretting the choice mi-main.c thinking it should
have been mi-top.c

> Any preferences?

No.  I went and tossed a coin and it came up tails - heads was short
form - so the longer form consistent with mi/mi*.

	Andrew

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