Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 115941 Details for
Bug 251853
PTP PE plugin fails to start SDM debugger
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Fix SDM startup problems
proxy_patch.txt (text/plain), 5.53 KB, created by
David Wootton
on 2008-10-23 11:04:53 EDT
(
hide
)
Description:
Fix SDM startup problems
Filename:
MIME Type:
Creator:
David Wootton
Created:
2008-10-23 11:04:53 EDT
Size:
5.53 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.ptp.rm.ibm.pe.proxy >Index: src/ptp_ibmpe_proxy.c >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.ptp/rms/org.eclipse.ptp.rm.ibm.pe.proxy/src/ptp_ibmpe_proxy.c,v >retrieving revision 1.15 >diff -u -r1.15 ptp_ibmpe_proxy.c >--- src/ptp_ibmpe_proxy.c 7 Oct 2008 13:45:45 -0000 1.15 >+++ src/ptp_ibmpe_proxy.c 23 Oct 2008 14:49:30 -0000 >@@ -130,6 +130,11 @@ > pid_t poe_pid; /* Process id for main poe process */ > pid_t task0_pid; /* Process id for app. task 0 */ > int debugging; /* Job is being debugged */ >+ char *sdm_debugdir; /* Directory path for SDM debugger */ >+ char *sdm_debugname; /* Pathname to the top level debugger */ >+ char **sdm_debugargs; /* Array of debugger args */ >+ char **sdm_envp; /* Environment variables for SDM */ >+ int sdm_debug_arg_count; /* Number of debugger args */ > int stdin_fd; /* STDIN pipe/file descriptor */ > int stdout_fd; /* STDOUT pipe/file descriptor */ > int stderr_fd; /* STDERR pipe/file descriptor */ >@@ -1302,48 +1307,6 @@ > char queue_id_str[12]; > char jobid_str[12]; > >- if (debug_mode) { >- /* >- * If this is a debug session then we need to start the top level SDM process >- * at this point. The child SDM processes have already been created by the >- * fork/exec of the poe process (which in the debug case is 'poe sdm ...') above. >- */ >- pid_t sdm_pid; >- char *debugger; >- int len; >- char **argv; >- >- sdm_pid = fork(); >- if (sdm_pid == 0) { >- TRACE_DETAIL("+++ Ready to invoke top level SDM\n"); >- argv = create_debug_parmlist(debugname, debug_arg_count, debug_args, argp); >- len = strlen(debugdir) + strlen(debugname) + 2; >- debugger = (char *) malloc(len); >- malloc_check(debugger, __FUNCTION__, __LINE__); >- strcpy(debugger, debugdir); >- strcat(debugger, "/"); >- strcat(debugger, debugname); >-sleep(5); >- status = execve(debugger, argv, envp); >- print_message(ERROR_MESSAGE, "%s failed to execute, status %s\n", argv[0], strerror(errno)); >- post_submitjob_error(trans_id, jobid, "Exec failed"); >- TRACE_EXIT; >- exit(1); >- } >- else { >- if (sdm_pid == -1) { >- post_submitjob_error(trans_id, jobid, "Fork for top level SDMfailed"); >- return PROXY_RES_OK; >- } >- else { >- /* >- * This is the parent leg of the fork for invoking the top level SDM. >- * No explicit processing required here. All we care about is >- * eventually catching the SDM exit status so we don't create a zonbie. >- */ >- } >- } >- } > if (!job->stdout_redirect) { > close(stdout_pipe[1]); > } >@@ -1360,6 +1323,14 @@ > job->submit_time = time(NULL); > job->proxy_jobid = generate_id(); > job->debugging = debug_mode; >+ if (debug_mode) { >+ job->debugging = debug_mode; >+ job->sdm_envp = envp; >+ job->sdm_debugdir = debugdir; >+ job->sdm_debugname = debugname; >+ job->sdm_debugargs = debug_args; >+ job->sdm_debug_arg_count = debug_arg_count; >+ } > TRACE_DETAIL_V("+++ Created poe process pid %d for jobid %d\n", job->poe_pid, > job->proxy_jobid); > /* >@@ -1783,6 +1754,46 @@ > if (!job->stdout_redirect && !job->discovered_job) { > RegisterFileHandler(job->stdout_fd, READ_FILE_HANDLER, stdout_handler, job); > } >+ if (job->debugging) { >+ /* >+ * If this is a debug session then we need to start the top level SDM process >+ * at this point. The child SDM processes have already been created by the >+ * fork/exec of the poe process (which in the debug case is 'poe sdm ...') above. >+ */ >+ pid_t sdm_pid; >+ char *debugger; >+ int len; >+ char **argv; >+ >+ sdm_pid = fork(); >+ if (sdm_pid == 0) { >+ TRACE_DETAIL("+++ Ready to invoke top level SDM\n"); >+ argv = create_debug_parmlist(job->sdm_debugname, job->sdm_debug_arg_count, job->sdm_debugargs, argv); >+ len = strlen(job->sdm_debugdir) + strlen(job->sdm_debugname) + 2; >+ debugger = (char *) malloc(len); >+ malloc_check(debugger, __FUNCTION__, __LINE__); >+ strcpy(debugger, job->sdm_debugdir); >+ strcat(debugger, "/"); >+ strcat(debugger, job->sdm_debugname); >+sleep(5); >+ status = execve(debugger, argv, job->sdm_envp); >+ print_message(ERROR_MESSAGE, "%s failed to execute, status %s\n", argv[0], strerror(errno)); >+ TRACE_EXIT; >+ exit(1); >+ } >+ else { >+ if (sdm_pid == -1) { >+ return PROXY_RES_OK; >+ } >+ else { >+ /* >+ * This is the parent leg of the fork for invoking the top level SDM. >+ * No explicit processing required here. All we care about is >+ * eventually catching the SDM exit status so we don't create a zonbie. >+ */ >+ } >+ } >+ } > /* > * The startup thread exits at this point, so clear the reference in > * the job info >@@ -3069,12 +3080,13 @@ > int n; > int i; > >- argv = (char **) malloc((debug_args_count + 3) * sizeof(char *)); >+ argv = (char **) malloc((debug_args_count + 4) * sizeof(char *)); > malloc_check(argv, __FUNCTION__, __LINE__); > n = 0; > argv[n++] = debugname; > if (trace_sdm) { > argv[n++] = "--debug"; >+ argv[n++] = "--master"; > } > for (i = 0; i < debug_args_count; i++) { > argv[n++] = debug_args[i];
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
g.watson
:
iplog+
Actions:
View
|
Diff
Attachments on
bug 251853
: 115941