summaryrefslogtreecommitdiffstats
blob: b63180d349830b65ffb7504838783b57bfbe0ef1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
diff --git a/3rdParty/Breakpad/src/client/windows/handler/exception_handler.cc b/3rdParty/Breakpad/src/client/windows/handler/exception_handler.cc
index 6e5b724..272ca5f 100644
--- a/3rdParty/Breakpad/src/client/windows/handler/exception_handler.cc
+++ b/3rdParty/Breakpad/src/client/windows/handler/exception_handler.cc
@@ -124,6 +124,7 @@ void ExceptionHandler::Initialize(const wstring& dump_path,
   callback_ = callback;
   callback_context_ = callback_context;
   dump_path_c_ = NULL;
+  dump_filename_prefix_c_ = NULL;
   next_minidump_id_c_ = NULL;
   next_minidump_path_c_ = NULL;
   dbghelp_module_ = NULL;
@@ -217,6 +218,7 @@ void ExceptionHandler::Initialize(const wstring& dump_path,
 
     // set_dump_path calls UpdateNextID.  This sets up all of the path and id
     // strings, and their equivalent c_str pointers.
+    set_dump_filename_prefix(wstring());
     set_dump_path(dump_path);
   }
 
@@ -914,8 +916,8 @@ void ExceptionHandler::UpdateNextID() {
   next_minidump_id_c_ = next_minidump_id_.c_str();
 
   wchar_t minidump_path[MAX_PATH];
-  swprintf(minidump_path, MAX_PATH, L"%s\\%s.dmp",
-           dump_path_c_, next_minidump_id_c_);
+  swprintf(minidump_path, MAX_PATH, L"%s\\%s%s.dmp",
+           dump_path_c_, dump_filename_prefix_c_, next_minidump_id_c_);
 
   // remove when VC++7.1 is no longer supported
   minidump_path[MAX_PATH - 1] = L'\0';
diff --git a/3rdParty/Breakpad/src/client/windows/handler/exception_handler.h b/3rdParty/Breakpad/src/client/windows/handler/exception_handler.h
index 09f5177..6f59348 100644
--- a/3rdParty/Breakpad/src/client/windows/handler/exception_handler.h
+++ b/3rdParty/Breakpad/src/client/windows/handler/exception_handler.h
@@ -188,6 +188,12 @@ class ExceptionHandler {
     UpdateNextID();  // Necessary to put dump_path_ in next_minidump_path_.
   }
 
+  void set_dump_filename_prefix(const wstring& dump_prefix) {
+    dump_filename_prefix_ = dump_prefix;
+    dump_filename_prefix_c_ = dump_filename_prefix_.c_str();
+    UpdateNextID();
+  }
+
   // Requests that a previously reported crash be uploaded.
   bool RequestUpload(DWORD crash_id);
 
@@ -313,6 +319,9 @@ class ExceptionHandler {
   // argument to the constructor, or set_dump_path.
   wstring dump_path_;
 
+  // The filename prefix used for the minidump files.
+  wstring dump_filename_prefix_;
+
   // The basename of the next minidump to be written, without the extension.
   wstring next_minidump_id_;
 
@@ -327,6 +336,7 @@ class ExceptionHandler {
   // should be equivalent to the lifetimes of the associated wstring, provided
   // that the wstrings are not altered.
   const wchar_t* dump_path_c_;
+  const wchar_t* dump_filename_prefix_c_;
   const wchar_t* next_minidump_id_c_;
   const wchar_t* next_minidump_path_c_;