This is the mail archive of the gdb-patches@sourceware.org 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: [PATCH v3 4/5] Implement "set cwd" command on GDB


> From: Sergio Durigan Junior <sergiodj@redhat.com>
> Cc: gdb-patches@sourceware.org,  palves@redhat.com
> Date: Fri, 22 Sep 2017 16:24:26 -0400
> 
> > No, I mean convert forward slashes to backslashes.
> 
> Sorry, I wasn't familiar with the term.

Nothing to be sorry about.

> Anyway, I think I can implement
> that.  In fact, I think gdbserver/win32-low.c:create_process already
> does that, right?
> 
>   wprogram = alloca ((strlen (program) + 1) * sizeof (wchar_t));
>   mbstowcs (wprogram, program, strlen (program) + 1);
> 
>   for (p = wprogram; *p; ++p)
>     if (L'/' == *p)
>       *p = L'\\';

Yes, that's it.  But this is for wchar_t strings, not for char
strings, of course.

Thanks.


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