MCD_DUMP_DATA_REGISTER_TEXT(3)
π MCD_DUMP_DATA_REGISTER_TEXT(3) π
okay bestie, welcome to the minicoredumper corner of the manual pages π this one's all about mcd_dump_data_register_text and mcd_vdump_data_register_text β the lil functions that let you register text data to be dumped. yes babe, we're putting text in your core dumps. iconic.
β¨ NAME β¨
mcd_dump_data_register_text, mcd_vdump_data_register_text β register text data to be dumped π¦
β¨ SYNOPSIS β¨
#include <minicoredumper.h>
int mcd_dump_data_register_text(const char *ident,
unsigned long dump_scope,
mcd_dump_data_t *save_ptr,
const char *fmt, ...);
int mcd_vdump_data_register_text(const char *ident,
unsigned long dump_scope,
mcd_dump_data_t *save_ptr,
const char *fmt,
va_list ap);
Compile and link with -lminicoredumper. π
β¨ DESCRIPTION β¨
so mcd_dump_data_register_text() literally just registers text data to be dumped. that's the whole vibe. π
ident is a string that identifies the text dump later. it must be non-NULL, no exceptions bestie. and if your ident isn't unique? not a problem, the text dump gets appended to previously registered text dumps that share the same ident. cute, right? π«Ά
the data only actually gets dumped if a scope value greater than or equal to dump_scope is requested by the minicoredumper(8). so like, scope check first, dump later. π§
if save_ptr is non-NULL, a pointer to the registered dump gets stored right there. you need this if you're gonna use mcd_dump_data_unregister(3). don't skip it, iykyk.
fmt is a printf(3) format string, and it's what prints the text data to a dump file. the remaining arguments are pointer arguments specified by fmt. and here's the tea β β each pointer argument must be of a type that's appropriate for the associated length modifier and conversion specifier in fmt. and because the arguments are always pointers, the syntax for these arguments matches that of scanf(3). yes, scanf. it's giving pointer energy. π₯
now, mcd_vdump_data_register_text() is equivalent to mcd_dump_data_register_text() except it's called with a va_list instead of a variable number of arguments. same girl, different entrance. β¨
big important note: these functions do not call the va_end macro. and because they invoke the va_arg macro, the value of ap is undefined after the call. see stdarg(3). no cap, that's just how it is. π
β¨ RETURN VALUE β¨
mcd_dump_data_register_text() and mcd_vdump_data_register_text() return 0 on success. otherwise, an error value is returned. simple as that. πΈ
β¨ ERRORS β¨
ENOMEMβ insufficient memory available to allocate internal structures πEINVALβidentwas invalid orfmtwasNULLπEEXISTβ a binary dump matchingidentwas already registered π³
β¨ EXAMPLE β¨
register a text dump with 2 different sized variables. look at her go:
mcd_dump_data_t dd;
unsigned long val1;
unsigned char val2;
mcd_dump_data_register_text("tdump.txt", 6, &dd,
"val1=0x%lx val2=0x%hhx\n",
&val1, &val2);
ate. no crumbs. π
β¨ BUGS β¨
okay so when dumping, each pointer argument is typecasted based on the length modifier and conversion specifier associated with that argument. if this doesn't match the true type of the variable, the dumped text may be invalid. so pls, pls match your types. π
and also β the string specified in ident is also the file name of the text dump file. for this reason, characters such as / are not permitted. like, at all. β οΈ
β¨ SEE ALSO β¨
The DiaMon Workgroup: <http://www.diamon.org> π
mwah π this page came straight from minicoredumper, dated 2016-09-12, and it's still serving MCD_DUMP_DATA_REGISTER_TEXT(3) realness. love that for us. bye bestie, go register some text πβ¨ππ¦πΈ
π¦ where this page comes from
- ubuntu stonking: libminicoredumper-dev 2.0.8-1 Β· BSD-2-Clause
- π the page's license: BSD-2-Clause
- Copyright (c) 2015-2026 Linutronix GmbH. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms