Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* Re: [RFC 6/9] Unify windows specifics into common/windows-hdep files
       [not found] <00b101cbeed2$b5aa4990$20fedcb0$%muller@ics-cnrs.unistra.fr>
@ 2011-03-30 21:00 ` Eli Zaretskii
  2011-03-31 13:58   ` Pierre Muller
  0 siblings, 1 reply; 3+ messages in thread
From: Eli Zaretskii @ 2011-03-30 21:00 UTC (permalink / raw)
  To: Pierre Muller; +Cc: gdb-patches

> From: "Pierre Muller" <pierre.muller@ics-cnrs.unistra.fr>
> Date: Wed, 30 Mar 2011 14:05:06 +0200
> 
> -  cygwin_conv_to_win32_path (program, real_path);
> +  windows_conv_path (WINDOWS_POSIX_TO_NATIVE_A, program, real_path,
> +		     MAXPATHLEN);
>    program = real_path;
>  #endif
>  
> @@ -924,11 +929,7 @@ win32_add_one_solib (const char *name, CORE_ADDR
> load_addr)
>      }
>  #endif
>  
> -#ifdef __CYGWIN__
> -  cygwin_conv_to_posix_path (buf, buf2);
> -#else
> -  strcpy (buf2, buf);
> -#endif
> +  windows_conv_path (WINDOWS_NATIVE_A_TO_POSIX, buf, buf2, MAX_PATH + 1);
>  
>    loaded_dll (buf2, load_addr);

See my other mail: windows_conv_path can fail, but the code does not
check for errors, and bravely used the possibly invalid results.


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

* RE: [RFC 6/9] Unify windows specifics into common/windows-hdep files
  2011-03-30 21:00 ` [RFC 6/9] Unify windows specifics into common/windows-hdep files Eli Zaretskii
@ 2011-03-31 13:58   ` Pierre Muller
  0 siblings, 0 replies; 3+ messages in thread
From: Pierre Muller @ 2011-03-31 13:58 UTC (permalink / raw)
  To: 'Eli Zaretskii'; +Cc: gdb-patches



> -----Message d'origine-----
> De : gdb-patches-owner@sourceware.org [mailto:gdb-patches-
> owner@sourceware.org] De la part de Eli Zaretskii
> Envoyé : mercredi 30 mars 2011 21:44
> À : Pierre Muller
> Cc : gdb-patches@sourceware.org
> Objet : Re: [RFC 6/9] Unify windows specifics into common/windows-hdep
files
> 
> > From: "Pierre Muller" <pierre.muller@ics-cnrs.unistra.fr>
> > Date: Wed, 30 Mar 2011 14:05:06 +0200
> >
> > -  cygwin_conv_to_win32_path (program, real_path);
> > +  windows_conv_path (WINDOWS_POSIX_TO_NATIVE_A, program, real_path,
> > +		     MAXPATHLEN);
> >    program = real_path;
> >  #endif
> >
> > @@ -924,11 +929,7 @@ win32_add_one_solib (const char *name, CORE_ADDR
> > load_addr)
> >      }
> >  #endif
> >
> > -#ifdef __CYGWIN__
> > -  cygwin_conv_to_posix_path (buf, buf2);
> > -#else
> > -  strcpy (buf2, buf);
> > -#endif
> > +  windows_conv_path (WINDOWS_NATIVE_A_TO_POSIX, buf, buf2, MAX_PATH +
1);
> >
> >    loaded_dll (buf2, load_addr);
> 
> See my other mail: windows_conv_path can fail, but the code does not
> check for errors, and bravely used the possibly invalid results.

  As said in other emails...
the existing code also didn't care to check for a possible error in
cygwin_conv_path.
But I agree with you that a check should be added,
I just don't really know what to do in case of failure...

Thanks again for the comments.

Pierre


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

* [RFC 6/9] Unify windows specifics into common/windows-hdep files
@ 2011-03-30 12:15 Pierre Muller
  0 siblings, 0 replies; 3+ messages in thread
From: Pierre Muller @ 2011-03-30 12:15 UTC (permalink / raw)
  To: gdb-patches



Patch that adapts gdbserver win32-low.c source code
to new windows-hdep code.

Pierre Muller
GDB pascal language maintainer

gdbserver/ChangeLog entry:

2011-03-30  Pierre Muller  <muller@ics.u-strasbg.fr>

	* win32-low.c (windows-hdep.h): New include.
	(win32_create_inferior): Adapt to windows-hdep code.
	(win32_add_one_solib): Likewise.


diff --git a/gdb/gdbserver/win32-low.c b/gdb/gdbserver/win32-low.c
index b47081b..b471dcd 100644
--- a/gdb/gdbserver/win32-low.c
+++ b/gdb/gdbserver/win32-low.c
@@ -25,6 +25,7 @@
 #include "gdb/fileio.h"
 #include "mem-break.h"
 #include "win32-low.h"
+#include "windows-hdep.h"
 
 #include <windows.h>
 #include <winnt.h>
@@ -536,13 +537,17 @@ win32_create_inferior (char *program, char
**program_args)
   path_ptr = getenv ("PATH");
   if (path_ptr)
     {
+      int len = windows_conv_path_list (WINDOWS_POSIX_TO_NATIVE_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);
+      windows_conv_path_list (WINDOWS_POSIX_TO_NATIVE_A, path_ptr,
+			      new_path, len);
       setenv ("PATH", new_path, 1);
     }
-  cygwin_conv_to_win32_path (program, real_path);
+  windows_conv_path (WINDOWS_POSIX_TO_NATIVE_A, program, real_path,
+		     MAXPATHLEN);
   program = real_path;
 #endif
 
@@ -924,11 +929,7 @@ win32_add_one_solib (const char *name, CORE_ADDR
load_addr)
     }
 #endif
 
-#ifdef __CYGWIN__
-  cygwin_conv_to_posix_path (buf, buf2);
-#else
-  strcpy (buf2, buf);
-#endif
+  windows_conv_path (WINDOWS_NATIVE_A_TO_POSIX, buf, buf2, MAX_PATH + 1);
 
   loaded_dll (buf2, load_addr);
 }
-- 
1.7.4




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

end of thread, other threads:[~2011-03-30 21:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <00b101cbeed2$b5aa4990$20fedcb0$%muller@ics-cnrs.unistra.fr>
2011-03-30 21:00 ` [RFC 6/9] Unify windows specifics into common/windows-hdep files Eli Zaretskii
2011-03-31 13:58   ` Pierre Muller
2011-03-30 12:15 Pierre Muller

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