gdb_realpath: dealing with ./ and ../

Doug Evans dje@google.com
Fri Jan 4 20:30:00 GMT 2008


[fwiw ...]

I wonder if things would be cleaner if the path argument to
start_subfile (name, dirname) was processed the same as each subfile's
path (subfile->name, subfile->dirname).  Otherwise it seems like a
potential bug source (not necessarily now, but down the road).  There
(apparently) have been edits to this area of the code in the past that
have introduced bugs.

i.e. how about writing a utility to process name,dirname and using
that utility for both the argument to start_subfile and each subfile
in the comparison loop?  This patch is untested, I'm just providing a
definitive example of the suggestion.

Another question: In the case where dirname is prepended to name,
should the whole thing be passed to rewrite_source_path, instead of
just dirname?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rewrite-path-2.patch
Type: text/x-patch
Size: 3610 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/gdb/attachments/20080104/44ea3ad8/attachment.bin>


More information about the Gdb mailing list