-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[lldb][Minidump Parser] Implement a range data vector for minidump memory ranges #136040
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,7 @@ | |
#include "lldb/Utility/Status.h" | ||
#include "lldb/Utility/UUID.h" | ||
|
||
#include "lldb/Utility/RangeMap.h" | ||
#include "llvm/ADT/ArrayRef.h" | ||
#include "llvm/ADT/DenseMap.h" | ||
#include "llvm/ADT/StringRef.h" | ||
|
@@ -35,6 +36,9 @@ namespace minidump { | |
|
||
// Describes a range of memory captured in the Minidump | ||
struct Range { | ||
// Default constructor required for range data vector | ||
// but unusued. | ||
Range() = default; | ||
lldb::addr_t start; // virtual address of the beginning of the range | ||
// range_ref - absolute pointer to the first byte of the range and size | ||
llvm::ArrayRef<uint8_t> range_ref; | ||
|
@@ -45,9 +49,18 @@ struct Range { | |
friend bool operator==(const Range &lhs, const Range &rhs) { | ||
return lhs.start == rhs.start && lhs.range_ref == rhs.range_ref; | ||
} | ||
|
||
friend bool operator<(const Range &lhs, const Range &rhs) { | ||
if (lhs.start == rhs.start) | ||
return lhs.range_ref.size() < rhs.range_ref.size(); | ||
return lhs.start < rhs.start; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you want to do something like:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @clayborg is this possible? A minidump with two ranges at the same address should be impossible correct? |
||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You don't need this class anymore. Just store a |
||
}; | ||
|
||
using FallibleMemory64Iterator = llvm::object::MinidumpFile::FallibleMemory64Iterator; | ||
using MemoryRangeVector = | ||
lldb_private::RangeDataVector<lldb::addr_t, lldb::addr_t, minidump::Range>; | ||
using FallibleMemory64Iterator = | ||
llvm::object::MinidumpFile::FallibleMemory64Iterator; | ||
using ExceptionStreamsIterator = | ||
llvm::object::MinidumpFile::ExceptionStreamsIterator; | ||
|
||
|
@@ -97,7 +110,8 @@ class MinidumpParser { | |
/// complete (includes all regions mapped into the process memory). | ||
std::pair<MemoryRegionInfos, bool> BuildMemoryRegions(); | ||
|
||
llvm::iterator_range<FallibleMemory64Iterator> GetMemory64Iterator(llvm::Error &err); | ||
llvm::iterator_range<FallibleMemory64Iterator> | ||
GetMemory64Iterator(llvm::Error &err); | ||
|
||
static llvm::StringRef GetStreamTypeAsString(StreamType stream_type); | ||
|
||
|
@@ -109,10 +123,11 @@ class MinidumpParser { | |
private: | ||
MinidumpParser(lldb::DataBufferSP data_sp, | ||
std::unique_ptr<llvm::object::MinidumpFile> file); | ||
|
||
void PopulateMemoryRanges(); | ||
lldb::DataBufferSP m_data_sp; | ||
std::unique_ptr<llvm::object::MinidumpFile> m_file; | ||
ArchSpec m_arch; | ||
MemoryRangeVector m_memory_ranges; | ||
}; | ||
|
||
} // end namespace minidump | ||
|
Uh oh!
There was an error while loading. Please reload this page.