diff options
author | Dimitar Vlahovski <dvlahovski@google.com> | 2016-10-04 21:02:13 +0000 |
---|---|---|
committer | Dimitar Vlahovski <dvlahovski@google.com> | 2016-10-04 21:02:13 +0000 |
commit | 8cabfb764d6b0390038f2d0af6f29781b4b2294b (patch) | |
tree | d5f809b2ae4a5dce6cb4e632e95b8b673547f733 /lldb/source/Plugins/Process/minidump/MinidumpParser.h | |
parent | 625fba88406e3ff47ceb63b7d36d5db756ec44cf (diff) | |
download | bcm5719-llvm-8cabfb764d6b0390038f2d0af6f29781b4b2294b.tar.gz bcm5719-llvm-8cabfb764d6b0390038f2d0af6f29781b4b2294b.zip |
Adding a new Minidump post-mortem debugging plugin
Summary:
This plugin resembles the already existing Windows-only Minidump plugin.
The WinMinidumpPlugin uses the Windows API for parsing Minidumps
while this plugin is cross-platform because it includes a Minidump
parser (which is already commited)
It is able to produce a backtrace, to read the general puprose regiters,
inspect local variables, show image list, do memory reads, etc.
For now the only arch that this supports is x86 64 bit
This is because I have only written a register context for that arch.
Others will come in next CLs.
I copied the WinMinidump tests and adapted them a little bit for them to
work with the new plugin (and they pass)
I will add more tests, aiming for better code coverage.
There is still functionality to be added, see TODOs in code.
Reviewers: labath, zturner
Subscribers: beanz, mgorny, amccarth, lldb-commits, modocache
Differential Revision: https://reviews.llvm.org/D25196
llvm-svn: 283259
Diffstat (limited to 'lldb/source/Plugins/Process/minidump/MinidumpParser.h')
-rw-r--r-- | lldb/source/Plugins/Process/minidump/MinidumpParser.h | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/lldb/source/Plugins/Process/minidump/MinidumpParser.h b/lldb/source/Plugins/Process/minidump/MinidumpParser.h index 76a8ece00b2..686d0f39f6e 100644 --- a/lldb/source/Plugins/Process/minidump/MinidumpParser.h +++ b/lldb/source/Plugins/Process/minidump/MinidumpParser.h @@ -1,12 +1,11 @@ -//===-- MinidumpParser.h -----------------------------------------*- C++ -//-*-===// +//===-- MinidumpParser.h ---------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // -//===----------------------------------------------------------------------===// +//===--------------------------------------------------------------------===// #ifndef liblldb_MinidumpParser_h_ #define liblldb_MinidumpParser_h_ @@ -25,15 +24,22 @@ #include "llvm/ADT/StringRef.h" // C includes - // C++ includes -#include <cstring> -#include <unordered_map> namespace lldb_private { namespace minidump { +// Describes a range of memory captured in the Minidump +struct Range { + 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; + + Range(lldb::addr_t start, llvm::ArrayRef<uint8_t> range_ref) + : start(start), range_ref(range_ref) {} +}; + class MinidumpParser { public: static llvm::Optional<MinidumpParser> @@ -47,6 +53,8 @@ public: llvm::ArrayRef<MinidumpThread> GetThreads(); + llvm::ArrayRef<uint8_t> GetThreadContext(const MinidumpThread &td); + const MinidumpSystemInfo *GetSystemInfo(); ArchSpec GetArchitecture(); @@ -61,6 +69,8 @@ public: const MinidumpExceptionStream *GetExceptionStream(); + llvm::Optional<Range> FindMemoryRange(lldb::addr_t addr); + private: lldb::DataBufferSP m_data_sp; const MinidumpHeader *m_header; |