This is the mail archive of the
insight@sourceware.org
mailing list for the Insight project.
Re: Single-executable patch
On Wed, May 17, 2006 at 03:02:18PM -0400, Mikhail Teterin wrote:
> It seems, all three of the gdb, gdbtui, and insight executables are the same
> except for their (tiny) main() functions.
>
> The attached sample patch allows to install just the gdb and link it to gdbtui
> and insight -- the program will behave differently depending on the name,
> under which it is invoked.
>
> This saves not only the disk space (3.2Mb per executable here on FreeBSD/amd64
> despite using shared -ltcl, -ltk, -litcl, and -litk), but the more precious
> RAM at runtime too -- when different users run different interfaces on a
> shared system, the OS will be able to efficiently share the read-only pages
> between them.
This has been a world of trouble for other programs in the past, and I
do not recommend it; we switched to the separate main programs
deliberately IIRC.
If this is all you want, here's a simple implementation:
/usr/bin/gdbtui:
#!/usr/bin/gdb -i=tui
--
Daniel Jacobowitz
CodeSourcery