bool
CrashReporterParent::GenerateCrashReportForMinidump(nsIFile* minidump,
                                                    const AnnotationTable* processNotes)
{
  if (!CrashReporter::GetIDFromMinidump(minidump, mChildDumpID)) {
    return false;
  }

  bool result = GenerateChildData(processNotes);
  FinalizeChildData();
  return result;
}
示例#2
0
bool
CrashReporterParent::GenerateChildData(const AnnotationTable* processNotes)
{
    MOZ_ASSERT(mInitialized);

    if (mChildDumpID.IsEmpty()) {
      NS_WARNING("problem with GenerateChildData: no child dump id yet!");
      return false;
    }

    nsAutoCString type;
    switch (mProcessType) {
        case GeckoProcessType_Content:
            type = NS_LITERAL_CSTRING("content");
            break;
        case GeckoProcessType_Plugin:
        case GeckoProcessType_GMPlugin:
            type = NS_LITERAL_CSTRING("plugin");
            break;
        default:
            NS_ERROR("unknown process type");
            break;
    }
    mNotes.Put(NS_LITERAL_CSTRING("ProcessType"), type);

    char startTime[32];
    snprintf_literal(startTime, "%lld", static_cast<long long>(mStartTime));
    mNotes.Put(NS_LITERAL_CSTRING("StartupTime"), nsDependentCString(startTime));

    if (!mAppNotes.IsEmpty()) {
        mNotes.Put(NS_LITERAL_CSTRING("Notes"), mAppNotes);
    }

    // Append these notes to the end of the extra file based on the current
    // dump id we obtained from CreatePairedMinidumps.
    bool ret = CrashReporter::AppendExtraData(mChildDumpID, mNotes);
    if (ret && processNotes) {
        ret = CrashReporter::AppendExtraData(mChildDumpID, *processNotes);
    }

    if (!ret) {
        NS_WARNING("problem appending child data to .extra");
    }

    FinalizeChildData();
    return ret;
}