Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFA 2/2]  Remove old Cygwin1.5 support
@ 2011-04-06 22:58 Pierre Muller
  2011-04-07 23:44 ` Pedro Alves
  0 siblings, 1 reply; 3+ messages in thread
From: Pierre Muller @ 2011-04-06 22:58 UTC (permalink / raw)
  To: gdb-patches

Second part of the patch,

This part updates gdbserver/win32-low.c to use the
new cygwin_conv_path and cygwin_conv_path_list functions
in order to avoid build failure due to deprecated warning.

  Christopher, is this patch acceptable as is?

Pierre Muller.

2011-04-07  Pierre Muller  <muller@ics.u-strasbg.fr>

	Remove support for old Cygwin 1.5 versions.
	* win32-low.c (win32_create_inferior): Use new cygwin_path_list
	function to avoid warning.
	(win32_add_one_solib): Use cygwin_conv_path function to avoid
	warning.


diff --git a/gdb/gdbserver/win32-low.c b/gdb/gdbserver/win32-low.c
index b47081b..9cdd1b4 100644
--- a/gdb/gdbserver/win32-low.c
+++ b/gdb/gdbserver/win32-low.c
@@ -536,13 +536,15 @@ win32_create_inferior (char *program, char
**program_args)
   path_ptr = getenv ("PATH");
   if (path_ptr)
     {
+      int len = cygwin_conv_path_list (CCP_POSIX_TO_WIN_A, path_ptr, NULL,
0);
       orig_path = alloca (strlen (path_ptr) + 1);
-      new_path = alloca (cygwin_posix_to_win32_path_list_buf_size
(path_ptr));
+      new_path = alloca (len);
       strcpy (orig_path, path_ptr);
-      cygwin_posix_to_win32_path_list (path_ptr, new_path);
+      cygwin_conv_path_list (CCP_POSIX_TO_WIN_A, path_ptr, new_path, len);
       setenv ("PATH", new_path, 1);
-    }
-  cygwin_conv_to_win32_path (program, real_path);
+     }
+  cygwin_conv_path (CCP_POSIX_TO_WIN_A, program, real_path,
+		    MAXPATHLEN);
   program = real_path;
 #endif
 
@@ -925,7 +927,7 @@ win32_add_one_solib (const char *name, CORE_ADDR
load_addr)
 #endif
 
 #ifdef __CYGWIN__
-  cygwin_conv_to_posix_path (buf, buf2);
+  cygwin_conv_path (CCP_WIN_A_TO_POSIX, buf, buf2, sizeof (buf2));
 #else
   strcpy (buf2, buf);
 #endif


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [RFA 2/2]  Remove old Cygwin1.5 support
  2011-04-06 22:58 [RFA 2/2] Remove old Cygwin1.5 support Pierre Muller
@ 2011-04-07 23:44 ` Pedro Alves
  2011-04-08  0:01   ` Pierre Muller
  0 siblings, 1 reply; 3+ messages in thread
From: Pedro Alves @ 2011-04-07 23:44 UTC (permalink / raw)
  To: gdb-patches; +Cc: Pierre Muller

On Wednesday 06 April 2011 23:58:17, Pierre Muller wrote:
>    if (path_ptr)
>      {
> +      int len = cygwin_conv_path_list (CCP_POSIX_TO_WIN_A, path_ptr, NULL,
> 0);

Your use of `len' for the variable's name confused me into
thinking there's an off-by-one below.  The cygwin_conv_path_list function
returns a byte size including the null terminator, not a string
length.  Please rename the variable to `size'.  Okay with that change.

>        orig_path = alloca (strlen (path_ptr) + 1);
> -      new_path = alloca (cygwin_posix_to_win32_path_list_buf_size
> (path_ptr));
> +      new_path = alloca (len);
>        strcpy (orig_path, path_ptr);
> -      cygwin_posix_to_win32_path_list (path_ptr, new_path);
> +      cygwin_conv_path_list (CCP_POSIX_TO_WIN_A, path_ptr, new_path, len);
>        setenv ("PATH", new_path, 1);

-- 
Pedro Alves


^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: [RFA 2/2]  Remove old Cygwin1.5 support
  2011-04-07 23:44 ` Pedro Alves
@ 2011-04-08  0:01   ` Pierre Muller
  0 siblings, 0 replies; 3+ messages in thread
From: Pierre Muller @ 2011-04-08  0:01 UTC (permalink / raw)
  To: 'Pedro Alves', gdb-patches



> -----Message d'origine-----
> De : gdb-patches-owner@sourceware.org [mailto:gdb-patches-
> owner@sourceware.org] De la part de Pedro Alves
> Envoyé : vendredi 8 avril 2011 01:44
> À : gdb-patches@sourceware.org
> Cc : Pierre Muller
> Objet : Re: [RFA 2/2] Remove old Cygwin1.5 support
> 
> On Wednesday 06 April 2011 23:58:17, Pierre Muller wrote:
> >    if (path_ptr)
> >      {
> > +      int len = cygwin_conv_path_list (CCP_POSIX_TO_WIN_A, path_ptr,
> NULL,
> > 0);
> 
> Your use of `len' for the variable's name confused me into
> thinking there's an off-by-one below.  The cygwin_conv_path_list function
> returns a byte size including the null terminator, not a string
> length.  Please rename the variable to `size'.  Okay with that change.

  Checked in with your variable name modification.

Thanks for the approval,

Pierre


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-04-08  0:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-06 22:58 [RFA 2/2] Remove old Cygwin1.5 support Pierre Muller
2011-04-07 23:44 ` Pedro Alves
2011-04-08  0:01   ` Pierre Muller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox