Home » Language IDEs » C / C++ IDE (CDT) » Debug target pathname
| | | |
Re: Debug target pathname [message #34305 is a reply to message #34273] |
Mon, 27 May 2002 17:01   |
Eclipse User |
|
|
|
Hi Allan,
Thanks for letting me know.
I have also put in a fix for this problem.
Instead of just escaping spaces in the filename, I have included other
special characters to escape as well. My fix is in
GdbDebugSession.setStartProgramName.
In addition to spaces, following characters are escaped:
~`!@#$%^&()+={}[];,\/:*?"<>|
I have checked in the code in CVS. You can get the fix by checking out
the most recent copy of GdbDebugSession.java from CVS.
I hope it solves your problem running GDBPicl on Windows. Let me know if
you experience any problem.
Thanks,
Samantha
Allan Clearwaters wrote:
> Samantha,
> I've fixed this problem, ie. I now have a version of CDT that properly
> handles pathnames with embedded spaces on Windows and cygwin gdb. The
> changes (at least as I've done them) are to add a static method to Gdb that
> does the work of escaping the filename string and then use this method to
> modify the path passed to GetDebugSession.setStartProgramNameString(). I am
> now a happy puppy. If you wish to see these changes please contact me at
> allan@object-forge.com and I'll ship you the modified gdbPicl package.
> Thanx,
> Al
> "Samantha Chan" <chanskw@ca.ibm.com> wrote in message
> news:acgufg$khg$1@rogue.oti.com...
> > Hi Allan,
> >
> > Could you also let me know what you have modified for this problem?
> > I would like to take a look at it and test it out as well.
> >
> > Thanks
> > Samantha
> >
> > Allan Clearwaters wrote:
> >
> > > Having suffer a problem debugging under Windows with Cygwin installed I
> > > decided to dig a bit further. I loaded the gdbpicl source and had a
> look at
> > > the pathname generation code. If this is actually tageted at Unix then
> I
> > > believe the convention should be to escape control and non-printing
> > > charaters in the pathname, ie. the path "/a/b c/d" should be modified to
> > > "a/b\ c/c" according to Unix conventions. This would certainly fix the
> > > problem for me windows and make things much more tranparent (like you
> > > wouldn't have to worry about where your source was in a directory
> > > structure).
> >
> > > In trying to test this mod I'm confused about how the debug inspector
> works.
> > > It keeps giving me a popup to the effect '... cannot resolve...' name if
> the
> > > name is anything other than this or one declared in the method. Have I
> > > missed a setting somewhere?
> >
> > > Regarding the pathname stuff, I think this change should be made. For
> Unix
> > > it's neutral, for windows it's a real bonus.
> >
> > > Thanx,
> > > Al
> >
> >
> >
> >
> >
|
|
|
Re: Debug target pathname [message #34443 is a reply to message #34305] |
Tue, 28 May 2002 08:49   |
Eclipse User |
|
|
|
Samantha,
Had a look - 2 comments:
1) The interpretation of the '\' char in the input string is ambiguous.
You can either treat it as a character to be escaped (as you have) or assume
the caller has already constructed a string with an escaped character in it.
In the latter case your code adds a newly escaped '\' to the string. I not
sure this what you want. I'm inclined to consider a '\' char in the input
string as being there on purpose and leave the next character alone.
2) I implemented a method rather than simply embed the code since this is a
generally useful utility. That's a matter of taste.
I'd be inclined to change as follows:
private String escapeChars=" ~`!@#$%^&()+={}[];,/:*?\"<>|";
StringBuffer buffer = new StringBuffer();
char[] mainProg = _mainProgram.toCharArray();
boolean escaped = false;
for (int i=0; i<mainProg.length; i++){
if (escapeChars.indexOf(mainProg[i]) >= 0 && !escaped ){
buffer.append('\\');
}
eacaped = (esacped)? false : (mainProg[i]=='\\' );
buffer.append(mainProg[i]);
}
"Samantha Chan" <chanskw@ca.ibm.com> wrote in message
news:acu6r3$6uq$1@rogue.oti.com...
> Hi Allan,
>
> Thanks for letting me know.
> I have also put in a fix for this problem.
> Instead of just escaping spaces in the filename, I have included other
> special characters to escape as well. My fix is in
> GdbDebugSession.setStartProgramName.
>
> In addition to spaces, following characters are escaped:
> ~`!@#$%^&()+={}[];,\/:*?"<>|
>
> I have checked in the code in CVS. You can get the fix by checking out
> the most recent copy of GdbDebugSession.java from CVS.
>
> I hope it solves your problem running GDBPicl on Windows. Let me know if
> you experience any problem.
>
> Thanks,
>
> Samantha
>
> Allan Clearwaters wrote:
>
> > Samantha,
>
> > I've fixed this problem, ie. I now have a version of CDT that properly
> > handles pathnames with embedded spaces on Windows and cygwin gdb. The
> > changes (at least as I've done them) are to add a static method to Gdb
that
> > does the work of escaping the filename string and then use this method
to
> > modify the path passed to GetDebugSession.setStartProgramNameString().
I am
> > now a happy puppy. If you wish to see these changes please contact me
at
> > allan@object-forge.com and I'll ship you the modified gdbPicl package.
>
> > Thanx,
> > Al
>
> > "Samantha Chan" <chanskw@ca.ibm.com> wrote in message
> > news:acgufg$khg$1@rogue.oti.com...
> > > Hi Allan,
> > >
> > > Could you also let me know what you have modified for this problem?
> > > I would like to take a look at it and test it out as well.
> > >
> > > Thanks
> > > Samantha
> > >
> > > Allan Clearwaters wrote:
> > >
> > > > Having suffer a problem debugging under Windows with Cygwin
installed I
> > > > decided to dig a bit further. I loaded the gdbpicl source and had a
> > look at
> > > > the pathname generation code. If this is actually tageted at Unix
then
> > I
> > > > believe the convention should be to escape control and non-printing
> > > > charaters in the pathname, ie. the path "/a/b c/d" should be
modified to
> > > > "a/b\ c/c" according to Unix conventions. This would certainly fix
the
> > > > problem for me windows and make things much more tranparent (like
you
> > > > wouldn't have to worry about where your source was in a directory
> > > > structure).
> > >
> > > > In trying to test this mod I'm confused about how the debug
inspector
> > works.
> > > > It keeps giving me a popup to the effect '... cannot resolve...'
name if
> > the
> > > > name is anything other than this or one declared in the method.
Have I
> > > > missed a setting somewhere?
> > >
> > > > Regarding the pathname stuff, I think this change should be made.
For
> > Unix
> > > > it's neutral, for windows it's a real bonus.
> > >
> > > > Thanx,
> > > > Al
> > >
> > >
> > >
> > >
> > >
>
>
>
>
>
|
|
|
Re: Debug target pathname [message #35090 is a reply to message #34443] |
Thu, 30 May 2002 16:30  |
Eclipse User |
|
|
|
Hi Allan,
I agree about the ambiguity of '\'. I will put in your recommended
changes.
Thanks
Samantha
Allan Clearwaters wrote:
> Samantha,
> Had a look - 2 comments:
> 1) The interpretation of the '\' char in the input string is ambiguous.
> You can either treat it as a character to be escaped (as you have) or assume
> the caller has already constructed a string with an escaped character in it.
> In the latter case your code adds a newly escaped '\' to the string. I not
> sure this what you want. I'm inclined to consider a '\' char in the input
> string as being there on purpose and leave the next character alone.
> 2) I implemented a method rather than simply embed the code since this is a
> generally useful utility. That's a matter of taste.
> I'd be inclined to change as follows:
> private String escapeChars=" ~`!@#$%^&()+={}[];,/:*?\"<>|";
> StringBuffer buffer = new StringBuffer();
> char[] mainProg = _mainProgram.toCharArray();
> boolean escaped = false;
> for (int i=0; i<mainProg.length; i++){
> if (escapeChars.indexOf(mainProg[i]) >= 0 && !escaped ){
> buffer.append('\\');
> }
> eacaped = (esacped)? false : (mainProg[i]=='\\' );
> buffer.append(mainProg[i]);
> }
> "Samantha Chan" <chanskw@ca.ibm.com> wrote in message
> news:acu6r3$6uq$1@rogue.oti.com...
> > Hi Allan,
> >
> > Thanks for letting me know.
> > I have also put in a fix for this problem.
> > Instead of just escaping spaces in the filename, I have included other
> > special characters to escape as well. My fix is in
> > GdbDebugSession.setStartProgramName.
> >
> > In addition to spaces, following characters are escaped:
> > ~`!@#$%^&()+={}[];,\/:*?"<>|
> >
> > I have checked in the code in CVS. You can get the fix by checking out
> > the most recent copy of GdbDebugSession.java from CVS.
> >
> > I hope it solves your problem running GDBPicl on Windows. Let me know if
> > you experience any problem.
> >
> > Thanks,
> >
> > Samantha
> >
> > Allan Clearwaters wrote:
> >
> > > Samantha,
> >
> > > I've fixed this problem, ie. I now have a version of CDT that properly
> > > handles pathnames with embedded spaces on Windows and cygwin gdb. The
> > > changes (at least as I've done them) are to add a static method to Gdb
> that
> > > does the work of escaping the filename string and then use this method
> to
> > > modify the path passed to GetDebugSession.setStartProgramNameString().
> I am
> > > now a happy puppy. If you wish to see these changes please contact me
> at
> > > allan@object-forge.com and I'll ship you the modified gdbPicl package.
> >
> > > Thanx,
> > > Al
> >
> > > "Samantha Chan" <chanskw@ca.ibm.com> wrote in message
> > > news:acgufg$khg$1@rogue.oti.com...
> > > > Hi Allan,
> > > >
> > > > Could you also let me know what you have modified for this problem?
> > > > I would like to take a look at it and test it out as well.
> > > >
> > > > Thanks
> > > > Samantha
> > > >
> > > > Allan Clearwaters wrote:
> > > >
> > > > > Having suffer a problem debugging under Windows with Cygwin
> installed I
> > > > > decided to dig a bit further. I loaded the gdbpicl source and had a
> > > look at
> > > > > the pathname generation code. If this is actually tageted at Unix
> then
> > > I
> > > > > believe the convention should be to escape control and non-printing
> > > > > charaters in the pathname, ie. the path "/a/b c/d" should be
> modified to
> > > > > "a/b\ c/c" according to Unix conventions. This would certainly fix
> the
> > > > > problem for me windows and make things much more tranparent (like
> you
> > > > > wouldn't have to worry about where your source was in a directory
> > > > > structure).
> > > >
> > > > > In trying to test this mod I'm confused about how the debug
> inspector
> > > works.
> > > > > It keeps giving me a popup to the effect '... cannot resolve...'
> name if
> > > the
> > > > > name is anything other than this or one declared in the method.
> Have I
> > > > > missed a setting somewhere?
> > > >
> > > > > Regarding the pathname stuff, I think this change should be made.
> For
> > > Unix
> > > > > it's neutral, for windows it's a real bonus.
> > > >
> > > > > Thanx,
> > > > > Al
> > > >
> > > >
> > > >
> > > >
> > > >
> >
> >
> >
> >
> >
|
|
|
Goto Forum:
Current Time: Wed Apr 30 15:00:53 EDT 2025
Powered by FUDForum. Page generated in 0.29310 seconds
|