1 |
/************************************************************************* |
/************************************************************************* |
2 |
* |
* |
3 |
* $Id: stacktrace.c,v 1.2 2005-02-09 01:22:17 schoenebeck Exp $ |
* $Id: stacktrace.c,v 1.3 2007-06-11 13:42:21 schoenebeck Exp $ |
4 |
* |
* |
5 |
* Copyright (c) 1998 by Bjorn Reese <breese@mail1.stofanet.dk> |
* Copyright (c) 1998 by Bjorn Reese <breese@mail1.stofanet.dk> |
6 |
* |
* |
35 |
# define PLATFORM_UNIX |
# define PLATFORM_UNIX |
36 |
#elif defined(WIN32) || defined(_WIN32) |
#elif defined(WIN32) || defined(_WIN32) |
37 |
# define PLATFORM_WIN32 |
# define PLATFORM_WIN32 |
38 |
|
#else |
39 |
|
# warning "No platform defined, automatic stack trace will fail!" |
40 |
#endif |
#endif |
41 |
|
|
42 |
#if defined(_AIX) || defined(__xlC__) |
#if defined(_AIX) || defined(__xlC__) |
161 |
default: /* Parent */ |
default: /* Parent */ |
162 |
//close(pipefd[1]); |
//close(pipefd[1]); |
163 |
//rc = pipefd[0]; |
//rc = pipefd[0]; |
164 |
|
rc = 0; // success |
165 |
break; |
break; |
166 |
} /* switch */ |
} /* switch */ |
167 |
} |
} |
447 |
} |
} |
448 |
while ((SYS_ERROR == rc) && (EINTR == errno)); |
while ((SYS_ERROR == rc) && (EINTR == errno)); |
449 |
|
|
450 |
|
//FIXME: deactivated separate piping of debugger output, as it caused problems in conjunction with threads |
451 |
|
/* |
452 |
if ((WIFEXITED(status)) && (WEXITSTATUS(status) == EXIT_SUCCESS)) |
if ((WIFEXITED(status)) && (WEXITSTATUS(status) == EXIT_SUCCESS)) |
453 |
{ |
{ |
454 |
while (my_getline(fd, buf, sizeof(buf))) |
while (my_getline(fd, buf, sizeof(buf))) |
471 |
write(global_output, "\n", strlen("\n")); |
write(global_output, "\n", strlen("\n")); |
472 |
} |
} |
473 |
} |
} |
474 |
|
*/ |
475 |
|
gotSomething = TRUE; //HACK: to compensate the commented FIXME block above |
476 |
|
|
477 |
my_pclose(fd, pid); |
my_pclose(fd, pid); |
478 |
} |
} |
479 |
return gotSomething; |
return gotSomething; |