Review Request 121061: Fix environment-cd when launching a debugsession in a path containing spaces

Nicolas Werner nicolas.werner at ymail.com
Thu Nov 13 19:50:14 UTC 2014



> On Nov. 12, 2014, 6:13 nachm., Milian Wolff wrote:
> > Yeah that looks fine with me. we'll take care of merging that patch into master then. do you have commit rights? If so, go ahead and push that patch into 4.7. Otherwise we'll take care of that for you.
> > 
> > Thanks!
> 
> Nicolas Werner wrote:
>     No, I don't have any commit rights. Actually it's my first patch ever!
>     So I will rely on you to push it!
>     And the merge conflict is only about the change of dir to dir.toLocalFile()
> 
> Milian Wolff wrote:
>     I am just trying to add a unit test for this and notice that for me this works just fine currently. KShell::quoteArg wraps the string in single quotes for me and GDB seems to happily accept it. What GDB version are you using?

Strange.

gdb -v
GNU gdb (GDB; openSUSE 13.2) 7.8

And i can still reproduce it, removing the patch and launching a debug session, I get the following output, after activating debug messages:
kdevelop(6863)/kdevelop (gdb debugger) GDBDebugger::GDB::execute: SEND: "-environment-cd '/home/nicolas/Dokumente/devel/C++/Lone Writer/build/'
"
kdevelop(6863)/kdevelop (gdb debugger) GDBDebugger::GDB::processLine: GDB output:  "(gdb) "
kdevelop(6863)/kdevelop (gdb debugger) GDBDebugger::GDB::processLine: GDB output:  "^error,msg="-environment-cd: Usage DIRECTORY""
kdevelop(6863)/kdevelop (gdb debugger) GDBDebugger::GDB::processLine: Handling error

Also my Game doesn't display any graphics, as it doesn't find them in /home/nicolas ...


Actually I think, your test doesn't even test the right thing! I have no problem launching the application, but the application is running using the wrong working directory. So the program in the unit test would have to check it's working directory:
e.g. 
QString str = QDir::currentDirPath() 

or

char *path = NULL;
path = getcwd(NULL, 0);

though the second won't run on windows and the first will have to link to Qt


- Nicolas


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/121061/#review70290
-----------------------------------------------------------


On Nov. 8, 2014, 3:53 nachm., Nicolas Werner wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/121061/
> -----------------------------------------------------------
> 
> (Updated Nov. 8, 2014, 3:53 nachm.)
> 
> 
> Review request for KDevelop.
> 
> 
> Bugs: 339231
>     http://bugs.kde.org/show_bug.cgi?id=339231
> 
> 
> Repository: kdevelop
> 
> 
> Description
> -------
> 
> Problem: GDBMI only accepts paths containing spaces if they are in double quotes otherwise cd will fail.
> Solution: Add prepend and append double quotes to the dir string instead of using KShell::quoteArg
> 
> 
> Diffs
> -----
> 
>   debuggers/gdb/debugsession.cpp e37c5b7 
> 
> Diff: https://git.reviewboard.kde.org/r/121061/diff/
> 
> 
> Testing
> -------
> 
> I did a patch for 4.7, that fixed the problem, but I can't build master at the moment, so I don't know, if this compiles. It should fix the bug tough, as it is only a quoting issue.
> 
> Should I also attatch the patch for the 4.7 branch?
> 
> 
> Thanks,
> 
> Nicolas Werner
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20141113/59e27bab/attachment.html>


More information about the KDevelop-devel mailing list