summaryrefslogtreecommitdiffstats
path: root/toolkit/crashreporter/nsDummyExceptionHandler.cpp
blob: 3d077d1a8bd3c1b9e4cbd0afa8b5aeff1a4070bb (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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#include <functional>

#include "nsExceptionHandler.h"
#include "nsExceptionHandlerUtils.h"
#include "prio.h"

namespace CrashReporter {

void AnnotateOOMAllocationSize(size_t size) {}

void AnnotateTexturesSize(size_t size) {}

void AnnotatePendingIPC(size_t aNumOfPendingIPC, uint32_t aTopPendingIPCCount,
                        const char* aTopPendingIPCName,
                        uint32_t aTopPendingIPCType) {}

nsresult SetExceptionHandler(nsIFile* aXREDirectory, bool force /*=false*/) {
  return NS_ERROR_NOT_IMPLEMENTED;
}

bool GetEnabled() { return false; }

bool GetMinidumpPath(nsAString& aPath) { return false; }

nsresult SetMinidumpPath(const nsAString& aPath) {
  return NS_ERROR_NOT_IMPLEMENTED;
}

nsresult SetupExtraData(nsIFile* aAppDataDirectory,
                        const nsACString& aBuildID) {
  return NS_ERROR_NOT_IMPLEMENTED;
}

nsresult UnsetExceptionHandler() { return NS_ERROR_NOT_IMPLEMENTED; }

nsresult AnnotateCrashReport(Annotation key, bool data) {
  return NS_ERROR_NOT_IMPLEMENTED;
}

nsresult AnnotateCrashReport(Annotation key, int data) {
  return NS_ERROR_NOT_IMPLEMENTED;
}

nsresult AnnotateCrashReport(Annotation key, unsigned int data) {
  return NS_ERROR_NOT_IMPLEMENTED;
}

nsresult AnnotateCrashReport(Annotation key, const nsACString& data) {
  return NS_ERROR_NOT_IMPLEMENTED;
}

nsresult AppendToCrashReportAnnotation(Annotation key, const nsACString& data) {
  return NS_ERROR_NOT_IMPLEMENTED;
}

nsresult RemoveCrashReportAnnotation(Annotation key) {
  return NS_ERROR_NOT_IMPLEMENTED;
}

AutoAnnotateCrashReport::AutoAnnotateCrashReport(Annotation key, bool data) {}

AutoAnnotateCrashReport::AutoAnnotateCrashReport(Annotation key, int data) {}

AutoAnnotateCrashReport::AutoAnnotateCrashReport(Annotation key,
                                                 unsigned data) {}

AutoAnnotateCrashReport::AutoAnnotateCrashReport(Annotation key,
                                                 const nsACString& data) {}

AutoAnnotateCrashReport::~AutoAnnotateCrashReport() {}

void MergeCrashAnnotations(AnnotationTable& aDst, const AnnotationTable& aSrc) {
}

nsresult SetGarbageCollecting(bool collecting) {
  return NS_ERROR_NOT_IMPLEMENTED;
}

void SetEventloopNestingLevel(uint32_t level) {}

void SetMinidumpAnalysisAllThreads() {}

nsresult AppendAppNotesToCrashReport(const nsACString& data) {
  return NS_ERROR_NOT_IMPLEMENTED;
}

bool GetAnnotation(const nsACString& key, nsACString& data) { return false; }

void GetAnnotation(uint32_t childPid, Annotation annotation,
                   nsACString& outStr) {
  return;
}

nsresult RegisterAppMemory(void* ptr, size_t length) {
  return NS_ERROR_NOT_IMPLEMENTED;
}

nsresult UnregisterAppMemory(void* ptr) { return NS_ERROR_NOT_IMPLEMENTED; }

void SetIncludeContextHeap(bool aValue) {}

bool GetServerURL(nsACString& aServerURL) { return false; }

nsresult SetServerURL(const nsACString& aServerURL) {
  return NS_ERROR_NOT_IMPLEMENTED;
}

nsresult SetRestartArgs(int argc, char** argv) {
  return NS_ERROR_NOT_IMPLEMENTED;
}

#if !defined(XP_WIN)
int GetAnnotationTimeCrashFd() { return 7; }
#endif

void RegisterChildCrashAnnotationFileDescriptor(ProcessId aProcess,
                                                PRFileDesc* aFd) {
  // The real implementation of this function takes ownership of aFd
  // and closes it when the process exits; if we don't close it, it
  // causes a leak.  With no crash reporter we'll never write to the
  // pipe, so it's safe to close the read end immediately.
  PR_Close(aFd);
}

void DeregisterChildCrashAnnotationFileDescriptor(ProcessId aProcess) {}

#ifdef XP_WIN
nsresult WriteMinidumpForException(EXCEPTION_POINTERS* aExceptionInfo) {
  return NS_ERROR_NOT_IMPLEMENTED;
}
#endif

#ifdef XP_LINUX
bool WriteMinidumpForSigInfo(int signo, siginfo_t* info, void* uc) {
  return false;
}
#endif

#ifdef XP_MACOSX
nsresult AppendObjCExceptionInfoToAppNotes(void* inException) {
  return NS_ERROR_NOT_IMPLEMENTED;
}
#endif

nsresult GetSubmitReports(bool* aSubmitReports) {
  return NS_ERROR_NOT_IMPLEMENTED;
}

nsresult SetSubmitReports(bool aSubmitReports) {
  return NS_ERROR_NOT_IMPLEMENTED;
}

void SetProfileDirectory(nsIFile* aDir) {}

void SetUserAppDataDirectory(nsIFile* aDir) {}

void UpdateCrashEventsDir() {}

bool GetCrashEventsDir(nsAString& aPath) { return false; }

void SetMemoryReportFile(nsIFile* aFile) {}

nsresult GetDefaultMemoryReportFile(nsIFile** aFile) {
  return NS_ERROR_NOT_IMPLEMENTED;
}

void DeleteMinidumpFilesForID(const nsAString& aId,
                              const Maybe<nsString>& aAdditionalMinidump) {}

bool GetMinidumpForID(const nsAString& id, nsIFile** minidump,
                      const Maybe<nsString>& aAdditionalMinidump) {
  return false;
}

bool GetIDFromMinidump(nsIFile* minidump, nsAString& id) { return false; }

bool GetExtraFileForID(const nsAString& id, nsIFile** extraFile) {
  return false;
}

bool GetExtraFileForMinidump(nsIFile* minidump, nsIFile** extraFile) {
  return false;
}

bool WriteExtraFile(const nsAString& id, const AnnotationTable& annotations) {
  return false;
}

void OOPInit() {}

#if defined(XP_WIN) || defined(XP_MACOSX)
const char* GetChildNotificationPipe() { return nullptr; }
#endif

#ifdef MOZ_CRASHREPORTER_INJECTOR
void InjectCrashReporterIntoProcess(DWORD processID,
                                    InjectorCrashCallback* cb) {}

void UnregisterInjectorCallback(DWORD processID) {}

#endif  // MOZ_CRASHREPORTER_INJECTOR

bool GetLastRunCrashID(nsAString& id) { return false; }

#if !defined(XP_WIN) && !defined(XP_MACOSX)

bool CreateNotificationPipeForChild(int* childCrashFd, int* childCrashRemapFd) {
  return false;
}

#endif  // !defined(XP_WIN) && !defined(XP_MACOSX)

bool SetRemoteExceptionHandler(const char* aCrashPipe,
                               FileHandle aCrashTimeAnnotationFile) {
  return false;
}

bool TakeMinidumpForChild(uint32_t childPid, nsIFile** dump,
                          AnnotationTable& aAnnotations, uint32_t* aSequence) {
  return false;
}

bool FinalizeOrphanedMinidump(uint32_t aChildPid, GeckoProcessType aType,
                              nsString* aDumpId) {
  return false;
}

#if defined(XP_WIN)

DWORD WINAPI WerNotifyProc(LPVOID aParameter) { return 0; }

#endif  // defined(XP_WIN)

ThreadId CurrentThreadId() { return -1; }

bool TakeMinidump(nsIFile** aResult, bool aMoveToPending) { return false; }

bool CreateMinidumpsAndPair(ProcessHandle aTargetPid,
                            ThreadId aTargetBlamedThread,
                            const nsACString& aIncomingPairName,
                            AnnotationTable& aTargetAnnotations,
                            nsIFile** aTargetDumpOut) {
  return false;
}

bool UnsetRemoteExceptionHandler(bool wasSet) { return false; }

#if defined(MOZ_WIDGET_ANDROID)
void SetNotificationPipeForChild(FileHandle childCrashFd) {}

void SetCrashAnnotationPipeForChild(FileHandle childCrashAnnotationFd) {}

void AddLibraryMapping(const char* library_name, uintptr_t start_address,
                       size_t mapping_length, size_t file_offset) {}
#endif

}  // namespace CrashReporter