| OLD | NEW |
| 1 // Copyright (c) 2012, Google Inc. | 1 // Copyright (c) 2012, Google Inc. |
| 2 // All rights reserved. | 2 // All rights reserved. |
| 3 // | 3 // |
| 4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
| 5 // modification, are permitted provided that the following conditions are | 5 // modification, are permitted provided that the following conditions are |
| 6 // met: | 6 // met: |
| 7 // | 7 // |
| 8 // * Redistributions of source code must retain the above copyright | 8 // * Redistributions of source code must retain the above copyright |
| 9 // notice, this list of conditions and the following disclaimer. | 9 // notice, this list of conditions and the following disclaimer. |
| 10 // * Redistributions in binary form must reproduce the above | 10 // * Redistributions in binary form must reproduce the above |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 | 40 |
| 41 namespace google_breakpad { | 41 namespace google_breakpad { |
| 42 | 42 |
| 43 class LinuxCoreDumper : public LinuxDumper { | 43 class LinuxCoreDumper : public LinuxDumper { |
| 44 public: | 44 public: |
| 45 // Constructs a dumper for extracting information of a given process | 45 // Constructs a dumper for extracting information of a given process |
| 46 // with a process ID of |pid| via its core dump file at |core_path| and | 46 // with a process ID of |pid| via its core dump file at |core_path| and |
| 47 // its proc files at |procfs_path|. If |procfs_path| is a copy of | 47 // its proc files at |procfs_path|. If |procfs_path| is a copy of |
| 48 // /proc/<pid>, it should contain the following files: | 48 // /proc/<pid>, it should contain the following files: |
| 49 // auxv, cmdline, environ, exe, maps, status | 49 // auxv, cmdline, environ, exe, maps, status |
| 50 LinuxCoreDumper(pid_t pid, const char* core_path, const char* procfs_path); | 50 // See LinuxDumper for the purpose of |root_prefix|. |
| 51 LinuxCoreDumper(pid_t pid, const char* core_path, const char* procfs_path, |
| 52 const char* root_prefix = ""); |
| 51 | 53 |
| 52 // Implements LinuxDumper::BuildProcPath(). | 54 // Implements LinuxDumper::BuildProcPath(). |
| 53 // Builds a proc path for a certain pid for a node (/proc/<pid>/<node>). | 55 // Builds a proc path for a certain pid for a node (/proc/<pid>/<node>). |
| 54 // |path| is a character array of at least NAME_MAX bytes to return the | 56 // |path| is a character array of at least NAME_MAX bytes to return the |
| 55 // result.|node| is the final node without any slashes. Return true on | 57 // result.|node| is the final node without any slashes. Return true on |
| 56 // success. | 58 // success. |
| 57 // | 59 // |
| 58 // As this dumper performs a post-mortem dump and makes use of a copy | 60 // As this dumper performs a post-mortem dump and makes use of a copy |
| 59 // of the proc files of the crashed process, this derived method does | 61 // of the proc files of the crashed process, this derived method does |
| 60 // not actually make use of |pid| and always returns a subpath of | 62 // not actually make use of |pid| and always returns a subpath of |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 // Content of the core dump file. | 116 // Content of the core dump file. |
| 115 ElfCoreDump core_; | 117 ElfCoreDump core_; |
| 116 | 118 |
| 117 // Thread info found in the core dump file. | 119 // Thread info found in the core dump file. |
| 118 wasteful_vector<ThreadInfo> thread_infos_; | 120 wasteful_vector<ThreadInfo> thread_infos_; |
| 119 }; | 121 }; |
| 120 | 122 |
| 121 } // namespace google_breakpad | 123 } // namespace google_breakpad |
| 122 | 124 |
| 123 #endif // CLIENT_LINUX_HANDLER_LINUX_CORE_DUMPER_H_ | 125 #endif // CLIENT_LINUX_HANDLER_LINUX_CORE_DUMPER_H_ |
| OLD | NEW |