Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-patch] Bug 25808 fixing (GPF when running CDT with j9)

This is a fixing of Bug 25808.
Remove not portable fragment of code (conversion start directory to native
format) relying on passing of correct argument from Spawner.java. Attached
also find spawner.dll (Win32)

Index: Win32ProcessEx.c
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core.win32/library/Win32ProcessEx.c,v
retrieving revision 1.2
diff -u -r1.2 Win32ProcessEx.c
--- Win32ProcessEx.c 16 Oct 2002 12:11:04 -0000 1.2
+++ Win32ProcessEx.c 7 Nov 2002 20:11:24 -0000
@@ -22,7 +22,7 @@
 #include "jni.h"
 #include "io.h"

-// #define DEBUG_MONITOR
+#define DEBUG_MONITOR

 #define PIPE_SIZE 512
 #define MAX_CMD_SIZE 1024
@@ -44,7 +44,6 @@
 static int procCounter = 0;


-JNIEXPORT void * JNICALL GetJVMProc(char * vmlib, char * procName);
 JNIEXPORT void JNICALL ThrowByName(JNIEnv *env, const char *name, const
char *msg);
 pProcInfo_t createProcInfo();
 pProcInfo_t findProcInfo(int pid);
@@ -197,9 +196,8 @@

     if (dir != 0)
   {
-  const char *  str = NULL;
-  JVM_NativePath nativePath = GetJVMProc(NULL, "_JVM_NativePath@4");
-  cwd = strdup(nativePath(str = (*env) -> GetStringUTFChars(env, dir, 0)));
+  const char * str = NULL;
+  cwd = strdup((*env) -> GetStringUTFChars(env, dir, 0));
   (*env) -> ReleaseStringUTFChars(env, dir, str);
   }

@@ -397,8 +395,9 @@

     if (dir != 0)
   {
-  JVM_NativePath nativePath = GetJVMProc(NULL, "_JVM_NativePath@4");
-  cwd = strdup(nativePath((*env) -> GetStringUTFChars(env, dir, 0)));
+  const char * str = NULL;
+  cwd = strdup((*env) -> GetStringUTFChars(env, dir, 0));
+  (*env) -> ReleaseStringUTFChars(env, dir, str);
   }


@@ -469,6 +468,8 @@
  pProcInfo_t pCurProcInfo = findProcInfo(uid);
 #ifdef DEBUG_MONITOR
  char buffer[100];
+ sprintf(buffer, "Spawner received signal %i for process %i\n", signal,
pCurProcInfo -> pid);
+ OutputDebugString(buffer);
 #endif

  if(NULL == pCurProcInfo)
@@ -539,7 +540,7 @@

     if (what == WAIT_OBJECT_0)
   {
-  GetExitCodeProcess((void *)(pCurProcInfo -> pid), &exit_code);
+  GetExitCodeProcess(hProc, &exit_code);
   }


@@ -569,18 +570,6 @@



-JNIEXPORT void * JNICALL
-GetJVMProc(char * vmlib, char * procName)
-{
- if(NULL == vmlib)
-  vmlib = "jvm.dll";
- if(NULL == hVM)
-  {
-  if(NULL == (hVM = GetModuleHandle(vmlib)))
-   return NULL;
-  }
- return GetProcAddress(hVM, procName);
-}

 pProcInfo_t createProcInfo()
 {
@@ -691,7 +680,7 @@
     cleanUpProcBlock(pInfo + i);
     }
    break;
-  } // Otherwise failed because was not started
+   } // Otherwise failed because was not started
   }

  CloseHandle(hProc);


Attachment: spawner.dll
Description: application/msdownload


Back to the top