Files
clang-p2996/lldb/source/Plugins/Process/minidump/NtStructures.h
Dimitar Vlahovski 7b18dd4f77 Minidump plugin: Adding ProcessMinidump, ThreadMinidump and register the plugin in SystemInitializerFull
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 arches that this supports are x86_32 and x86_64.
This is because I have only written register contexts for those.
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, modocache, lldb-commits, amccarth

Differential Revision: https://reviews.llvm.org/D25905

llvm-svn: 285587
2016-10-31 15:35:18 +00:00

38 lines
1.3 KiB
C++

//===-- NtStructures.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_Plugins_Process_Minidump_NtStructures_h_
#define liblldb_Plugins_Process_Minidump_NtStructures_h_
#include "llvm/Support/Endian.h"
namespace lldb_private {
namespace minidump {
// This describes the layout of a TEB (Thread Environment Block) for a 64-bit
// process. It's adapted from the 32-bit TEB in winternl.h. Currently, we care
// only about the position of the tls_slots.
struct TEB64 {
llvm::support::ulittle64_t reserved1[12];
llvm::support::ulittle64_t process_environment_block;
llvm::support::ulittle64_t reserved2[399];
uint8_t reserved3[1952];
llvm::support::ulittle64_t tls_slots[64];
uint8_t reserved4[8];
llvm::support::ulittle64_t reserved5[26];
llvm::support::ulittle64_t reserved_for_ole; // Windows 2000 only
llvm::support::ulittle64_t reserved6[4];
llvm::support::ulittle64_t tls_expansion_slots;
};
#endif // liblldb_Plugins_Process_Minidump_NtStructures_h_
} // namespace minidump
} // namespace lldb_private