X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Kernel%2Fbinary.c;h=20da5c4eb70e81259d084452ddc8b91f1429d842;hb=89280969bb7e3d9dc9d415c3a0fb0760971754e6;hp=9534aaaf46db1700abafbb2629632a627a356467;hpb=95a9132bcc024715a0a87cb323d58967ea5b1803;p=tpg%2Facess2.git diff --git a/Kernel/binary.c b/Kernel/binary.c index 9534aaaf..20da5c4e 100644 --- a/Kernel/binary.c +++ b/Kernel/binary.c @@ -91,7 +91,6 @@ int Proc_Spawn(const char *Path) } /** - * \fn int Proc_Execve(char *File, char **ArgV, char **EnvP) * \brief Replace the current user image with another * \param File File to load as the next image * \param ArgV Arguments to pass to user @@ -118,6 +117,7 @@ int Proc_Execve(const char *File, const char **ArgV, const char **EnvP) argenvBytes += strlen(ArgV[argc])+1; for( envc = 0; EnvP && EnvP[envc]; envc++ ) argenvBytes += strlen(EnvP[envc])+1; + LOG("argc = %i, envc = %i", envc); argenvBytes = (argenvBytes + sizeof(void*)-1) & ~(sizeof(void*)-1); argenvBytes += (argc+1)*sizeof(void*) + (envc+1)*sizeof(void*); @@ -136,6 +136,7 @@ int Proc_Execve(const char *File, const char **ArgV, const char **EnvP) { argvSaved[i] = strBuf; strcpy(argvSaved[i], ArgV[i]); + LOG("argv[%i] = '%s'", i, strBuf); strBuf += strlen(ArgV[i])+1; } argvSaved[i] = NULL; @@ -143,6 +144,7 @@ int Proc_Execve(const char *File, const char **ArgV, const char **EnvP) for( i = 0; i < envc; i++ ) { envpSaved[i] = strBuf; + LOG("envp[%i] = '%s'", i, strBuf); strcpy(envpSaved[i], EnvP[i]); strBuf += strlen(EnvP[i])+1; } @@ -375,7 +377,7 @@ tVAddr Binary_MapIn(tBinary *Binary, const char *Path, tVAddr LoadMin, tVAddr Lo } } - Log_Debug("Binary", "PID %i - Mapped '%s' to 0x%x", Threads_GetPID(), Path, base); + Log_Debug("Binary", "PID %i - Mapped '%s' to %p", Threads_GetPID(), Path, base); VFS_Close(fd); LEAVE('p', base); @@ -450,8 +452,6 @@ tBinary *Binary_DoLoad(tMount MountID, tInode Inode, const char *Path) break; } - LOG("pBinary = %p", pBinary); - // Close File VFS_Close(fp); @@ -463,6 +463,8 @@ tBinary *Binary_DoLoad(tMount MountID, tInode Inode, const char *Path) return NULL; } + LOG("pBinary = %p", pBinary); + // Error Check if(pBinary == NULL) { LEAVE('n');