bcb4e51a409d94ae670de96afb8483a4f7855294Stephan Bosch/* Copyright (c) 2006-2018 Dovecot authors, see the included COPYING file */
85f0f2bc9aab01b74835d12ee0a12a2b38349938Timo Sirainen i_fatal("Usage: gdbhelper <program> [<args>]");
85f0f2bc9aab01b74835d12ee0a12a2b38349938Timo Sirainen "handle SIGALRM nostop\n"
3356d08585f283681b473dd6cc6cbfddd716ffd7Timo Sirainen "handle SIG32 nostop\n"
85f0f2bc9aab01b74835d12ee0a12a2b38349938Timo Sirainen cmd = t_strdup_printf("gdb %s %s", argv[1], dec2str(pid));
f57e8837e1675791f9e4a6e270004ac613b9d506Timo Sirainen if (!WIFEXITED(status) || WEXITSTATUS(status) != 0) {
2a97481b6131ef21baf95c17f2d729515574b9b9Timo Sirainen path = t_strdup_printf("/tmp/gdbhelper.%s.%s",
2a97481b6131ef21baf95c17f2d729515574b9b9Timo Sirainen fd_log = open(path, O_CREAT | O_WRONLY, 0600);
2a97481b6131ef21baf95c17f2d729515574b9b9Timo Sirainen while ((ret = read(fd_out[0], buf, sizeof(buf))) > 0) {