MCPcopy Create free account
hub / github.com/bloomberg/pystack / CorefileRemoteMemoryManager

Method CorefileRemoteMemoryManager

src/pystack/_pystack/mem.cpp:331–359  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

329}
330
331CorefileRemoteMemoryManager::CorefileRemoteMemoryManager(
332 std::shared_ptr<CoreFileAnalyzer> analyzer,
333 std::vector<VirtualMap>& vmaps)
334: d_analyzer(std::move(analyzer))
335, d_vmaps(vmaps)
336{
337 CoreFileExtractor extractor{d_analyzer};
338 d_shared_libs = extractor.ModuleInformation();
339
340 const char* filename = d_analyzer->d_filename.c_str();
341 int fd = open(filename, O_RDONLY);
342
343 if (fd == -1) {
344 LOG(ERROR) << "Failed to open a file " << filename;
345 throw RemoteMemCopyError();
346 }
347
348 StatusCode ret = readCorefile(fd, filename);
349 int close_ret = close(fd);
350
351 if (close_ret == -1) {
352 LOG(ERROR) << "Failed to close a file " << filename;
353 throw RemoteMemCopyError();
354 }
355
356 if (ret == StatusCode::ERROR) {
357 throw RemoteMemCopyError();
358 }
359}
360
361CorefileRemoteMemoryManager::StatusCode
362CorefileRemoteMemoryManager::readCorefile(int fd, const char* filename) noexcept

Callers

nothing calls this directly

Calls 3

LOGClass · 0.85
RemoteMemCopyErrorClass · 0.85
ModuleInformationMethod · 0.80

Tested by

no test coverage detected