⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 getcoredump.man

📁 能把所有线程的数据和环境记录到文件,方便调试.
💻 MAN
字号:
'\" t.TH GETCOREDUMP 3 "Feb 15, 2007".SH NAMEGetCoreDump, GetCompressedCoreDump \- creates a copy-on-write snapshotof the current process.SH SYNOPSIS.ad l.PP.B "#include \*(lqgoogle/coredumper.h\*(rq".PP.B int GetCoreDump(void);.HP 26.BI int\~Get\%Compressed\%Core\%Dump(const\~struct\~Coredumper\%Compressor\ \:\    compressors[] ,\ \:struct\~Coredumper\%Compressor\ \:** selected_compressor );.ad b.SH DESCRIPTIONThe \fBGetCoreDump\fP() function returns a file handle that can beread to obtain a snapshot of the current state of the calling process..PPThe \fBGetCompressedCoreDump\fP() function returns a file handle to acore file that has been compressed on the fly. In.IR compressor ,the caller passes a pointer to an array of possible compressors:.sp.RS.nfstruct CoredumperCompressor {  const char *compressor;  // File name of compressor; e.g. \*(lqgzip\*(rq  const char *const *args; // execv()-style command line arguments  const char *suffix;      // File name suffix; e.g. \*(lq.gz\*(rq};.fi.RE.PPThe.I suffixwill be ignored by the \fBGetCoreDump\fP() and\fBGetCompressedCoreDump\fP() functions, and is only needed for the\fBWriteCoreDump\fP() family of functions..PPArray entries will be tried in sequence until an executable compressorhas been found or the end of the array has been reached. The end issignalled by an entry that has been zero'd out completely. An emptystring in place of the.I compressorname signals that no compression should be performed..PPThere are several pre-defined compressor descriptions available:.TP \w'COREDUMPER_'u.B COREDUMPER_COMPRESSEDTry compressing with either.BR bzip2 (1),.BR gzip (1),or .BR compress (1).If all of those fail, fall back on generating an uncompressed image..TP.B COREDUMPER_BZIP2_COMPRESSED.TP.B COREDUMPER_GZIP_COMPRESSED.TP.B COREDUMPER_COMPRESS_COMPRESSEDTry compressing with a specific compressor. Fail if no compressor couldbe found..TP.B COREDUMPER_TRY_BZIP2_COMPRESSED.TP.B COREDUMPER_TRY_GZIP_COMPRESSED.TP.B COREDUMPER_TRY_COMPRESS_COMPRESSEDTry compressing with a specific compressor. Fall back on generating anuncompressed image, if the specified compressor is unavailable..TP.B COREDUMPER_UNCOMPRESSEDAlways create an uncompressed core file..PPIf.I selected_compressoris non-NULL, it will be set to the actual.I CoredumperCompressorobject used..SH RETURN VALUEBoth \fBGetCoreDump\fP(), and \fBGetCompressedCoreDump\fP() return anon-seekable file handle on success. The copy-on-write snapshot willautomatically be released, when the caller \fBclose\fP()s this filehandle..PPOn error \-1 will be returned and.I errnowill be set appropriately..SH ERRORSThe most common reason for failure is for another process to alreadyuse the debugging API that is needed to generate the corefiles. This could, for instance, be.BR gdb (1),or.BR strace(1)..SH NOTESThe coredumper functions momentarily suspend all threads, whilecreating a COW (copy-on-write) copy of the process's addressspace. The snapshot shows up as a new child process of the currentprocess, but memory requirements are relatively small, as most pagesare shared between parent and child..PPThe functions are neither reentrant nor async signal safe. Callersshould wrap a mutex around their invocation, if necessary..PPThe current implementation tries very hard to behave reasonably whencalled from a signal handler, but no guarantees are made that thiswill always work. Most importantly, it is the caller's responsibilityto make sure that there are never more than one instance of functionsfrom the \fBGetCoreDump\fP() or \fBWriteCoreDump\fP() family executingconcurrently..SH "SEE ALSO".BR WriteCoreDump (3),.BR WriteCoreDumpLimited (3),and.BR WriteCompressedCoreDump(3).

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -