Audacity 3.2.0
Functions
anonymous_namespace{CrashReportContext.cpp} Namespace Reference

Functions

std::string StringifyParameters (const std::map< std::string, std::string > &parameters)
 
bool StrcpyChecked (char *dest, size_t destsz, const std::string &src)
 
bool DumpCallback (const google_breakpad::MinidumpDescriptor &descriptor, void *context, bool succeeded)
 
bool StrcpyChecked (wchar_t *dest, size_t destsz, const wchar_t *src)
 
bool StrcatChecked (wchar_t *dest, size_t destsz, const wchar_t *src)
 

Detailed Description


Audacity: A Digital Audio Editor

CrashReportContext.cpp

Vitaly Sverchinsky

Some parts of the code are designed to operate while app is crashing, so there may be some restrictions on heap usage. For more information please read Breakpad documentation.

Function Documentation

◆ DumpCallback()

bool anonymous_namespace{CrashReportContext.cpp}::DumpCallback ( const google_breakpad::MinidumpDescriptor &  descriptor,
void *  context,
bool  succeeded 
)

Definition at line 103 of file unix/CrashReportContext.cpp.

104 {
105 if(succeeded)
106 {
107 auto crashReportContext = static_cast<CrashReportContext*>(context);
108 return SendReport(crashReportContext, descriptor.path());
109 }
110 return succeeded;
111 }
This object is for internal usage.
bool SendReport(CrashReportContext *c, const char *minidumpPath)

References SendReport().

Referenced by CrashReportContext::StartHandler().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ StrcatChecked()

bool anonymous_namespace{CrashReportContext.cpp}::StrcatChecked ( wchar_t *  dest,
size_t  destsz,
const wchar_t *  src 
)

Definition at line 40 of file win32/CrashReportContext.cpp.

41 {
42 auto srclen = wcslen(src);
43 auto dstlen = wcslen(dest);
44 if (srclen + dstlen < destsz)
45 {
46 memcpy(dest + dstlen, src, sizeof(wchar_t) * srclen);
47 dest[srclen + dstlen] = 0;
48 return true;
49 }
50 return false;
51 }

◆ StrcpyChecked() [1/2]

bool anonymous_namespace{CrashReportContext.cpp}::StrcpyChecked ( char *  dest,
size_t  destsz,
const std::string &  src 
)

Definition at line 68 of file unix/CrashReportContext.cpp.

69 {
70 if(src.length() < destsz)
71 {
72 memcpy(dest, src.c_str(), src.length());
73 dest[src.length()] = '\0';
74 return true;
75 }
76 return false;
77 }

Referenced by CrashReportContext::SetParameters(), CrashReportContext::SetReportURL(), and CrashReportContext::SetSenderPathUTF8().

Here is the caller graph for this function:

◆ StrcpyChecked() [2/2]

bool anonymous_namespace{CrashReportContext.cpp}::StrcpyChecked ( wchar_t *  dest,
size_t  destsz,
const wchar_t *  src 
)

Definition at line 26 of file win32/CrashReportContext.cpp.

27 {
28 auto len = wcslen(src);
29 if (len < destsz)
30 {
31 memcpy(dest, src, sizeof(wchar_t) * len);
32 dest[len] = 0;
33 return true;
34 }
35 return false;
36 }

◆ StringifyParameters()

std::string anonymous_namespace{CrashReportContext.cpp}::StringifyParameters ( const std::map< std::string, std::string > &  parameters)

Definition at line 50 of file unix/CrashReportContext.cpp.

51 {
52 std::stringstream stream;
53
54 std::size_t parameterIndex = 0;
55 std::size_t parametersCount = parameters.size();
56 for (auto& pair : parameters)
57 {
58 stream << pair.first.c_str() << "=\"" << pair.second.c_str() << "\"";
59 ++parameterIndex;
60 if (parameterIndex < parametersCount)
61 stream << ",";
62 }
63 return stream.str();
64 }

Referenced by CrashReportContext::SetParameters().

Here is the caller graph for this function: