public inbox for insight@sourceware.org
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@redhat.com>
To: Keith Seitz <keiths@cygnus.com>
Cc: Insight List <insight@sourceware.cygnus.com>
Subject: Re: Startup with --args
Date: Wed, 21 Nov 2001 14:38:00 -0000	[thread overview]
Message-ID: <87d72biwbh.fsf@creche.redhat.com> (raw)
Message-ID: <20011121143800.pKMYJdSu15j-DVCCojkGfwHPrfeA2hVfk-ec0XHave4@z> (raw)
In-Reply-To: <Pine.GSO.4.33.0111201649230.20281-100000@makita.cygnus.com>

>>>>> "Keith" == Keith Seitz <keiths@cygnus.com> writes:

>> I've been running with my --args patch installed for a while now.
>> Hopefully it will get its final approval soon.

Keith> Are you waiting on me for something?

Nope.  I think (but I still have to check) that I got the last
approval for that patch from Elena today.

Keith> Is there a way to do this without modifying
Keith> session_notice_file_change? I don't know. It seems to me that
Keith> if we want to override the session's arguments, we should just
Keith> do that.

It never occurred to me.  Unbelievable.  How about the appended?  It
is much simpler.

Tom

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

  reply	other threads:[~2001-11-21 14:38 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-10-04 14:36 Tom Tromey
2001-10-04 15:09 ` Keith Seitz
2001-10-04 18:08   ` Tom Tromey [this message]
2001-10-04 18:44     ` Keith Seitz
2001-10-04 19:13       ` Tom Tromey
2001-11-21 16:26         ` Tom Tromey
2001-11-21 14:45       ` Keith Seitz
2001-11-21 14:38     ` Tom Tromey
2001-11-20 16:53   ` Keith Seitz
2001-11-20 16:19 ` Tom Tromey
2001-10-04 19:28 Keith Seitz
2001-11-21 23:13 ` Keith Seitz
2001-10-04 19:35 Tom Tromey
2001-11-21 23:14 ` Tom Tromey
2001-10-04 19:42 Tom Tromey
2001-11-21 23:18 ` Tom Tromey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87d72biwbh.fsf@creche.redhat.com \
    --to=tromey@redhat.com \
    --cc=insight@sourceware.cygnus.com \
    --cc=keiths@cygnus.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).