OLD | NEW |
1 // Copyright (c) 2010, Google Inc. | 1 // Copyright (c) 2010, 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 #if defined(__ANDROID__) | 42 #if defined(__ANDROID__) |
43 #include <link.h> | 43 #include <link.h> |
44 #endif | 44 #endif |
45 #include <linux/limits.h> | 45 #include <linux/limits.h> |
46 #include <stdint.h> | 46 #include <stdint.h> |
47 #include <sys/types.h> | 47 #include <sys/types.h> |
48 #include <sys/user.h> | 48 #include <sys/user.h> |
49 | 49 |
50 #include "client/linux/dump_writer_common/mapping_info.h" | 50 #include "client/linux/dump_writer_common/mapping_info.h" |
51 #include "client/linux/dump_writer_common/thread_info.h" | 51 #include "client/linux/dump_writer_common/thread_info.h" |
| 52 #include "common/linux/file_id.h" |
52 #include "common/memory.h" | 53 #include "common/memory.h" |
53 #include "google_breakpad/common/minidump_format.h" | 54 #include "google_breakpad/common/minidump_format.h" |
54 | 55 |
55 namespace google_breakpad { | 56 namespace google_breakpad { |
56 | 57 |
57 // Typedef for our parsing of the auxv variables in /proc/pid/auxv. | 58 // Typedef for our parsing of the auxv variables in /proc/pid/auxv. |
58 #if defined(__i386) || defined(__ARM_EABI__) || \ | 59 #if defined(__i386) || defined(__ARM_EABI__) || \ |
59 (defined(__mips__) && _MIPS_SIM == _ABIO32) | 60 (defined(__mips__) && _MIPS_SIM == _ABIO32) |
60 typedef Elf32_auxv_t elf_aux_entry; | 61 typedef Elf32_auxv_t elf_aux_entry; |
61 #elif defined(__x86_64) || defined(__aarch64__) || \ | 62 #elif defined(__x86_64) || defined(__aarch64__) || \ |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 | 120 |
120 // Builds a proc path for a certain pid for a node (/proc/<pid>/<node>). | 121 // Builds a proc path for a certain pid for a node (/proc/<pid>/<node>). |
121 // |path| is a character array of at least NAME_MAX bytes to return the | 122 // |path| is a character array of at least NAME_MAX bytes to return the |
122 // result.|node| is the final node without any slashes. Returns true on | 123 // result.|node| is the final node without any slashes. Returns true on |
123 // success. | 124 // success. |
124 virtual bool BuildProcPath(char* path, pid_t pid, const char* node) const = 0; | 125 virtual bool BuildProcPath(char* path, pid_t pid, const char* node) const = 0; |
125 | 126 |
126 // Generate a File ID from the .text section of a mapped entry. | 127 // Generate a File ID from the .text section of a mapped entry. |
127 // If not a member, mapping_id is ignored. This method can also manipulate the | 128 // If not a member, mapping_id is ignored. This method can also manipulate the |
128 // |mapping|.name to truncate "(deleted)" from the file name if necessary. | 129 // |mapping|.name to truncate "(deleted)" from the file name if necessary. |
| 130 // |identifier_length| must be set to the length of the |identifier| buffer. |
| 131 // If the buffer is not large enough to contain the identifer, return false |
| 132 // and set |identifier_length| to the required length. |
129 bool ElfFileIdentifierForMapping(const MappingInfo& mapping, | 133 bool ElfFileIdentifierForMapping(const MappingInfo& mapping, |
130 bool member, | 134 bool member, |
131 unsigned int mapping_id, | 135 unsigned int mapping_id, |
132 uint8_t identifier[sizeof(MDGUID)]); | 136 wasteful_vector<uint8_t>& identifier); |
133 | 137 |
134 uintptr_t crash_address() const { return crash_address_; } | 138 uintptr_t crash_address() const { return crash_address_; } |
135 void set_crash_address(uintptr_t crash_address) { | 139 void set_crash_address(uintptr_t crash_address) { |
136 crash_address_ = crash_address; | 140 crash_address_ = crash_address; |
137 } | 141 } |
138 | 142 |
139 int crash_signal() const { return crash_signal_; } | 143 int crash_signal() const { return crash_signal_; } |
140 void set_crash_signal(int crash_signal) { crash_signal_ = crash_signal; } | 144 void set_crash_signal(int crash_signal) { crash_signal_ = crash_signal; } |
141 | 145 |
142 pid_t crash_thread() const { return crash_thread_; } | 146 pid_t crash_thread() const { return crash_thread_; } |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 // (or Chromium crazy linker) used. This value matches the addresses produced | 259 // (or Chromium crazy linker) used. This value matches the addresses produced |
256 // when the non-relocation-packed library is used for breakpad symbol | 260 // when the non-relocation-packed library is used for breakpad symbol |
257 // generation. | 261 // generation. |
258 void LatePostprocessMappings(); | 262 void LatePostprocessMappings(); |
259 #endif // __ANDROID__ | 263 #endif // __ANDROID__ |
260 }; | 264 }; |
261 | 265 |
262 } // namespace google_breakpad | 266 } // namespace google_breakpad |
263 | 267 |
264 #endif // CLIENT_LINUX_HANDLER_LINUX_DUMPER_H_ | 268 #endif // CLIENT_LINUX_HANDLER_LINUX_DUMPER_H_ |
OLD | NEW |