crash-reporter: Add diagnostics to help diagnose failures in the wild

We add logging messages that are generated during invocation of core2md, but we also enable sending arbitrary system info based on the configuration file.  In this case we add the list of running processes, meminfo, and dmesg.

Change-Id: Ifdf29b89dd60d56349fa39095d2aa07f6b5e2de2

BUG=chromium-os:6299,chromium-os:9345
TEST=UserCrash, unit tests

Review URL: http://codereview.chromium.org/6297004
diff --git a/crash_reporter/user_collector.h b/crash_reporter/user_collector.h
index 90bc578..851d587 100644
--- a/crash_reporter/user_collector.h
+++ b/crash_reporter/user_collector.h
@@ -40,7 +40,8 @@
   bool Disable() { return SetUpInternal(false); }
 
   // Handle a specific user crash.  Returns true on success.
-  bool HandleCrash(int signal, int pid, const char *force_exec);
+  bool HandleCrash(const std::string &crash_attributes,
+                   const char *force_exec);
 
   // Set (override the default) core file pattern.
   void set_core_pattern_file(const std::string &pattern) {
@@ -61,6 +62,7 @@
   FRIEND_TEST(UserCollectorTest, GetProcessPath);
   FRIEND_TEST(UserCollectorTest, GetSymlinkTarget);
   FRIEND_TEST(UserCollectorTest, GetUserInfoFromName);
+  FRIEND_TEST(UserCollectorTest, ParseCrashAttributes);
 
   // Enumeration to pass to GetIdFromStatus.  Must match the order
   // that the kernel lists IDs in the status file.
@@ -109,6 +111,9 @@
                              const FilePath &minidump_path);
   bool ConvertAndEnqueueCrash(int pid, const std::string &exec_name,
                               bool *out_of_capacity);
+  bool ParseCrashAttributes(const std::string &crash_attributes,
+                            pid_t *pid, int *signal,
+                            std::string *kernel_supplied_name);
 
   bool generate_diagnostics_;
   std::string core_pattern_file_;
@@ -116,9 +121,6 @@
   std::string our_path_;
   bool initialized_;
 
-  // String containing the current log of crash handling errors.
-  std::string error_log_;
-
   static const char *kUserId;
   static const char *kGroupId;
 };