proposal: substitute-path handles foreign dir separators

Raphael Zulliger zulliger@indel.ch
Fri Dec 17 14:18:00 GMT 2010


Hi

This is my first patch sent to this list. Please let me know if I'm 
doing something wrong.

This is a not a bug fix, it's a feature: This patch extends 
'substitute-path' to handle paths containing 'foreign' directory 
separators. Means e.g.: A powerpc-eabi-gdb running on Linux can handle 
powerpc-eabi-binaries built on Windows and vice versa.

Several points need to be considered:
  1. Most importantly: Do we want such a 'feature'? Personally, I think 
it makes sense to have such a feature. A prominent use case may occur 
when developing for an embedded system. Having platform independent IDEs 
like Eclipse together with the GNU toolchain (cygwin, mingw, *nix) makes 
it possible that some members of a development team work on e.g. 
Windows, while the rest works on e.g. Linux. "Working" in this case 
could mean that people compile their code and probably create libraries 
on their (preferred) OS. Later these libraries will be linked together 
to a binary which will end up on an embedded target that needs to be 
debugged. (Sure you can argue that this wouldn't happen if they'd use a 
buildmachine, but...). Debugging, again, may be done by a person using 
Linux or Windows. That's where this patch would become useful.

To continue the discussion lets assume that we all want this feature.
  2. I created this patch because I actually debug binaries on a Linux 
box which have been created on a Windows machine (GNU toolchain/Cygwin). 
Empirically, I've realized that 'substitute-path' doesn't work for this 
purpose. After having single-stepped GDB and modified its code slightly, 
I ended up with this patch. The point is that I figured it out 
empirically. It could the case that I justed missed an already existing 
solution. Please let me know if my patch is crap because there exists 
another way of handling my use case.

  3. I didn't write any tests yet. I would write them if the patch would 
get accepted. If this would be the case, it would be nice if you could 
give me some hints where to start (which file, what kind of test, ...)

  4. I didn't verify/test my code on any other system than Linux. I 
could test it on Windows (mingw) if you would accept the patch

  5. I didn't yet fill out the 'copyright assignment' form (mentioned in 
the CONTRIBUTE file). I would do so if required.


Raphael


-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: substitute-path.diff
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20101217/ea302c2a/attachment.ksh>


More information about the Gdb-patches mailing list