VirtualBox

source: vbox/trunk/include/iprt/coredumper.h@ 38761

Last change on this file since 38761 was 32411, checked in by vboxsync, 14 years ago

Runtime/r3/coredumper: addressed some todos in r65763.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.3 KB
Line 
1/** @file
2 * IPRT - Core Dumper.
3 */
4
5/*
6 * Copyright (C) 2010 Oracle Corporation
7 *
8 * This file is part of VirtualBox Open Source Edition (OSE), as
9 * available from http://www.virtualbox.org. This file is free software;
10 * you can redistribute it and/or modify it under the terms of the GNU
11 * General Public License (GPL) as published by the Free Software
12 * Foundation, in version 2 as it comes in the "COPYING" file of the
13 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
14 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
15 *
16 * The contents of this file may alternatively be used under the terms
17 * of the Common Development and Distribution License Version 1.0
18 * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
19 * VirtualBox OSE distribution, in which case the provisions of the
20 * CDDL are applicable instead of those of the GPL.
21 *
22 * You may elect to license modified versions of this file under the
23 * terms and conditions of either the GPL or the CDDL or both.
24 */
25
26#ifndef ___iprt_coredumper_h
27#define ___iprt_coredumper_h
28
29#include <iprt/cdefs.h>
30#include <iprt/types.h>
31
32RT_C_DECLS_BEGIN
33
34/** @defgroup grp_rt_coredumper RTCoreDumper - Core Dumper.
35 * @ingroup grp_rt
36 * @{
37 */
38
39/** @name RTCoreDumperSetup flags
40 * @{ */
41/** Override system core dumper. Registers handlers for
42 * SIGSEGV/SIGTRAP/SIGBUS. */
43#define RTCOREDUMPER_FLAGS_REPLACE_SYSTEM_DUMP RT_BIT(0)
44/** Allow taking live process dumps (without killing process). Registers handler
45 * for SIGUSR2. */
46#define RTCOREDUMPER_FLAGS_LIVE_CORE RT_BIT(1)
47/** @} */
48
49/**
50 * Take a core dump of the current process without terminating it.
51 *
52 * @returns IPRT status code.
53 * @param pszOutputFile Name of the core file. If NULL use the
54 * default naming scheme.
55 * @param fLiveCore When true, the process is not killed after
56 * taking a core. Otherwise it will be killed. This
57 * works in conjuction with the flags set during
58 * RTCoreDumperSetup().
59 */
60RTDECL(int) RTCoreDumperTakeDump(const char *pszOutputFile, bool fLiveCore);
61
62/**
63 * Sets up and enables the core dumper.
64 *
65 * Installs signal / unhandled exception handlers for catching fatal errors
66 * that should result in a core dump. If you wish to install your own handlers
67 * you should do that after calling this function and make sure you pass on
68 * events you don't handle.
69 *
70 * This can be called multiple times to change the settings without needing to
71 * call RTCoreDumperDisable in between.
72 *
73 * @param pszOutputDir The directory to store the cores in. If NULL
74 * the current directory will be used.
75 * @param pszBaseName Base file name, no directory. If NULL the
76 * dumper will generate an appropriate name.
77 * @param fFlags Setup flags, 0 in NOT a valid flag, it must be
78 * one or more of RTCOREDUMPER_FLAGS_*.
79 */
80RTDECL(int) RTCoreDumperSetup(const char *pszOutputDir, uint32_t fFlags);
81
82/**
83 * Disables the core dumper, i.e. undoes what RTCoreDumperSetup did.
84 *
85 * @returns IPRT status code.
86 */
87RTDECL(int) RTCoreDumperDisable(void);
88
89/** @} */
90
91RT_C_DECLS_END
92
93#endif
94
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette