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 14:06:32 -0400
> From: Bob Rossi <bob@brasko.net>
> Cc: gdb-patches@sources.redhat.com
> 
> > > This is very true. This will break CGDB for instance. It use's the
> > > fullname as a unique key to a file. If GDB says that c:\abc has 2
> > > breakpoints and \abc has 1, CGDB will have 2 source files the user can
> > > choose and each will contain it's own breakpoints.
> > 
> > That's just a bug in CGDB (or at least in its Windows port, if it
> > exists): it should use smarter checks for identity of files, like the
> > equivalent of the Posix inode test.
> 
> Now that's just a difference of opinion.

Well, of course it's a difference of opinion!  The question is whose
opinion is more correct and based on more experience of dragging Posix
programs screaming and kicking into the wonderful world of Microsoft
filesystems.

More to the point: are you saying that CGDB is comparing file names
using strcmp, and if so, are you claiming that the code which does
that is ``correct'', including on Windows?  My experience tells me
that the assumption that file names can be compared as strings is very
Posix-centric, and breaks easily on Windows.  If you compare file
names as strings, you will fail to find that d:/foo and d:\Foo are the
same file, for example.  You will also fail to find that d:/foo/bar
and f:/bar are the same file because f: is a result of the SUBST
command.  And then there's the case of a network share that is mapped
to a drive letter, so \\foo\bar\baz and x:/baz, say, could both point
to the same file.

I could go on and on like that, but the bottom line is that file names
are not strings when you wish to check them for equality.  If CGDB
does that, it needs to be fixed, at least on Windows.  (I'd also fix
it on Unix, since even on Unix there are hardlinks that exibit similar
issues.)

> As it stands now, the doco says that the fullname is absolute, and
> therefor, CGDB expects that filename to be a unqiue key.

The file names \abc and d:foo _are_ absolute, they are just not
``fully qualified''.  These two notions are identical on Unix, but not
on Windows.  It's a mess that we shouldn't enter without a very good
reason, and the one which started this thread is far from that.


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