OSDN Git Service

* library/interface.tcl (gdbtk_tcl_preloop): Override session's
authorTom Tromey <tromey@redhat.com>
Thu, 22 Nov 2001 00:26:12 +0000 (00:26 +0000)
committerTom Tromey <tromey@redhat.com>
Thu, 22 Nov 2001 00:26:12 +0000 (00:26 +0000)
command-line arguments if required.

gdb/gdbtk/ChangeLog
gdb/gdbtk/library/interface.tcl

index a23d4fc..5246a32 100644 (file)
@@ -1,3 +1,8 @@
+2001-11-21  Tom Tromey  <tromey@redhat.com>
+
+       * library/interface.tcl (gdbtk_tcl_preloop): Override session's
+       command-line arguments if required.
+
 2001-11-20  Keith Seitz  <keiths@redhat.com>
 
        * generic/gdbtk.c (gdbtk_init): If DISPLAY is not set on Unix,
index fd37242..1c6a81e 100644 (file)
@@ -113,8 +113,14 @@ proc gdbtk_tcl_preloop { } {
 
   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