src/processor/bugsnag_stackwalk_wrapper.cc
// Gets an Event payload from the minidump.
// Note: Logic for parsing the minidump is based on PrintMinidumpProcess in
// minidump_stackwalk.cc
Gets an Event payload from the minidump.
Note: Logic for parsing the minidump is based on PrintMinidumpProcess in
minidump_stackwalk.cc
Gets an Event payload from the minidump . Note : Logic for parsing the minidump is based on PrintMinidumpProcess in minidump_stackwalk . cc
WrappedEvent GetEventFromMinidump(const char* filename,
                                  const int stack_module_details_count,
                                  SerializedModuleDetails** stack_module_details) {  
  WrappedEvent result = {{0}};
  try {
    FastSourceLineResolver resolver;
    loadModulesIntoResolver(&resolver, stack_module_details_count, stack_module_details);
    MinidumpProcessor minidump_processor(new SimpleSymbolSupplier(""), &resolver);
    MinidumpThreadList::set_max_threads(std::numeric_limits<uint32_t>::max());
    MinidumpMemoryList::set_max_regions(std::numeric_limits<uint32_t>::max());
    Minidump dump(filename);
    if (!dump.Read()) {
      result.pstrErr = strdup("failed to read minidump");
      return result;
    }
    ProcessState process_state;
    ProcessResult process_result =
        minidump_processor.Process(&dump, &process_state);
    if (process_result != google_breakpad::PROCESS_OK) {
      string errMsg = "failed to process minidump: " +
                      getFriendlyFailureReason(process_result);
      result.pstrErr = duplicate(errMsg);
      return result;
    }
    result.event = getEvent(process_state);
    result.event.metaData = getMinidumpMetadata(dump, process_state);
  } catch (const std::exception& ex) {
    string errMsg = "encountered exception: " + string(ex.what());
    result.pstrErr = duplicate(errMsg);
  } catch (...) {
    result.pstrErr = duplicate("encountered unknown exception");
  }
  return result;
}
WrappedEvent GetEventFromMinidump ( const char * filename , const int stack_module_details_count , SerializedModuleDetails * * stack_module_details ) { WrappedEvent result = { { 0 } } ; try { FastSourceLineResolver resolver ; loadModulesIntoResolver ( & resolver , stack_module_details_count , stack_module_details ) ; MinidumpProcessor minidump_processor ( new SimpleSymbolSupplier ( " " ) , & resolver ) ; MinidumpThreadList :: set_max_threads ( std :: numeric_limits < uint32_t > :: max ( ) ) ; MinidumpMemoryList :: set_max_regions ( std :: numeric_limits < uint32_t > :: max ( ) ) ; Minidump dump ( filename ) ; if ( ! dump . Read ( ) ) { result . pstrErr = strdup ( " " ) ; return result ; } ProcessState process_state ; ProcessResult process_result = minidump_processor . Process ( & dump , & process_state ) ; if ( process_result != google_breakpad :: PROCESS_OK ) { string errMsg = " " + getFriendlyFailureReason ( process_result ) ; result . pstrErr = duplicate ( errMsg ) ; return result ; } result . event = getEvent ( process_state ) ; result . event . metaData = getMinidumpMetadata ( dump , process_state ) ; } catch ( const std :: exception & ex ) { string errMsg = " " + string ( ex . what ( ) ) ; result . pstrErr = duplicate ( errMsg ) ; } catch ( ... ) { result . pstrErr = duplicate ( " " ) ; } return result ; }
Gets an Event payload from the minidump.
Gets an Event payload from the minidump .
// Increase the maximum number of threads and regions. // Process the minidump. // Map the process state to an Event struct // Populate metadata