public inbox for insight@sourceware.org
 help / color / mirror / Atom feed
* Patch: insight --args -vs- pwd
@ 2001-10-16 10:36 Tom Tromey
  2001-12-21 14:42 ` Tom Tromey
  0 siblings, 1 reply; 2+ messages in thread
From: Tom Tromey @ 2001-10-16 10:36 UTC (permalink / raw)
  To: Insight List

I've been using `gdb --args' for quite a while now.
Lately I've come to realize that if I run gdb in this mode, I really
want Insight to ignore the session's notion of pwd and instead use the
directory where I launched gdb.
This makes sense because in `--args' mode you are expecting the
inferior to be run in the "current environment".  Several times now
I've been confused by the current behavior of overriding the pwd with
the session's pwd.

This patch implements what I'd prefer.
Ok to commit?

Tom

Index: ChangeLog
from  Tom Tromey  <tromey@redhat.com>
	* library/interface.tcl (gdbtk_tcl_preloop): Use current directory
	when `--args' given.

2001-12-21  Tom Tromey  <tromey@redhat.com>

Index: library/interface.tcl
===================================================================
RCS file: /cvs/src/src/gdb/gdbtk/library/interface.tcl,v
retrieving revision 1.35
diff -u -r1.35 interface.tcl
--- library/interface.tcl 2001/12/11 08:55:52 1.35
+++ library/interface.tcl 2001/12/21 22:34:54
@@ -100,7 +100,7 @@
 # ------------------------------------------------------------------
 
 proc gdbtk_tcl_preloop { } {
-  global gdb_exe_name
+  global gdb_exe_name gdb_current_directory
 
   set_baud
 
@@ -115,11 +115,13 @@
     # At startup, file_changed_hook is called too late for us, so we
     # 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.
+    # arguments and pwd to override what is set in the session.
     set current_args [gdb_get_inferior_args]
+    set current_dir $gdb_current_directory
     session_notice_file_change
     if {[string length $current_args] > 0} {
       gdb_set_inferior_args $current_args
+      gdb_cmd "cd $current_dir"
     }
   }
   

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Patch: insight --args -vs- pwd
  2001-10-16 10:36 Patch: insight --args -vs- pwd Tom Tromey
@ 2001-12-21 14:42 ` Tom Tromey
  0 siblings, 0 replies; 2+ messages in thread
From: Tom Tromey @ 2001-12-21 14:42 UTC (permalink / raw)
  To: Insight List

I've been using `gdb --args' for quite a while now.
Lately I've come to realize that if I run gdb in this mode, I really
want Insight to ignore the session's notion of pwd and instead use the
directory where I launched gdb.
This makes sense because in `--args' mode you are expecting the
inferior to be run in the "current environment".  Several times now
I've been confused by the current behavior of overriding the pwd with
the session's pwd.

This patch implements what I'd prefer.
Ok to commit?

Tom

Index: ChangeLog
from  Tom Tromey  <tromey@redhat.com>
	* library/interface.tcl (gdbtk_tcl_preloop): Use current directory
	when `--args' given.

2001-12-21  Tom Tromey  <tromey@redhat.com>

Index: library/interface.tcl
===================================================================
RCS file: /cvs/src/src/gdb/gdbtk/library/interface.tcl,v
retrieving revision 1.35
diff -u -r1.35 interface.tcl
--- library/interface.tcl 2001/12/11 08:55:52 1.35
+++ library/interface.tcl 2001/12/21 22:34:54
@@ -100,7 +100,7 @@
 # ------------------------------------------------------------------
 
 proc gdbtk_tcl_preloop { } {
-  global gdb_exe_name
+  global gdb_exe_name gdb_current_directory
 
   set_baud
 
@@ -115,11 +115,13 @@
     # At startup, file_changed_hook is called too late for us, so we
     # 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.
+    # arguments and pwd to override what is set in the session.
     set current_args [gdb_get_inferior_args]
+    set current_dir $gdb_current_directory
     session_notice_file_change
     if {[string length $current_args] > 0} {
       gdb_set_inferior_args $current_args
+      gdb_cmd "cd $current_dir"
     }
   }
   

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2001-12-21 22:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-10-16 10:36 Patch: insight --args -vs- pwd Tom Tromey
2001-12-21 14:42 ` Tom Tromey

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).