This is the mail archive of the
insight@sources.redhat.com
mailing list for the Insight project.
Re: Startup with --args
- From: Keith Seitz <keiths at cygnus dot com>
- To: Tom Tromey <tromey at redhat dot com>
- Cc: Insight List <insight at sourceware dot cygnus dot com>
- Date: Wed, 21 Nov 2001 14:44:54 -0800 (PST)
- Subject: Re: Startup with --args
On 21 Nov 2001, Tom Tromey wrote:
> It never occurred to me. Unbelievable. How about the appended? It
> is much simpler.
YES! Love that isolation! Of course, late last night I convinced myself
that maybe your original patch is correct, too. :-(
Time will tell.
Keith
> Index: ChangeLog
> from Tom Tromey <tromey@redhat.com>
>
> * library/interface.tcl (gdbtk_tcl_preloop): Override session's
> command-line arguments if required.
>
> Index: library/interface.tcl
> ===================================================================
> RCS file: /cvs/src/src/gdb/gdbtk/library/interface.tcl,v
> retrieving revision 1.32
> diff -u -r1.32 interface.tcl
> --- library/interface.tcl 2001/11/19 18:43:19 1.32
> +++ library/interface.tcl 2001/11/21 22:36:53
> @@ -113,8 +113,14 @@
>
> if {$gdb_exe_name != ""} {
> # At startup, file_changed_hook is called too late for us, so we
> - # must notice the initial session by hand.
> + # must notice the initial session by hand. If the arguments exist
> + # -- if the user used `gdb --args' -- then we want the new
> + # arguments to override the session's arguments.
> + set current_args [gdb_get_inferior_args]
> session_notice_file_change
> + if {[string length $current_args] > 0} {
> + gdb_set_inferior_args $current_args
> + }
> }
>
> gdbtk_update
>