diff options
Diffstat (limited to 'src/minidump.h')
-rw-r--r-- | src/minidump.h | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/src/minidump.h b/src/minidump.h new file mode 100644 index 0000000..99bfe76 --- /dev/null +++ b/src/minidump.h @@ -0,0 +1,61 @@ +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ + +#ifndef foominidumphfoo +#define foominidumphfoo + +/*** + This file is part of libminidump. + + Copyright 2012 Lennart Poettering + + libminidump is free software; you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as + published by the Free Software Foundation; either version 2.1 of the + License, or (at your option) any later version. + + libminidump is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with libminidump; If not, see + <http://www.gnu.org/licenses/>. +***/ + +#include <sys/types.h> +#include <stdio.h> + +/* Terms: + * + * coredump: an ELF coredump as generated by the kernel + * minicore: an reduced size ELF coredump, augmented with userspace data + * minidump: a Windows/Breakpad compatible minidump + * + * We can convert: + * + * A running process → minidump + * A running process → minicore + * A coredump → minidump + * A coredump → minicore + * A coredump + running process → minidump + * A coredump + running process → minicore + * A minidump → minicore + * + * A minicore may be used as input wherever a coredump is expected. + */ + +/* You may set either pid = 0 or coredump_fd = -1 */ +int minidump_make(pid_t pid, int coredump_fd, void **minidump, size_t *size); + +/* You may set either pid = 0 or coredump_fd = -1 */ +int minicore_make(pid_t pid, int coredump_fd, void **minicore, size_t *size); + +int minidump_show(FILE *f, int minidump_fd); + +/* You may set either pid = 0 or coredump_fd = -1 */ +int coredump_show(FILE *f, pid_t pid, int coredump_fd); + +int minidump_to_minicore(int minidump_fd, void **minicore, size_t *size); + +#endif |