This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC] fullname attribute for GDB/MI stack frames


> Date: Wed, 4 May 2005 19:40:35 -0400
> From: Christopher Faylor <me@cgf.cx>
> 
> On Wed, May 04, 2005 at 05:07:17PM -0400, Daniel Jacobowitz wrote:
> >If it's going to open files, it _does_ matter.  You said that the
> >current directory (and presumably the current drive) are global on this
> >platform.  But the current directory is not stable across time.  If the
> >front end changes the current directory after talking to GDB, suddenly
> >it won't be able to open files.
> 
> Right.  Presumably, on windows 9x you could do something like:
> 
> (gdb) shell
> d:
> cd \foo
> exit
> 
> and end up  invalidating anything which was previously pointing to
> d:foo.

It would be a bug if this happened.  That is why we have this fragment
in cli-cmds.c:shell_escape:

    #ifdef GLOBAL_CURDIR
      /* Make sure to return to the directory GDB thinks it is, in case the
	 shell command we just ran changed it.  */
      chdir (current_directory);
    #endif

The DJGPP's version of chdir changes the drive as well as the
directory if its argument mentions a drive different from the current
one.

(It looks like GLOBAL_CURDIR is defined on defs.h only for the DJGPP
port, so I think perhaps the MinGW port should do that as well.)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]