2015-03-31 21:03:22 +00:00
|
|
|
//===-- SystemInitializerFull.cpp -------------------------------*- C++ -*-===//
|
|
|
|
//
|
2019-01-19 08:50:56 +00:00
|
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
2015-03-31 21:03:22 +00:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2018-05-25 20:28:16 +00:00
|
|
|
#include "SystemInitializerFull.h"
|
2015-03-31 21:03:22 +00:00
|
|
|
|
2015-07-30 20:28:07 +00:00
|
|
|
#include "lldb/API/SBCommandInterpreter.h"
|
|
|
|
|
|
|
|
#if !defined(LLDB_DISABLE_PYTHON)
|
|
|
|
#include "Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h"
|
|
|
|
#endif
|
|
|
|
|
2015-03-31 21:03:22 +00:00
|
|
|
#include "lldb/Core/Debugger.h"
|
|
|
|
#include "lldb/Host/Host.h"
|
|
|
|
#include "lldb/Initialization/SystemInitializerCommon.h"
|
2015-07-30 20:28:07 +00:00
|
|
|
#include "lldb/Interpreter/CommandInterpreter.h"
|
TypeSystem is now a plugin interface and removed any "ClangASTContext &Class::GetClangASTContext()" functions.
This cleans up type systems to be more pluggable. Prior to this we had issues:
- Module, SymbolFile, and many others has "ClangASTContext &GetClangASTContext()" functions. All have been switched over to use "TypeSystem *GetTypeSystemForLanguage()"
- Cleaned up any places that were using the GetClangASTContext() functions to use TypeSystem
- Cleaned up Module so that it no longer has dedicated type system member variables:
lldb::ClangASTContextUP m_ast; ///< The Clang AST context for this module.
lldb::GoASTContextUP m_go_ast; ///< The Go AST context for this module.
Now we have a type system map:
typedef std::map<lldb::LanguageType, lldb::TypeSystemSP> TypeSystemMap;
TypeSystemMap m_type_system_map; ///< A map of any type systems associated with this module
- Many places in code were using ClangASTContext static functions to place with CompilerType objects and add modifiers (const, volatile, restrict) and to make typedefs, L and R value references and more. These have been made into CompilerType functions that are abstract:
class CompilerType
{
...
//----------------------------------------------------------------------
// Return a new CompilerType that is a L value reference to this type if
// this type is valid and the type system supports L value references,
// else return an invalid type.
//----------------------------------------------------------------------
CompilerType
GetLValueReferenceType () const;
//----------------------------------------------------------------------
// Return a new CompilerType that is a R value reference to this type if
// this type is valid and the type system supports R value references,
// else return an invalid type.
//----------------------------------------------------------------------
CompilerType
GetRValueReferenceType () const;
//----------------------------------------------------------------------
// Return a new CompilerType adds a const modifier to this type if
// this type is valid and the type system supports const modifiers,
// else return an invalid type.
//----------------------------------------------------------------------
CompilerType
AddConstModifier () const;
//----------------------------------------------------------------------
// Return a new CompilerType adds a volatile modifier to this type if
// this type is valid and the type system supports volatile modifiers,
// else return an invalid type.
//----------------------------------------------------------------------
CompilerType
AddVolatileModifier () const;
//----------------------------------------------------------------------
// Return a new CompilerType adds a restrict modifier to this type if
// this type is valid and the type system supports restrict modifiers,
// else return an invalid type.
//----------------------------------------------------------------------
CompilerType
AddRestrictModifier () const;
//----------------------------------------------------------------------
// Create a typedef to this type using "name" as the name of the typedef
// this type is valid and the type system supports typedefs, else return
// an invalid type.
//----------------------------------------------------------------------
CompilerType
CreateTypedef (const char *name, const CompilerDeclContext &decl_ctx) const;
};
Other changes include:
- Removed "CompilerType TypeSystem::GetIntTypeFromBitSize(...)" and CompilerType TypeSystem::GetFloatTypeFromBitSize(...) and replaced it with "CompilerType TypeSystem::GetBuiltinTypeForEncodingAndBitSize(lldb::Encoding encoding, size_t bit_size);"
- Fixed code in Type.h to not request the full type for a type for no good reason, just request the forward type and let the type expand as needed
llvm-svn: 247953
2015-09-17 22:23:34 +00:00
|
|
|
#include "lldb/Symbol/ClangASTContext.h"
|
2017-06-29 14:32:17 +00:00
|
|
|
#include "lldb/Utility/Timer.h"
|
2015-03-31 21:03:22 +00:00
|
|
|
|
|
|
|
#include "Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.h"
|
|
|
|
#include "Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.h"
|
Add support for reading line tables from PDB files.
PDB is Microsoft's debug information format, and although we
cannot yet generate it, we still must be able to consume it.
Reason for this is that debug information for system libraries
(e.g. kernel32, C Runtime Library, etc) only have debug info
in PDB format, so in order to be able to support debugging
of system code, we must support it.
Currently this code should compile on every platform, but on
non-Windows platforms the PDB plugin will return 0 capabilities,
meaning that for now PDB is only supported on Windows. This
may change in the future, but the API is designed in such a way
that this will require few (if any) changes on the LLDB side.
In the future we can just flip a switch and everything will
work.
This patch only adds support for line tables. It does not return
information about functions, types, global variables, or anything
else. This functionality will be added in a followup patch.
Differential Revision: http://reviews.llvm.org/D17363
Reviewed by: Greg Clayton
llvm-svn: 262528
2016-03-02 22:05:52 +00:00
|
|
|
#include "Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.h"
|
2015-04-29 10:49:45 +00:00
|
|
|
#include "Plugins/ABI/SysV-arm/ABISysV_arm.h"
|
2015-04-29 11:52:35 +00:00
|
|
|
#include "Plugins/ABI/SysV-arm64/ABISysV_arm64.h"
|
2015-12-10 17:53:07 +00:00
|
|
|
#include "Plugins/ABI/SysV-hexagon/ABISysV_hexagon.h"
|
2015-06-25 17:50:15 +00:00
|
|
|
#include "Plugins/ABI/SysV-i386/ABISysV_i386.h"
|
2015-06-18 07:02:10 +00:00
|
|
|
#include "Plugins/ABI/SysV-mips/ABISysV_mips.h"
|
2015-06-19 04:25:07 +00:00
|
|
|
#include "Plugins/ABI/SysV-mips64/ABISysV_mips64.h"
|
Add support for reading line tables from PDB files.
PDB is Microsoft's debug information format, and although we
cannot yet generate it, we still must be able to consume it.
Reason for this is that debug information for system libraries
(e.g. kernel32, C Runtime Library, etc) only have debug info
in PDB format, so in order to be able to support debugging
of system code, we must support it.
Currently this code should compile on every platform, but on
non-Windows platforms the PDB plugin will return 0 capabilities,
meaning that for now PDB is only supported on Windows. This
may change in the future, but the API is designed in such a way
that this will require few (if any) changes on the LLDB side.
In the future we can just flip a switch and everything will
work.
This patch only adds support for line tables. It does not return
information about functions, types, global variables, or anything
else. This functionality will be added in a followup patch.
Differential Revision: http://reviews.llvm.org/D17363
Reviewed by: Greg Clayton
llvm-svn: 262528
2016-03-02 22:05:52 +00:00
|
|
|
#include "Plugins/ABI/SysV-ppc/ABISysV_ppc.h"
|
|
|
|
#include "Plugins/ABI/SysV-ppc64/ABISysV_ppc64.h"
|
2016-04-14 14:28:34 +00:00
|
|
|
#include "Plugins/ABI/SysV-s390x/ABISysV_s390x.h"
|
Add support for reading line tables from PDB files.
PDB is Microsoft's debug information format, and although we
cannot yet generate it, we still must be able to consume it.
Reason for this is that debug information for system libraries
(e.g. kernel32, C Runtime Library, etc) only have debug info
in PDB format, so in order to be able to support debugging
of system code, we must support it.
Currently this code should compile on every platform, but on
non-Windows platforms the PDB plugin will return 0 capabilities,
meaning that for now PDB is only supported on Windows. This
may change in the future, but the API is designed in such a way
that this will require few (if any) changes on the LLDB side.
In the future we can just flip a switch and everything will
work.
This patch only adds support for line tables. It does not return
information about functions, types, global variables, or anything
else. This functionality will be added in a followup patch.
Differential Revision: http://reviews.llvm.org/D17363
Reviewed by: Greg Clayton
llvm-svn: 262528
2016-03-02 22:05:52 +00:00
|
|
|
#include "Plugins/ABI/SysV-x86_64/ABISysV_x86_64.h"
|
2019-06-24 18:21:05 +00:00
|
|
|
#include "Plugins/ABI/Windows-x86_64/ABIWindows_x86_64.h"
|
2017-10-25 21:05:31 +00:00
|
|
|
#include "Plugins/Architecture/Arm/ArchitectureArm.h"
|
2018-12-13 14:28:25 +00:00
|
|
|
#include "Plugins/Architecture/Mips/ArchitectureMips.h"
|
2018-03-12 21:17:04 +00:00
|
|
|
#include "Plugins/Architecture/PPC64/ArchitecturePPC64.h"
|
2015-03-31 21:03:22 +00:00
|
|
|
#include "Plugins/Disassembler/llvm/DisassemblerLLVMC.h"
|
2016-07-21 08:30:55 +00:00
|
|
|
#include "Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOS.h"
|
2016-03-29 15:00:26 +00:00
|
|
|
#include "Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.h"
|
|
|
|
#include "Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.h"
|
2016-06-29 13:58:27 +00:00
|
|
|
#include "Plugins/DynamicLoader/Static/DynamicLoaderStatic.h"
|
2016-03-29 15:00:26 +00:00
|
|
|
#include "Plugins/DynamicLoader/Windows-DYLD/DynamicLoaderWindowsDYLD.h"
|
2019-05-06 19:38:24 +00:00
|
|
|
#include "Plugins/Instruction/ARM/EmulateInstructionARM.h"
|
2015-03-31 21:03:22 +00:00
|
|
|
#include "Plugins/Instruction/ARM64/EmulateInstructionARM64.h"
|
2019-05-06 19:38:24 +00:00
|
|
|
#include "Plugins/Instruction/MIPS/EmulateInstructionMIPS.h"
|
|
|
|
#include "Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.h"
|
2018-02-27 18:42:46 +00:00
|
|
|
#include "Plugins/Instruction/PPC64/EmulateInstructionPPC64.h"
|
2017-06-26 08:13:22 +00:00
|
|
|
#include "Plugins/InstrumentationRuntime/ASan/ASanRuntime.h"
|
2017-10-25 21:05:31 +00:00
|
|
|
#include "Plugins/InstrumentationRuntime/MainThreadChecker/MainThreadCheckerRuntime.h"
|
2017-06-26 08:13:22 +00:00
|
|
|
#include "Plugins/InstrumentationRuntime/TSan/TSanRuntime.h"
|
|
|
|
#include "Plugins/InstrumentationRuntime/UBSan/UBSanRuntime.h"
|
2015-03-31 21:03:22 +00:00
|
|
|
#include "Plugins/JITLoader/GDB/JITLoaderGDB.h"
|
2015-09-01 18:22:39 +00:00
|
|
|
#include "Plugins/Language/CPlusPlus/CPlusPlusLanguage.h"
|
|
|
|
#include "Plugins/Language/ObjC/ObjCLanguage.h"
|
|
|
|
#include "Plugins/Language/ObjCPlusPlus/ObjCPlusPlusLanguage.h"
|
2015-03-31 21:03:22 +00:00
|
|
|
#include "Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.h"
|
Add support for reading line tables from PDB files.
PDB is Microsoft's debug information format, and although we
cannot yet generate it, we still must be able to consume it.
Reason for this is that debug information for system libraries
(e.g. kernel32, C Runtime Library, etc) only have debug info
in PDB format, so in order to be able to support debugging
of system code, we must support it.
Currently this code should compile on every platform, but on
non-Windows platforms the PDB plugin will return 0 capabilities,
meaning that for now PDB is only supported on Windows. This
may change in the future, but the API is designed in such a way
that this will require few (if any) changes on the LLDB side.
In the future we can just flip a switch and everything will
work.
This patch only adds support for line tables. It does not return
information about functions, types, global variables, or anything
else. This functionality will be added in a followup patch.
Differential Revision: http://reviews.llvm.org/D17363
Reviewed by: Greg Clayton
llvm-svn: 262528
2016-03-02 22:05:52 +00:00
|
|
|
#include "Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.h"
|
|
|
|
#include "Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.h"
|
2015-04-09 16:49:25 +00:00
|
|
|
#include "Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.h"
|
2015-03-31 21:03:22 +00:00
|
|
|
#include "Plugins/MemoryHistory/asan/MemoryHistoryASan.h"
|
2019-05-02 18:11:44 +00:00
|
|
|
#include "Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.h"
|
|
|
|
#include "Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.h"
|
Re-commit "Introduce ObjectFileBreakpad"
This re-commits r348592, which was reverted due to a failing test on
macos.
The issue was that I was passing a null pointer for the
"CreateMemoryInstance" callback when registering ObjectFileBreakpad,
which caused crashes when attemping to load modules from memory. The
correct thing to do is to pass a callback which always returns a null
pointer (as breakpad files are never loaded in inferior memory).
It turns out that there is only one test which exercises this code path,
and it's mac-only, so I've create a new test which should run everywhere
(except windows, as one cannot delete an executable which is being run).
Unfortunately, this test still fails on linux for other reasons, but at
least it gives us something to aim for.
The original commit message was:
This patch adds the scaffolding necessary for lldb to recognise symbol
files generated by breakpad. These (textual) files contain just enough
information to be able to produce a backtrace from a crash
dump. This information includes:
- UUID, architecture and name of the module
- line tables
- list of symbols
- unwind information
A minimal breakpad file could look like this:
MODULE Linux x86_64 0000000024B5D199F0F766FFFFFF5DC30 a.out
INFO CODE_ID 00000000B52499D1F0F766FFFFFF5DC3
FILE 0 /tmp/a.c
FUNC 1010 10 0 _start
1010 4 4 0
1014 5 5 0
1019 5 6 0
101e 2 7 0
PUBLIC 1010 0 _start
STACK CFI INIT 1010 10 .cfa: $rsp 8 + .ra: .cfa -8 + ^
STACK CFI 1011 $rbp: .cfa -16 + ^ .cfa: $rsp 16 +
STACK CFI 1014 .cfa: $rbp 16 +
Even though this data would normally be considered "symbol" information,
in the current lldb infrastructure it is assumed every SymbolFile object
is backed by an ObjectFile instance. So, in order to better interoperate
with the rest of the code (particularly symbol vendors).
In this patch I just parse the breakpad header, which is enough to
populate the UUID and architecture fields of the ObjectFile interface.
The rough plan for followup patches is to expose the individual parts of
the breakpad file as ObjectFile "sections", which can then be used by
other parts of the codebase (SymbolFileBreakpad ?) to vend the necessary
information.
Reviewers: clayborg, zturner, lemo, amccarth
Subscribers: mgorny, fedor.sergeev, markmentovai, lldb-commits
Differential Revision: https://reviews.llvm.org/D55214
llvm-svn: 348773
2018-12-10 17:16:38 +00:00
|
|
|
#include "Plugins/ObjectFile/Breakpad/ObjectFileBreakpad.h"
|
2018-05-24 12:44:18 +00:00
|
|
|
#include "Plugins/ObjectFile/ELF/ObjectFileELF.h"
|
|
|
|
#include "Plugins/ObjectFile/Mach-O/ObjectFileMachO.h"
|
|
|
|
#include "Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h"
|
2016-06-29 13:58:27 +00:00
|
|
|
#include "Plugins/OperatingSystem/Python/OperatingSystemPython.h"
|
|
|
|
#include "Plugins/Platform/Android/PlatformAndroid.h"
|
|
|
|
#include "Plugins/Platform/FreeBSD/PlatformFreeBSD.h"
|
|
|
|
#include "Plugins/Platform/Linux/PlatformLinux.h"
|
|
|
|
#include "Plugins/Platform/MacOSX/PlatformMacOSX.h"
|
|
|
|
#include "Plugins/Platform/MacOSX/PlatformRemoteiOS.h"
|
|
|
|
#include "Plugins/Platform/NetBSD/PlatformNetBSD.h"
|
[LLDB] OpenBSD support
Summary:
Add basic OpenBSD support. This is enough to be able to analyze core dumps for OpenBSD/amd64, OpenBSD/arm, OpenBSD/arm64 and OpenBSD/i386.
Note that part of the changes to source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp fix a bug that probably affects other platforms as well. The GetProgramHeaderByIndex() interface use 1-based indices, but in some case when looping over the headers the, the loop starts at 0 and misses the last header. This caused problems on OpenBSD since OpenBSD core dumps have the PT_NOTE segment as the last program header.
Reviewers: joerg, labath, krytarowski
Reviewed By: krytarowski
Subscribers: aemerson, emaste, rengolin, srhines, krytarowski, mgorny, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D31131
llvm-svn: 298810
2017-03-26 15:34:57 +00:00
|
|
|
#include "Plugins/Platform/OpenBSD/PlatformOpenBSD.h"
|
2016-06-29 13:58:27 +00:00
|
|
|
#include "Plugins/Platform/Windows/PlatformWindows.h"
|
2015-03-31 21:03:22 +00:00
|
|
|
#include "Plugins/Platform/gdb-server/PlatformRemoteGDBServer.h"
|
|
|
|
#include "Plugins/Process/elf-core/ProcessElfCore.h"
|
|
|
|
#include "Plugins/Process/gdb-remote/ProcessGDBRemote.h"
|
2018-05-22 16:33:43 +00:00
|
|
|
#include "Plugins/Process/mach-core/ProcessMachCore.h"
|
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
|
|
|
#include "Plugins/Process/minidump/ProcessMinidump.h"
|
2015-07-30 20:28:07 +00:00
|
|
|
#include "Plugins/ScriptInterpreter/None/ScriptInterpreterNone.h"
|
Introduce SymbolFileBreakpad and use it to fill symtab
Summary:
This commit adds the glue code necessary to integrate the
SymbolFileBreakpad into the plugin system. Most of the methods are
stubbed out. The only method implemented method is AddSymbols, which
parses the PUBLIC "section" of the breakpad "object file", and fills out
the Module's symtab.
To enable testing this, I've made two additional changes:
- dump Symtab from the SymbolVendor class. The symtab was already being
dumped as a part of the object file dump, but that happened before
symbol vendor kicked in, so it did not reflect any symbols added
there.
- add ability to explicitly specify the external symbol file in
lldb-test (so that the object file could be linked with the breakpad
symbol file). To make things simpler, I've changed lldb-test from
consuming multiple inputs (and dumping their symbols) to having it
just process a single file per invocation. This was not a problem
since everyone was using it that way already.
Reviewers: clayborg, zturner, lemo, markmentovai, amccarth
Subscribers: mgorny, lldb-commits
Differential Revision: https://reviews.llvm.org/D56173
llvm-svn: 350924
2019-01-11 11:17:51 +00:00
|
|
|
#include "Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.h"
|
2015-03-31 21:03:22 +00:00
|
|
|
#include "Plugins/SymbolFile/DWARF/SymbolFileDWARF.h"
|
|
|
|
#include "Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h"
|
Add support for reading line tables from PDB files.
PDB is Microsoft's debug information format, and although we
cannot yet generate it, we still must be able to consume it.
Reason for this is that debug information for system libraries
(e.g. kernel32, C Runtime Library, etc) only have debug info
in PDB format, so in order to be able to support debugging
of system code, we must support it.
Currently this code should compile on every platform, but on
non-Windows platforms the PDB plugin will return 0 capabilities,
meaning that for now PDB is only supported on Windows. This
may change in the future, but the API is designed in such a way
that this will require few (if any) changes on the LLDB side.
In the future we can just flip a switch and everything will
work.
This patch only adds support for line tables. It does not return
information about functions, types, global variables, or anything
else. This functionality will be added in a followup patch.
Differential Revision: http://reviews.llvm.org/D17363
Reviewed by: Greg Clayton
llvm-svn: 262528
2016-03-02 22:05:52 +00:00
|
|
|
#include "Plugins/SymbolFile/PDB/SymbolFilePDB.h"
|
2015-03-31 21:03:22 +00:00
|
|
|
#include "Plugins/SymbolFile/Symtab/SymbolFileSymtab.h"
|
|
|
|
#include "Plugins/SymbolVendor/ELF/SymbolVendorELF.h"
|
|
|
|
#include "Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.h"
|
|
|
|
#include "Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.h"
|
Add support for reading line tables from PDB files.
PDB is Microsoft's debug information format, and although we
cannot yet generate it, we still must be able to consume it.
Reason for this is that debug information for system libraries
(e.g. kernel32, C Runtime Library, etc) only have debug info
in PDB format, so in order to be able to support debugging
of system code, we must support it.
Currently this code should compile on every platform, but on
non-Windows platforms the PDB plugin will return 0 capabilities,
meaning that for now PDB is only supported on Windows. This
may change in the future, but the API is designed in such a way
that this will require few (if any) changes on the LLDB side.
In the future we can just flip a switch and everything will
work.
This patch only adds support for line tables. It does not return
information about functions, types, global variables, or anything
else. This functionality will be added in a followup patch.
Differential Revision: http://reviews.llvm.org/D17363
Reviewed by: Greg Clayton
llvm-svn: 262528
2016-03-02 22:05:52 +00:00
|
|
|
#include "Plugins/UnwindAssembly/x86/UnwindAssembly-x86.h"
|
2015-03-31 21:03:22 +00:00
|
|
|
|
|
|
|
#if defined(__APPLE__)
|
2016-06-29 13:58:27 +00:00
|
|
|
#include "Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.h"
|
2015-11-06 00:22:53 +00:00
|
|
|
#include "Plugins/Platform/MacOSX/PlatformAppleTVSimulator.h"
|
|
|
|
#include "Plugins/Platform/MacOSX/PlatformAppleWatchSimulator.h"
|
2016-06-29 13:58:27 +00:00
|
|
|
#include "Plugins/Platform/MacOSX/PlatformDarwinKernel.h"
|
2019-04-24 21:23:08 +00:00
|
|
|
#include "Plugins/Platform/MacOSX/PlatformRemoteAppleBridge.h"
|
2015-11-06 00:22:53 +00:00
|
|
|
#include "Plugins/Platform/MacOSX/PlatformRemoteAppleTV.h"
|
|
|
|
#include "Plugins/Platform/MacOSX/PlatformRemoteAppleWatch.h"
|
2016-06-29 13:58:27 +00:00
|
|
|
#include "Plugins/Platform/MacOSX/PlatformiOSSimulator.h"
|
|
|
|
#include "Plugins/Process/MacOSX-Kernel/ProcessKDP.h"
|
|
|
|
#include "Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.h"
|
2015-03-31 21:03:22 +00:00
|
|
|
#endif
|
2016-08-19 04:21:48 +00:00
|
|
|
#include "Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.h"
|
2015-03-31 21:03:22 +00:00
|
|
|
|
|
|
|
#if defined(__FreeBSD__)
|
|
|
|
#include "Plugins/Process/FreeBSD/ProcessFreeBSD.h"
|
|
|
|
#endif
|
|
|
|
|
2016-12-15 15:00:41 +00:00
|
|
|
#if defined(_WIN32)
|
2016-11-23 16:26:37 +00:00
|
|
|
#include "Plugins/Process/Windows/Common/ProcessWindows.h"
|
2015-03-31 21:03:22 +00:00
|
|
|
#include "lldb/Host/windows/windows.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "llvm/Support/TargetSelect.h"
|
|
|
|
|
2019-05-03 23:19:27 +00:00
|
|
|
#pragma clang diagnostic push
|
|
|
|
#pragma clang diagnostic ignored "-Wglobal-constructors"
|
|
|
|
#include "llvm/ExecutionEngine/MCJIT.h"
|
|
|
|
#pragma clang diagnostic pop
|
|
|
|
|
2015-03-31 21:03:22 +00:00
|
|
|
#include <string>
|
|
|
|
|
|
|
|
using namespace lldb_private;
|
|
|
|
|
|
|
|
SystemInitializerFull::SystemInitializerFull() {}
|
|
|
|
|
|
|
|
SystemInitializerFull::~SystemInitializerFull() {}
|
|
|
|
|
2019-02-21 22:26:16 +00:00
|
|
|
llvm::Error SystemInitializerFull::Initialize() {
|
|
|
|
if (auto e = SystemInitializerCommon::Initialize())
|
2018-12-03 17:28:29 +00:00
|
|
|
return e;
|
2018-05-24 12:44:18 +00:00
|
|
|
|
Re-commit "Introduce ObjectFileBreakpad"
This re-commits r348592, which was reverted due to a failing test on
macos.
The issue was that I was passing a null pointer for the
"CreateMemoryInstance" callback when registering ObjectFileBreakpad,
which caused crashes when attemping to load modules from memory. The
correct thing to do is to pass a callback which always returns a null
pointer (as breakpad files are never loaded in inferior memory).
It turns out that there is only one test which exercises this code path,
and it's mac-only, so I've create a new test which should run everywhere
(except windows, as one cannot delete an executable which is being run).
Unfortunately, this test still fails on linux for other reasons, but at
least it gives us something to aim for.
The original commit message was:
This patch adds the scaffolding necessary for lldb to recognise symbol
files generated by breakpad. These (textual) files contain just enough
information to be able to produce a backtrace from a crash
dump. This information includes:
- UUID, architecture and name of the module
- line tables
- list of symbols
- unwind information
A minimal breakpad file could look like this:
MODULE Linux x86_64 0000000024B5D199F0F766FFFFFF5DC30 a.out
INFO CODE_ID 00000000B52499D1F0F766FFFFFF5DC3
FILE 0 /tmp/a.c
FUNC 1010 10 0 _start
1010 4 4 0
1014 5 5 0
1019 5 6 0
101e 2 7 0
PUBLIC 1010 0 _start
STACK CFI INIT 1010 10 .cfa: $rsp 8 + .ra: .cfa -8 + ^
STACK CFI 1011 $rbp: .cfa -16 + ^ .cfa: $rsp 16 +
STACK CFI 1014 .cfa: $rbp 16 +
Even though this data would normally be considered "symbol" information,
in the current lldb infrastructure it is assumed every SymbolFile object
is backed by an ObjectFile instance. So, in order to better interoperate
with the rest of the code (particularly symbol vendors).
In this patch I just parse the breakpad header, which is enough to
populate the UUID and architecture fields of the ObjectFile interface.
The rough plan for followup patches is to expose the individual parts of
the breakpad file as ObjectFile "sections", which can then be used by
other parts of the codebase (SymbolFileBreakpad ?) to vend the necessary
information.
Reviewers: clayborg, zturner, lemo, amccarth
Subscribers: mgorny, fedor.sergeev, markmentovai, lldb-commits
Differential Revision: https://reviews.llvm.org/D55214
llvm-svn: 348773
2018-12-10 17:16:38 +00:00
|
|
|
breakpad::ObjectFileBreakpad::Initialize();
|
2018-05-24 12:44:18 +00:00
|
|
|
ObjectFileELF::Initialize();
|
|
|
|
ObjectFileMachO::Initialize();
|
|
|
|
ObjectFilePECOFF::Initialize();
|
|
|
|
|
2019-05-02 18:11:44 +00:00
|
|
|
ObjectContainerBSDArchive::Initialize();
|
|
|
|
ObjectContainerUniversalMachO::Initialize();
|
|
|
|
|
2015-08-23 09:05:29 +00:00
|
|
|
ScriptInterpreterNone::Initialize();
|
2015-07-30 20:28:07 +00:00
|
|
|
|
2016-03-16 08:48:56 +00:00
|
|
|
#ifndef LLDB_DISABLE_PYTHON
|
|
|
|
OperatingSystemPython::Initialize();
|
|
|
|
#endif
|
|
|
|
|
2015-07-30 20:28:07 +00:00
|
|
|
#if !defined(LLDB_DISABLE_PYTHON)
|
|
|
|
ScriptInterpreterPython::Initialize();
|
|
|
|
#endif
|
2015-03-31 21:03:22 +00:00
|
|
|
|
2016-06-29 13:58:27 +00:00
|
|
|
platform_freebsd::PlatformFreeBSD::Initialize();
|
|
|
|
platform_linux::PlatformLinux::Initialize();
|
|
|
|
platform_netbsd::PlatformNetBSD::Initialize();
|
[LLDB] OpenBSD support
Summary:
Add basic OpenBSD support. This is enough to be able to analyze core dumps for OpenBSD/amd64, OpenBSD/arm, OpenBSD/arm64 and OpenBSD/i386.
Note that part of the changes to source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp fix a bug that probably affects other platforms as well. The GetProgramHeaderByIndex() interface use 1-based indices, but in some case when looping over the headers the, the loop starts at 0 and misses the last header. This caused problems on OpenBSD since OpenBSD core dumps have the PT_NOTE segment as the last program header.
Reviewers: joerg, labath, krytarowski
Reviewed By: krytarowski
Subscribers: aemerson, emaste, rengolin, srhines, krytarowski, mgorny, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D31131
llvm-svn: 298810
2017-03-26 15:34:57 +00:00
|
|
|
platform_openbsd::PlatformOpenBSD::Initialize();
|
2016-06-29 13:58:27 +00:00
|
|
|
PlatformWindows::Initialize();
|
|
|
|
platform_android::PlatformAndroid::Initialize();
|
|
|
|
PlatformRemoteiOS::Initialize();
|
|
|
|
PlatformMacOSX::Initialize();
|
|
|
|
#if defined(__APPLE__)
|
|
|
|
PlatformiOSSimulator::Initialize();
|
|
|
|
PlatformDarwinKernel::Initialize();
|
|
|
|
#endif
|
|
|
|
|
2015-03-31 21:03:22 +00:00
|
|
|
// Initialize LLVM and Clang
|
|
|
|
llvm::InitializeAllTargets();
|
|
|
|
llvm::InitializeAllAsmPrinters();
|
|
|
|
llvm::InitializeAllTargetMCs();
|
|
|
|
llvm::InitializeAllDisassemblers();
|
2016-09-06 20:57:50 +00:00
|
|
|
|
TypeSystem is now a plugin interface and removed any "ClangASTContext &Class::GetClangASTContext()" functions.
This cleans up type systems to be more pluggable. Prior to this we had issues:
- Module, SymbolFile, and many others has "ClangASTContext &GetClangASTContext()" functions. All have been switched over to use "TypeSystem *GetTypeSystemForLanguage()"
- Cleaned up any places that were using the GetClangASTContext() functions to use TypeSystem
- Cleaned up Module so that it no longer has dedicated type system member variables:
lldb::ClangASTContextUP m_ast; ///< The Clang AST context for this module.
lldb::GoASTContextUP m_go_ast; ///< The Go AST context for this module.
Now we have a type system map:
typedef std::map<lldb::LanguageType, lldb::TypeSystemSP> TypeSystemMap;
TypeSystemMap m_type_system_map; ///< A map of any type systems associated with this module
- Many places in code were using ClangASTContext static functions to place with CompilerType objects and add modifiers (const, volatile, restrict) and to make typedefs, L and R value references and more. These have been made into CompilerType functions that are abstract:
class CompilerType
{
...
//----------------------------------------------------------------------
// Return a new CompilerType that is a L value reference to this type if
// this type is valid and the type system supports L value references,
// else return an invalid type.
//----------------------------------------------------------------------
CompilerType
GetLValueReferenceType () const;
//----------------------------------------------------------------------
// Return a new CompilerType that is a R value reference to this type if
// this type is valid and the type system supports R value references,
// else return an invalid type.
//----------------------------------------------------------------------
CompilerType
GetRValueReferenceType () const;
//----------------------------------------------------------------------
// Return a new CompilerType adds a const modifier to this type if
// this type is valid and the type system supports const modifiers,
// else return an invalid type.
//----------------------------------------------------------------------
CompilerType
AddConstModifier () const;
//----------------------------------------------------------------------
// Return a new CompilerType adds a volatile modifier to this type if
// this type is valid and the type system supports volatile modifiers,
// else return an invalid type.
//----------------------------------------------------------------------
CompilerType
AddVolatileModifier () const;
//----------------------------------------------------------------------
// Return a new CompilerType adds a restrict modifier to this type if
// this type is valid and the type system supports restrict modifiers,
// else return an invalid type.
//----------------------------------------------------------------------
CompilerType
AddRestrictModifier () const;
//----------------------------------------------------------------------
// Create a typedef to this type using "name" as the name of the typedef
// this type is valid and the type system supports typedefs, else return
// an invalid type.
//----------------------------------------------------------------------
CompilerType
CreateTypedef (const char *name, const CompilerDeclContext &decl_ctx) const;
};
Other changes include:
- Removed "CompilerType TypeSystem::GetIntTypeFromBitSize(...)" and CompilerType TypeSystem::GetFloatTypeFromBitSize(...) and replaced it with "CompilerType TypeSystem::GetBuiltinTypeForEncodingAndBitSize(lldb::Encoding encoding, size_t bit_size);"
- Fixed code in Type.h to not request the full type for a type for no good reason, just request the forward type and let the type expand as needed
llvm-svn: 247953
2015-09-17 22:23:34 +00:00
|
|
|
ClangASTContext::Initialize();
|
2016-09-06 20:57:50 +00:00
|
|
|
|
2015-03-31 21:03:22 +00:00
|
|
|
ABIMacOSX_i386::Initialize();
|
|
|
|
ABIMacOSX_arm::Initialize();
|
|
|
|
ABIMacOSX_arm64::Initialize();
|
2015-04-29 10:49:45 +00:00
|
|
|
ABISysV_arm::Initialize();
|
2015-04-29 11:52:35 +00:00
|
|
|
ABISysV_arm64::Initialize();
|
2015-12-10 17:53:07 +00:00
|
|
|
ABISysV_hexagon::Initialize();
|
2015-06-25 17:50:15 +00:00
|
|
|
ABISysV_i386::Initialize();
|
2015-03-31 21:03:22 +00:00
|
|
|
ABISysV_x86_64::Initialize();
|
|
|
|
ABISysV_ppc::Initialize();
|
|
|
|
ABISysV_ppc64::Initialize();
|
2015-06-18 07:02:10 +00:00
|
|
|
ABISysV_mips::Initialize();
|
2015-06-19 04:25:07 +00:00
|
|
|
ABISysV_mips64::Initialize();
|
2016-04-14 14:28:34 +00:00
|
|
|
ABISysV_s390x::Initialize();
|
2019-06-24 18:21:05 +00:00
|
|
|
ABIWindows_x86_64::Initialize();
|
2017-10-25 21:05:31 +00:00
|
|
|
|
|
|
|
ArchitectureArm::Initialize();
|
2018-12-13 14:28:25 +00:00
|
|
|
ArchitectureMips::Initialize();
|
2018-03-12 21:17:04 +00:00
|
|
|
ArchitecturePPC64::Initialize();
|
2017-10-25 21:05:31 +00:00
|
|
|
|
2015-03-31 21:03:22 +00:00
|
|
|
DisassemblerLLVMC::Initialize();
|
2016-09-06 20:57:50 +00:00
|
|
|
|
2015-03-31 21:03:22 +00:00
|
|
|
JITLoaderGDB::Initialize();
|
|
|
|
ProcessElfCore::Initialize();
|
2018-05-22 16:33:43 +00:00
|
|
|
ProcessMachCore::Initialize();
|
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
|
|
|
minidump::ProcessMinidump::Initialize();
|
2015-03-31 21:03:22 +00:00
|
|
|
MemoryHistoryASan::Initialize();
|
|
|
|
AddressSanitizerRuntime::Initialize();
|
2016-03-23 15:36:22 +00:00
|
|
|
ThreadSanitizerRuntime::Initialize();
|
2017-06-16 20:59:08 +00:00
|
|
|
UndefinedBehaviorSanitizerRuntime::Initialize();
|
|
|
|
MainThreadCheckerRuntime::Initialize();
|
2016-09-06 20:57:50 +00:00
|
|
|
|
2015-03-31 21:03:22 +00:00
|
|
|
SymbolVendorELF::Initialize();
|
Introduce SymbolFileBreakpad and use it to fill symtab
Summary:
This commit adds the glue code necessary to integrate the
SymbolFileBreakpad into the plugin system. Most of the methods are
stubbed out. The only method implemented method is AddSymbols, which
parses the PUBLIC "section" of the breakpad "object file", and fills out
the Module's symtab.
To enable testing this, I've made two additional changes:
- dump Symtab from the SymbolVendor class. The symtab was already being
dumped as a part of the object file dump, but that happened before
symbol vendor kicked in, so it did not reflect any symbols added
there.
- add ability to explicitly specify the external symbol file in
lldb-test (so that the object file could be linked with the breakpad
symbol file). To make things simpler, I've changed lldb-test from
consuming multiple inputs (and dumping their symbols) to having it
just process a single file per invocation. This was not a problem
since everyone was using it that way already.
Reviewers: clayborg, zturner, lemo, markmentovai, amccarth
Subscribers: mgorny, lldb-commits
Differential Revision: https://reviews.llvm.org/D56173
llvm-svn: 350924
2019-01-11 11:17:51 +00:00
|
|
|
breakpad::SymbolFileBreakpad::Initialize();
|
2015-03-31 21:03:22 +00:00
|
|
|
SymbolFileDWARF::Initialize();
|
Add support for reading line tables from PDB files.
PDB is Microsoft's debug information format, and although we
cannot yet generate it, we still must be able to consume it.
Reason for this is that debug information for system libraries
(e.g. kernel32, C Runtime Library, etc) only have debug info
in PDB format, so in order to be able to support debugging
of system code, we must support it.
Currently this code should compile on every platform, but on
non-Windows platforms the PDB plugin will return 0 capabilities,
meaning that for now PDB is only supported on Windows. This
may change in the future, but the API is designed in such a way
that this will require few (if any) changes on the LLDB side.
In the future we can just flip a switch and everything will
work.
This patch only adds support for line tables. It does not return
information about functions, types, global variables, or anything
else. This functionality will be added in a followup patch.
Differential Revision: http://reviews.llvm.org/D17363
Reviewed by: Greg Clayton
llvm-svn: 262528
2016-03-02 22:05:52 +00:00
|
|
|
SymbolFilePDB::Initialize();
|
2015-03-31 21:03:22 +00:00
|
|
|
SymbolFileSymtab::Initialize();
|
|
|
|
UnwindAssemblyInstEmulation::Initialize();
|
|
|
|
UnwindAssembly_x86::Initialize();
|
2019-05-06 19:38:24 +00:00
|
|
|
|
|
|
|
EmulateInstructionARM::Initialize();
|
2015-03-31 21:03:22 +00:00
|
|
|
EmulateInstructionARM64::Initialize();
|
2019-05-06 19:38:24 +00:00
|
|
|
EmulateInstructionMIPS::Initialize();
|
|
|
|
EmulateInstructionMIPS64::Initialize();
|
2018-02-27 18:42:46 +00:00
|
|
|
EmulateInstructionPPC64::Initialize();
|
2019-05-06 19:38:24 +00:00
|
|
|
|
2015-03-31 21:03:22 +00:00
|
|
|
SymbolFileDWARFDebugMap::Initialize();
|
|
|
|
ItaniumABILanguageRuntime::Initialize();
|
|
|
|
AppleObjCRuntimeV2::Initialize();
|
|
|
|
AppleObjCRuntimeV1::Initialize();
|
|
|
|
SystemRuntimeMacOSX::Initialize();
|
2015-04-09 16:49:25 +00:00
|
|
|
RenderScriptRuntime::Initialize();
|
2016-09-06 20:57:50 +00:00
|
|
|
|
2015-09-01 18:22:39 +00:00
|
|
|
CPlusPlusLanguage::Initialize();
|
|
|
|
ObjCLanguage::Initialize();
|
|
|
|
ObjCPlusPlusLanguage::Initialize();
|
2015-03-31 21:03:22 +00:00
|
|
|
|
2016-12-15 15:00:41 +00:00
|
|
|
#if defined(_WIN32)
|
2016-11-23 16:26:37 +00:00
|
|
|
ProcessWindows::Initialize();
|
2015-03-31 21:03:22 +00:00
|
|
|
#endif
|
|
|
|
#if defined(__FreeBSD__)
|
|
|
|
ProcessFreeBSD::Initialize();
|
|
|
|
#endif
|
|
|
|
#if defined(__APPLE__)
|
|
|
|
SymbolVendorMacOSX::Initialize();
|
|
|
|
ProcessKDP::Initialize();
|
2015-11-06 00:22:53 +00:00
|
|
|
PlatformAppleTVSimulator::Initialize();
|
|
|
|
PlatformAppleWatchSimulator::Initialize();
|
|
|
|
PlatformRemoteAppleTV::Initialize();
|
|
|
|
PlatformRemoteAppleWatch::Initialize();
|
2018-10-11 00:28:35 +00:00
|
|
|
PlatformRemoteAppleBridge::Initialize();
|
2016-03-29 15:00:26 +00:00
|
|
|
DynamicLoaderDarwinKernel::Initialize();
|
2015-03-31 21:03:22 +00:00
|
|
|
#endif
|
2016-08-19 04:21:48 +00:00
|
|
|
|
2018-04-30 16:49:04 +00:00
|
|
|
// This plugin is valid on any host that talks to a Darwin remote. It
|
|
|
|
// shouldn't be limited to __APPLE__.
|
2016-08-19 04:21:48 +00:00
|
|
|
StructuredDataDarwinLog::Initialize();
|
|
|
|
|
2015-03-31 21:03:22 +00:00
|
|
|
// Platform agnostic plugins
|
|
|
|
platform_gdb_server::PlatformRemoteGDBServer::Initialize();
|
|
|
|
|
|
|
|
process_gdb_remote::ProcessGDBRemote::Initialize();
|
2016-03-29 15:00:26 +00:00
|
|
|
DynamicLoaderMacOSXDYLD::Initialize();
|
2016-07-21 08:30:55 +00:00
|
|
|
DynamicLoaderMacOS::Initialize();
|
2016-03-29 15:00:26 +00:00
|
|
|
DynamicLoaderPOSIXDYLD::Initialize();
|
2015-03-31 21:03:22 +00:00
|
|
|
DynamicLoaderStatic::Initialize();
|
2016-03-29 15:00:26 +00:00
|
|
|
DynamicLoaderWindowsDYLD::Initialize();
|
2015-03-31 21:03:22 +00:00
|
|
|
|
|
|
|
// Scan for any system or user LLDB plug-ins
|
|
|
|
PluginManager::Initialize();
|
|
|
|
|
2018-04-30 16:49:04 +00:00
|
|
|
// The process settings need to know about installed plug-ins, so the
|
|
|
|
// Settings must be initialized
|
2015-03-31 21:03:22 +00:00
|
|
|
// AFTER PluginManager::Initialize is called.
|
|
|
|
|
|
|
|
Debugger::SettingsInitialize();
|
2018-12-03 17:28:29 +00:00
|
|
|
|
|
|
|
return llvm::Error::success();
|
2015-03-31 21:03:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void SystemInitializerFull::Terminate() {
|
2017-05-15 13:02:37 +00:00
|
|
|
static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
|
|
|
|
Timer scoped_timer(func_cat, LLVM_PRETTY_FUNCTION);
|
2016-09-06 20:57:50 +00:00
|
|
|
|
2015-03-31 21:03:22 +00:00
|
|
|
Debugger::SettingsTerminate();
|
2016-09-06 20:57:50 +00:00
|
|
|
|
2015-03-31 21:03:22 +00:00
|
|
|
// Terminate and unload and loaded system or user LLDB plug-ins
|
|
|
|
PluginManager::Terminate();
|
2016-09-06 20:57:50 +00:00
|
|
|
|
TypeSystem is now a plugin interface and removed any "ClangASTContext &Class::GetClangASTContext()" functions.
This cleans up type systems to be more pluggable. Prior to this we had issues:
- Module, SymbolFile, and many others has "ClangASTContext &GetClangASTContext()" functions. All have been switched over to use "TypeSystem *GetTypeSystemForLanguage()"
- Cleaned up any places that were using the GetClangASTContext() functions to use TypeSystem
- Cleaned up Module so that it no longer has dedicated type system member variables:
lldb::ClangASTContextUP m_ast; ///< The Clang AST context for this module.
lldb::GoASTContextUP m_go_ast; ///< The Go AST context for this module.
Now we have a type system map:
typedef std::map<lldb::LanguageType, lldb::TypeSystemSP> TypeSystemMap;
TypeSystemMap m_type_system_map; ///< A map of any type systems associated with this module
- Many places in code were using ClangASTContext static functions to place with CompilerType objects and add modifiers (const, volatile, restrict) and to make typedefs, L and R value references and more. These have been made into CompilerType functions that are abstract:
class CompilerType
{
...
//----------------------------------------------------------------------
// Return a new CompilerType that is a L value reference to this type if
// this type is valid and the type system supports L value references,
// else return an invalid type.
//----------------------------------------------------------------------
CompilerType
GetLValueReferenceType () const;
//----------------------------------------------------------------------
// Return a new CompilerType that is a R value reference to this type if
// this type is valid and the type system supports R value references,
// else return an invalid type.
//----------------------------------------------------------------------
CompilerType
GetRValueReferenceType () const;
//----------------------------------------------------------------------
// Return a new CompilerType adds a const modifier to this type if
// this type is valid and the type system supports const modifiers,
// else return an invalid type.
//----------------------------------------------------------------------
CompilerType
AddConstModifier () const;
//----------------------------------------------------------------------
// Return a new CompilerType adds a volatile modifier to this type if
// this type is valid and the type system supports volatile modifiers,
// else return an invalid type.
//----------------------------------------------------------------------
CompilerType
AddVolatileModifier () const;
//----------------------------------------------------------------------
// Return a new CompilerType adds a restrict modifier to this type if
// this type is valid and the type system supports restrict modifiers,
// else return an invalid type.
//----------------------------------------------------------------------
CompilerType
AddRestrictModifier () const;
//----------------------------------------------------------------------
// Create a typedef to this type using "name" as the name of the typedef
// this type is valid and the type system supports typedefs, else return
// an invalid type.
//----------------------------------------------------------------------
CompilerType
CreateTypedef (const char *name, const CompilerDeclContext &decl_ctx) const;
};
Other changes include:
- Removed "CompilerType TypeSystem::GetIntTypeFromBitSize(...)" and CompilerType TypeSystem::GetFloatTypeFromBitSize(...) and replaced it with "CompilerType TypeSystem::GetBuiltinTypeForEncodingAndBitSize(lldb::Encoding encoding, size_t bit_size);"
- Fixed code in Type.h to not request the full type for a type for no good reason, just request the forward type and let the type expand as needed
llvm-svn: 247953
2015-09-17 22:23:34 +00:00
|
|
|
ClangASTContext::Terminate();
|
2016-09-06 20:57:50 +00:00
|
|
|
|
2018-12-13 14:28:25 +00:00
|
|
|
ArchitectureArm::Terminate();
|
|
|
|
ArchitectureMips::Terminate();
|
|
|
|
ArchitecturePPC64::Terminate();
|
|
|
|
|
2015-03-31 21:03:22 +00:00
|
|
|
ABIMacOSX_i386::Terminate();
|
|
|
|
ABIMacOSX_arm::Terminate();
|
|
|
|
ABIMacOSX_arm64::Terminate();
|
2015-04-29 10:49:45 +00:00
|
|
|
ABISysV_arm::Terminate();
|
2015-04-29 11:52:35 +00:00
|
|
|
ABISysV_arm64::Terminate();
|
2015-12-10 17:53:07 +00:00
|
|
|
ABISysV_hexagon::Terminate();
|
2015-06-25 17:50:15 +00:00
|
|
|
ABISysV_i386::Terminate();
|
2015-03-31 21:03:22 +00:00
|
|
|
ABISysV_x86_64::Terminate();
|
|
|
|
ABISysV_ppc::Terminate();
|
|
|
|
ABISysV_ppc64::Terminate();
|
2015-06-18 07:02:10 +00:00
|
|
|
ABISysV_mips::Terminate();
|
2015-06-19 04:25:07 +00:00
|
|
|
ABISysV_mips64::Terminate();
|
2016-04-14 14:28:34 +00:00
|
|
|
ABISysV_s390x::Terminate();
|
2019-06-24 18:21:05 +00:00
|
|
|
ABIWindows_x86_64::Terminate();
|
2015-03-31 21:03:22 +00:00
|
|
|
DisassemblerLLVMC::Terminate();
|
2016-09-06 20:57:50 +00:00
|
|
|
|
2015-03-31 21:03:22 +00:00
|
|
|
JITLoaderGDB::Terminate();
|
|
|
|
ProcessElfCore::Terminate();
|
2018-05-22 16:33:43 +00:00
|
|
|
ProcessMachCore::Terminate();
|
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
|
|
|
minidump::ProcessMinidump::Terminate();
|
2015-03-31 21:03:22 +00:00
|
|
|
MemoryHistoryASan::Terminate();
|
|
|
|
AddressSanitizerRuntime::Terminate();
|
2016-03-23 15:36:22 +00:00
|
|
|
ThreadSanitizerRuntime::Terminate();
|
2017-06-16 20:59:08 +00:00
|
|
|
UndefinedBehaviorSanitizerRuntime::Terminate();
|
|
|
|
MainThreadCheckerRuntime::Terminate();
|
2015-03-31 21:03:22 +00:00
|
|
|
SymbolVendorELF::Terminate();
|
Introduce SymbolFileBreakpad and use it to fill symtab
Summary:
This commit adds the glue code necessary to integrate the
SymbolFileBreakpad into the plugin system. Most of the methods are
stubbed out. The only method implemented method is AddSymbols, which
parses the PUBLIC "section" of the breakpad "object file", and fills out
the Module's symtab.
To enable testing this, I've made two additional changes:
- dump Symtab from the SymbolVendor class. The symtab was already being
dumped as a part of the object file dump, but that happened before
symbol vendor kicked in, so it did not reflect any symbols added
there.
- add ability to explicitly specify the external symbol file in
lldb-test (so that the object file could be linked with the breakpad
symbol file). To make things simpler, I've changed lldb-test from
consuming multiple inputs (and dumping their symbols) to having it
just process a single file per invocation. This was not a problem
since everyone was using it that way already.
Reviewers: clayborg, zturner, lemo, markmentovai, amccarth
Subscribers: mgorny, lldb-commits
Differential Revision: https://reviews.llvm.org/D56173
llvm-svn: 350924
2019-01-11 11:17:51 +00:00
|
|
|
breakpad::SymbolFileBreakpad::Terminate();
|
2015-03-31 21:03:22 +00:00
|
|
|
SymbolFileDWARF::Terminate();
|
Add support for reading line tables from PDB files.
PDB is Microsoft's debug information format, and although we
cannot yet generate it, we still must be able to consume it.
Reason for this is that debug information for system libraries
(e.g. kernel32, C Runtime Library, etc) only have debug info
in PDB format, so in order to be able to support debugging
of system code, we must support it.
Currently this code should compile on every platform, but on
non-Windows platforms the PDB plugin will return 0 capabilities,
meaning that for now PDB is only supported on Windows. This
may change in the future, but the API is designed in such a way
that this will require few (if any) changes on the LLDB side.
In the future we can just flip a switch and everything will
work.
This patch only adds support for line tables. It does not return
information about functions, types, global variables, or anything
else. This functionality will be added in a followup patch.
Differential Revision: http://reviews.llvm.org/D17363
Reviewed by: Greg Clayton
llvm-svn: 262528
2016-03-02 22:05:52 +00:00
|
|
|
SymbolFilePDB::Terminate();
|
2015-03-31 21:03:22 +00:00
|
|
|
SymbolFileSymtab::Terminate();
|
|
|
|
UnwindAssembly_x86::Terminate();
|
|
|
|
UnwindAssemblyInstEmulation::Terminate();
|
2019-05-06 19:38:24 +00:00
|
|
|
|
|
|
|
EmulateInstructionARM::Terminate();
|
2015-03-31 21:03:22 +00:00
|
|
|
EmulateInstructionARM64::Terminate();
|
2019-05-06 19:38:24 +00:00
|
|
|
EmulateInstructionMIPS::Terminate();
|
|
|
|
EmulateInstructionMIPS64::Terminate();
|
2018-02-27 18:42:46 +00:00
|
|
|
EmulateInstructionPPC64::Terminate();
|
2019-05-06 19:38:24 +00:00
|
|
|
|
2015-03-31 21:03:22 +00:00
|
|
|
SymbolFileDWARFDebugMap::Terminate();
|
|
|
|
ItaniumABILanguageRuntime::Terminate();
|
|
|
|
AppleObjCRuntimeV2::Terminate();
|
|
|
|
AppleObjCRuntimeV1::Terminate();
|
|
|
|
SystemRuntimeMacOSX::Terminate();
|
2015-04-09 16:49:25 +00:00
|
|
|
RenderScriptRuntime::Terminate();
|
2016-09-06 20:57:50 +00:00
|
|
|
|
2015-09-01 18:22:39 +00:00
|
|
|
CPlusPlusLanguage::Terminate();
|
|
|
|
ObjCLanguage::Terminate();
|
|
|
|
ObjCPlusPlusLanguage::Terminate();
|
2016-01-04 01:43:47 +00:00
|
|
|
|
2015-03-31 21:03:22 +00:00
|
|
|
#if defined(__APPLE__)
|
2016-03-29 15:00:26 +00:00
|
|
|
DynamicLoaderDarwinKernel::Terminate();
|
2015-03-31 21:03:22 +00:00
|
|
|
ProcessKDP::Terminate();
|
|
|
|
SymbolVendorMacOSX::Terminate();
|
2015-11-06 00:22:53 +00:00
|
|
|
PlatformAppleTVSimulator::Terminate();
|
|
|
|
PlatformAppleWatchSimulator::Terminate();
|
|
|
|
PlatformRemoteAppleTV::Terminate();
|
|
|
|
PlatformRemoteAppleWatch::Terminate();
|
2018-10-11 00:28:35 +00:00
|
|
|
PlatformRemoteAppleBridge::Terminate();
|
2015-03-31 21:03:22 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(__FreeBSD__)
|
|
|
|
ProcessFreeBSD::Terminate();
|
|
|
|
#endif
|
|
|
|
Debugger::SettingsTerminate();
|
|
|
|
|
|
|
|
platform_gdb_server::PlatformRemoteGDBServer::Terminate();
|
|
|
|
process_gdb_remote::ProcessGDBRemote::Terminate();
|
2016-08-19 04:21:48 +00:00
|
|
|
StructuredDataDarwinLog::Terminate();
|
|
|
|
|
2016-03-29 15:00:26 +00:00
|
|
|
DynamicLoaderMacOSXDYLD::Terminate();
|
2016-07-21 08:30:55 +00:00
|
|
|
DynamicLoaderMacOS::Terminate();
|
2016-03-29 15:00:26 +00:00
|
|
|
DynamicLoaderPOSIXDYLD::Terminate();
|
2015-03-31 21:03:22 +00:00
|
|
|
DynamicLoaderStatic::Terminate();
|
2016-03-29 15:00:26 +00:00
|
|
|
DynamicLoaderWindowsDYLD::Terminate();
|
2015-03-31 21:03:22 +00:00
|
|
|
|
2016-03-16 08:48:56 +00:00
|
|
|
#ifndef LLDB_DISABLE_PYTHON
|
|
|
|
OperatingSystemPython::Terminate();
|
|
|
|
#endif
|
2016-09-06 20:57:50 +00:00
|
|
|
|
2016-06-29 13:58:27 +00:00
|
|
|
platform_freebsd::PlatformFreeBSD::Terminate();
|
|
|
|
platform_linux::PlatformLinux::Terminate();
|
|
|
|
platform_netbsd::PlatformNetBSD::Terminate();
|
[LLDB] OpenBSD support
Summary:
Add basic OpenBSD support. This is enough to be able to analyze core dumps for OpenBSD/amd64, OpenBSD/arm, OpenBSD/arm64 and OpenBSD/i386.
Note that part of the changes to source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp fix a bug that probably affects other platforms as well. The GetProgramHeaderByIndex() interface use 1-based indices, but in some case when looping over the headers the, the loop starts at 0 and misses the last header. This caused problems on OpenBSD since OpenBSD core dumps have the PT_NOTE segment as the last program header.
Reviewers: joerg, labath, krytarowski
Reviewed By: krytarowski
Subscribers: aemerson, emaste, rengolin, srhines, krytarowski, mgorny, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D31131
llvm-svn: 298810
2017-03-26 15:34:57 +00:00
|
|
|
platform_openbsd::PlatformOpenBSD::Terminate();
|
2016-06-29 13:58:27 +00:00
|
|
|
PlatformWindows::Terminate();
|
|
|
|
platform_android::PlatformAndroid::Terminate();
|
|
|
|
PlatformMacOSX::Terminate();
|
|
|
|
PlatformRemoteiOS::Terminate();
|
|
|
|
#if defined(__APPLE__)
|
|
|
|
PlatformiOSSimulator::Terminate();
|
|
|
|
PlatformDarwinKernel::Terminate();
|
|
|
|
#endif
|
|
|
|
|
Re-commit "Introduce ObjectFileBreakpad"
This re-commits r348592, which was reverted due to a failing test on
macos.
The issue was that I was passing a null pointer for the
"CreateMemoryInstance" callback when registering ObjectFileBreakpad,
which caused crashes when attemping to load modules from memory. The
correct thing to do is to pass a callback which always returns a null
pointer (as breakpad files are never loaded in inferior memory).
It turns out that there is only one test which exercises this code path,
and it's mac-only, so I've create a new test which should run everywhere
(except windows, as one cannot delete an executable which is being run).
Unfortunately, this test still fails on linux for other reasons, but at
least it gives us something to aim for.
The original commit message was:
This patch adds the scaffolding necessary for lldb to recognise symbol
files generated by breakpad. These (textual) files contain just enough
information to be able to produce a backtrace from a crash
dump. This information includes:
- UUID, architecture and name of the module
- line tables
- list of symbols
- unwind information
A minimal breakpad file could look like this:
MODULE Linux x86_64 0000000024B5D199F0F766FFFFFF5DC30 a.out
INFO CODE_ID 00000000B52499D1F0F766FFFFFF5DC3
FILE 0 /tmp/a.c
FUNC 1010 10 0 _start
1010 4 4 0
1014 5 5 0
1019 5 6 0
101e 2 7 0
PUBLIC 1010 0 _start
STACK CFI INIT 1010 10 .cfa: $rsp 8 + .ra: .cfa -8 + ^
STACK CFI 1011 $rbp: .cfa -16 + ^ .cfa: $rsp 16 +
STACK CFI 1014 .cfa: $rbp 16 +
Even though this data would normally be considered "symbol" information,
in the current lldb infrastructure it is assumed every SymbolFile object
is backed by an ObjectFile instance. So, in order to better interoperate
with the rest of the code (particularly symbol vendors).
In this patch I just parse the breakpad header, which is enough to
populate the UUID and architecture fields of the ObjectFile interface.
The rough plan for followup patches is to expose the individual parts of
the breakpad file as ObjectFile "sections", which can then be used by
other parts of the codebase (SymbolFileBreakpad ?) to vend the necessary
information.
Reviewers: clayborg, zturner, lemo, amccarth
Subscribers: mgorny, fedor.sergeev, markmentovai, lldb-commits
Differential Revision: https://reviews.llvm.org/D55214
llvm-svn: 348773
2018-12-10 17:16:38 +00:00
|
|
|
breakpad::ObjectFileBreakpad::Terminate();
|
2018-05-24 12:44:18 +00:00
|
|
|
ObjectFileELF::Terminate();
|
|
|
|
ObjectFileMachO::Terminate();
|
|
|
|
ObjectFilePECOFF::Terminate();
|
|
|
|
|
2019-05-02 18:11:44 +00:00
|
|
|
ObjectContainerBSDArchive::Terminate();
|
|
|
|
ObjectContainerUniversalMachO::Terminate();
|
|
|
|
|
2015-03-31 21:03:22 +00:00
|
|
|
// Now shutdown the common parts, in reverse order.
|
|
|
|
SystemInitializerCommon::Terminate();
|
|
|
|
}
|