Commit Graph

11624 Commits

Author SHA1 Message Date
Antonio Afonso f4335b8e3c Implement GetSharedLibraryInfoAddress
Summary:
This is the third patch to improve module loading in a series that started here (where I explain the motivation and solution): D62499

Add functions to read the r_debug location to know where the linked list of loaded libraries are so I can generate the `xfer:libraries-svr4` packet.
I'm also using this function to implement `GetSharedLibraryInfoAddress` that was "not implemented" for linux.
Most of this code was inspired by the current ds2 implementation here: https://github.com/facebook/ds2/blob/master/Sources/Target/POSIX/ELFProcess.cpp.

Reviewers: clayborg, xiaobai, labath

Reviewed By: clayborg, labath

Subscribers: emaste, krytarowski, mgorny, lldb-commits

Tags: #lldb

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

llvm-svn: 363458
2019-06-14 21:15:08 +00:00
Greg Clayton 6df47ef22b Don't try to parse ObjC method if CU isn't ObjC
Improve manual indexing performance when indexing non objective C code. 

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

llvm-svn: 363441
2019-06-14 19:18:10 +00:00
Jonas Devlieghere 28defa70ea Remove stale comment and disabled code (NFC)
llvm-svn: 363438
2019-06-14 18:12:55 +00:00
Pavel Labath 00e3968b8a DWARF: port debug_ranges/rnglists over to DWARFContext
llvm-svn: 363400
2019-06-14 14:12:25 +00:00
Pavel Labath fe79fbc99d DWARF: Remove unused includes from DWARFDebugAranges.h/cpp
llvm-svn: 363382
2019-06-14 13:21:57 +00:00
Pavel Labath 6a2eb36710 Have DWARFUnit store a *reference* to SymbolFileDWARF
Previously it was storing a *pointer*, which left open the possibility
of this pointer being null. We never made use of that possibility (it
does not make sense), and most of the code was already assuming that.
However, there were a couple of null-checks scattered around the code.

This patch replaces the reference with a pointer, making the
non-null-ness explicit, and removes the remaining null-checks.

llvm-svn: 363381
2019-06-14 13:01:16 +00:00
Pavel Labath 78b2cf71f5 DWARFIndex: s/ReportInvalidDIEOffset/ReportInvalidDIERef
In a dwo/debug_types world, the die offset is not enough to uniquely
idendify a debug info entry. Pass the the entire DIERef object instead.

This is technically NFC, because only AppleIndex implemented this
method (and there, the die offset *is* enough for unique
identification). However, this makes the code simpler, and simplifies
some of the follow-up patches.

llvm-svn: 363373
2019-06-14 12:01:18 +00:00
Gauthier Harnisch 796ed03b84 [C++20] add Basic consteval specifier
Summary:
this revision adds Lexing, Parsing and Basic Semantic for the consteval specifier as specified by http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1073r3.html

with this patch, the consteval specifier is treated as constexpr but can only be applied to function declaration.

Changes:
 - add the consteval keyword.
 - add parsing of consteval specifier for normal declarations and lambdas expressions.
 - add the whether a declaration is constexpr is now represented by and enum everywhere except for variable because they can't be consteval.
 - adapt diagnostic about constexpr to print constexpr or consteval depending on the case.
 - add tests for basic semantic.

Reviewers: rsmith, martong, shafik

Reviewed By: rsmith

Subscribers: eraman, efriedma, rnkovacs, cfe-commits

Tags: #clang

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

llvm-svn: 363362
2019-06-14 08:56:20 +00:00
Pavel Labath d8aca8886f Make UniqueCStringMap work with non-default-constructible types and other improvements/cleanups
Summary:
The motivation for this was me wanting to make the validity of dwarf
DIERefs explicit (via llvm::Optional<DIERef>). This meant that the class
would no longer have a default constructor. As the DIERef was being
stored in a UniqueCStringMap, this meant that this container (like all
standard containers) needed to work with non-default-constructible types
too.

This part is achieved by removing the default constructors for the map
entry types, and providing appropriate comparison overloads so that we
can search for map entries without constructing a dummy entry. While
doing that, I took the opportunity to modernize the code, and add some
tests. Functions that were completely unused are deleted.

This required also some changes in the Symtab code, as it was default
constructing map entries, which was not impossible even though its
value type was default-constructible. Technically, these changes could
be avoided with some SFINAE on the entry type, but I felt that the code
is cleaner this way anyway.

Reviewers: JDevlieghere, sgraenitz

Subscribers: mgorny, aprantl, lldb-commits

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

llvm-svn: 363357
2019-06-14 06:33:31 +00:00
Alex Langford 347ec0faa7 [NFC] Replace a plugin header with a non-plugin header
llvm-svn: 363338
2019-06-13 23:40:34 +00:00
Pavel Labath ad17e289f0 DWARF: Don't create lldb CompileUnits for DWARF type units
Summary:
Type units don't represent actual compilations and a lot of the
operations that we do with lldb compile units (getting their line
tables, variables, etc.) don't make sense for them. There is also a lot
more of them (sometimes over 100x), so making them more lightweight pays
off.

The main change in this patch is that we stop creating lldb CompileUnits
for DWARF type units. The trickiest part here is that the SymbolFile
interface requires that we assign consecutive sequence IDs to the
compile units we create. As DWARF type and compile units can come in any
order (in v5), this means we can no longer use 1-1 mapping between DWARF
and lldb compile units. Instead I build a translation table between the
two indices. To avoid pessimizing the case where there are no type
units, I build the translation table only in case we have at least one
type unit.

Additionaly, I also tried to strenghted type safete by replacing
DWARFUnit with DWARFCompileUnit where applicable. Though that was not
stricly necessary, I found it a good way to ensure that the
transformations I am doing here make sense. In the places where I was
changing the function signatures, and where it was obvious that the
objects being handled were not null, I also replaced pointers with
references.

There shouldn't be any major functional change with this patch. The only
change I observed is that now the types in the type units will not be
parsed when one calls Module::ParseAllDebugSymbols, unless they are
referenced from other compile units. This makes sense, given how
ParseAllDebugSymbols is implemented (it iterates over all compile
units), and it only matters for one hand-writted test where I did not
bother to reference the types from the compile units (which I now do).

Reviewers: clayborg, JDevlieghere, aprantl

Subscribers: jdoerfert, lldb-commits

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

llvm-svn: 363250
2019-06-13 11:22:47 +00:00
Jonas Devlieghere 2bf2568150 [Reproducers] Remove call to lldb_private::GetVersion()
Utility doesn't link against lldbBase so we cannot call GetVersion in
keep. I already added a string member m_version to deal with that, but
the call was still there.

llvm-svn: 363228
2019-06-13 05:14:25 +00:00
Jonas Devlieghere c2e2df7f7a [Reproducers] Include lldb version in the reproducer root
Generally, reproducers are rev-locked to the version of LLDB, so it's
valuable to have the LLDB version in the reproducer. For now I just want
the information to be present, without enforcing it, but I envision
emitting a warning during replay in the future.

Differential revision: https://reviews.llvm.org/D63229

llvm-svn: 363225
2019-06-13 04:35:22 +00:00
Jonas Devlieghere ef96e985fc [Reproducers] Simplify providers with nested Info struct (NFC)
This replaces the `info` typedef with a nested struct named Info. This
means we now have FooProvider and FooProvider::Info, instead of two
related but separate classes FooProvider and FooInfo. This change is
mostly cosmetic.

llvm-svn: 363211
2019-06-12 22:17:38 +00:00
Jason Molenda 0e197bcb6b Re-land r363103 ("When reading ObjC class table, use new SPI if it is avail")
with a call to snprintf() to find the size of the formatted string,
malloc memory, then snprintf again to format it into the buffer, instead
of calling asprintf.

Orig commit msg:

When reading ObjC class table, use new SPI if it is avail

In the latest OS betas, the objc runtime has a special interface
for the debugger, class_getNameRaw(), instead of the existing
class_getName(), which will return class names in their raw, unmangled
(in the case of swift) form.  When lldb can access the unmangled
names of classes, it won't need to fetch them out of the inferior
process after we run our "get the objc class table" expression.

If the new interface is absent (debugging a process on an older
target), lldb will fall back to class_getName and reading any class
names that it got back in demangled form, at a bit of a performance
cost on the first expression.

<rdar://problem/50688054> 

llvm-svn: 363206
2019-06-12 21:44:53 +00:00
Alex Langford 5b99928ba8 [Expression] Add PersistentExpressionState::GetCompilerTypeFromPersistentDecl
Summary:
PersistentStateExpressions (e.g. ClangPersistentVariables) have the
ability to define types using expressions that persist throughout the
debugging session. GetCompilerTypeFromPersistentDecl is a useful
operation to have if you need to use any of those persistently declared types,
like in CommandObjectMemory.

This decouples clang from CommandObjectMemory and decouples Plugins from
Commands in general.

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

llvm-svn: 363183
2019-06-12 17:47:06 +00:00
Pavel Labath ad805ef95a Recognise debug_types.dwo as a debug info section
This is a preparatory patch to allow reading type units from dwo files.

llvm-svn: 363146
2019-06-12 11:42:42 +00:00
Pavel Labath ca9c3de17e DWARF: Share line tables of type units
Summary:
This patch creates a cache of file lists in line tables referenced by
type units.  This cache is used to avoid parsing a line table twice
(since a file list will generally be shared by many type units).

It also sets things up in a way that parsing of DW_AT_decl_file
attributes will keep working even when we stop creating lldb compile
units for dwarf type units, but it stops short of actually doing that.
This means that the request for files now go directly to SymbolFileDWARF
instead of being routed there indirectly via the
lldb_private::CompileUnit class.

As a result of this, a number of occurences of SymbolContext variables
in DWARFASTParserClang have become unused, so I remove them.

This patch reduces the number of times a file list is being parsed, but
the situation is still suboptimal, as the parsed list is being copied
multiple times. This will be fixed when we stop creating CompileUnits
for DWARF type units.

Reviewers: clayborg, aprantl, JDevlieghere

Subscribers: jdoerfert, lldb-commits

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

llvm-svn: 363143
2019-06-12 11:29:50 +00:00
David Carlier f243ca4af8 [LLDB] Fix FreeBSD build
The auxiliary vector method had the wrong signature.

Reviewers: MaskRay, teemperor, aadsm

Reviewed By: MaskRay, teemperor

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

llvm-svn: 363135
2019-06-12 08:54:14 +00:00
Jason Molenda dd4bed3d7a Back out r363103 ("When reading ObjC class table, use new SPI if it is avail")
because it breaks the windows bot - asprintf() is not available.

llvm-svn: 363115
2019-06-12 01:01:34 +00:00
Alex Langford 6691f1b6cd [LanguageRuntime] Simplify CreateExceptionSearchFilter in derived classes
llvm-svn: 363109
2019-06-11 22:52:08 +00:00
Jason Molenda 1a7362f33e When reading ObjC class table, use new SPI if it is avail
In the latest OS betas, the objc runtime has a special interface
for the debugger, class_getNameRaw(), instead of the existing
class_getName(), which will return class names in their raw, unmangled
(in the case of swift) form.  When lldb can access the unmangled
names of classes, it won't need to fetch them out of the inferior
process after we run our "get the objc class table" expression.

If the new interface is absent (debugging a process on an older
target), lldb will fall back to class_getName and reading any class
names that it got back in demangled form, at a bit of a performance
cost on the first expression.

<rdar://problem/50688054> 

llvm-svn: 363103
2019-06-11 21:31:19 +00:00
Adrian Prantl e6130a3090 Fix a crash in option parsing.
The call to getopt_long didn't handle the case where the *last* option
had an argument missing.

<rdar://problem/51231882>

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

llvm-svn: 363101
2019-06-11 21:14:02 +00:00
Antonio Afonso 943faef1fa Add support to read aux vector values
Summary:
This is the second patch to improve module loading in a series that started here (where I explain the motivation and solution): https://reviews.llvm.org/D62499

I need to read the aux vector to know where the r_debug map with the loaded libraries are.
The AuxVector class was made generic so it could be reused between the POSIX-DYLD plugin and NativeProcess*. The class itself ended up in the ProcessUtility plugin.

Reviewers: clayborg, xiaobai, labath, JDevlieghere

Reviewed By: clayborg, labath, JDevlieghere

Subscribers: emaste, JDevlieghere, mgorny, lldb-commits

Tags: #lldb

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

llvm-svn: 363098
2019-06-11 20:16:13 +00:00
Tatyana Krasnukha f62e23d901 [Target] Use llvm::scope_exit to restore m_suppress_stop_hooks value.
llvm-svn: 362985
2019-06-10 21:13:37 +00:00
Alex Langford 45e78773eb [Target][NFC] Rename GetCPPLanguageRuntime to Get
This is a followup to rL362981, in which I moved GetObjCLanguageRuntime
from Process to ObjCLanguageRuntime, renaming it to Get along the way.

llvm-svn: 362984
2019-06-10 21:04:31 +00:00
Antonio Afonso 57e2da4f32 Create a generic handler for Xfer packets
Summary:
This is the first of a few patches I have to improve the performance of dynamic module loading on Android.

In this first diff I'll describe the context of my main motivation and will then link to it in the other diffs to avoid repeating myself.

## Motivation
I have a few scenarios where opening a specific feature on an Android app takes around 40s when lldb is attached to it. The reason for that is because 40 modules are dynamicly loaded at that point in time and each one of them is taking ~1s.

## The problem
To learn about new modules we have a breakpoint on a linker function that is called twice whenever a module is loaded. One time just before it's loaded (so lldb can check which modules are loaded) and another right after it's loaded (so lldb can check again which ones are loaded and calculate the diference).
It's figuring out which modules are loaded that is taking quite some time. This is currently done by traversing the linked list of loaded shared libraries that the linker maintains in memory. Each item in the linked list requires its own `x` packet sent to the gdb server (this is android so the network also plays a part). In my scenario there are 400+ loaded libraries and even though we read 0x800 worth of bytes at a time we still make ~180 requests that end up taking 150-200ms.
We also do this twice, once before the module is loaded (state = eAdd) and another right after (state = eConsistent) which easly adds up to ~400ms per module.

## A solution

**Implement `xfer:libraries-svr4` in lldb-server:**
I noticed in the code that loads the new modules that it had support for the `xfer:libraries-svr4` packet (added ~4 years ago to support the ds2 debug server) but we didn't support it in lldb-server. This single packet returns an xml list of all the loaded modules by the process. The advantage is that there's no more need to make 180 requests to read the linked list. Additionally this new requests takes around 10ms.

**More efficient usage of the `xfer:libraries-svr4` packet in lldb:**
When `xfer:libraries-svr4` is available the Process class has a `LoadModules` function that requests this packet and then loads or unloads modules based on the current list of loaded modules by the process.
This is the function that is used by the DYLDRendezvous class to get the list of loaded modules before and after the module is loaded. However, this is really not needed since the LoadModules function already loaded or unloaded the modules accordingly. I changed this strategy to call LoadModules only once (after the process has loaded the module).

**Bugs**
I found a few issues in lldb while implementing this and have submitted independent patches for them.

I tried to devide this into multiple logical patches to make it easier to review and discuss.

## Tests

I wanted to put these set of diffs up before having all the tests up and running to start having them reviewed from a techical point of view. I'm also having some trouble making the tests running on linux so I need more time to make that happen.

# This diff

The `xfer` packages follow the same protocol, they are requested with `xfer:<object>:<read|write>:<annex>:<offset,length>` and a return that starts with `l` or `m` depending if the offset and length covers the entire data or not. Before implementing the `xfer:libraries-svr4` I refactored the `xfer:auxv` to generically handle xfer packets so we can easly add new ones.

The overall structure of the function ends up being:
* Parse the packet into its components: object, offset etc.
* Depending on the object do its own logic to generate the data.
* Return the data based on its size, the requested offset and length.

Reviewers: clayborg, xiaobai, labath

Reviewed By: labath

Subscribers: mgorny, krytarowski, lldb-commits

Tags: #lldb

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

llvm-svn: 362982
2019-06-10 20:59:58 +00:00
Alex Langford e823bbe8d1 [Target] Remove Process::GetObjCLanguageRuntime
Summary:
In an effort to make Process more language agnostic, I removed
GetCPPLanguageRuntime from Process. I'm following up now with an equivalent
change for ObjC.

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

llvm-svn: 362981
2019-06-10 20:53:23 +00:00
Saleem Abdulrasool 9aff1ddc14 ABI: reflow the table text (NFC)
Reflow the text for the table to make the table legible.  This is purely
cosmetic, but makes understanding the contents of the table easier.  NFCI.

llvm-svn: 362961
2019-06-10 16:32:33 +00:00
Pavel Labath 5e173dc5ea Breakpad: Add support for the arm64e "architecture"
llvm-svn: 362960
2019-06-10 16:21:26 +00:00
Michal Gorny a984404f6b [lldb] [Process/NetBSD] Fix error handling in register operations
Ensure that errors are passed through correctly when performing
register read/write operations.  Currently, any ptrace() errors are
silently discarded and LLDB behaves as if operation was successful.

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

llvm-svn: 362946
2019-06-10 15:03:49 +00:00
Alex Langford ddcd5b0a0f [Target] Remove unused header from Process
I forgot to remove this when I removed GetCPPLanguageRuntime from
Process

llvm-svn: 362885
2019-06-08 19:07:05 +00:00
Alex Langford 056f6f1856 [LanguageRuntime] Introduce LLVM-style casts
Summary:
Using llvm-style rtti gives us stronger guarantees around casting
LanguageRuntimes.

As discussed in D62755

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

llvm-svn: 362884
2019-06-08 18:45:00 +00:00
Alex Langford 5ada887bf2 Revert "DWARF: Simplify SymbolFileDWARF::GetDWARFCompileUnit"
This reverts commit 58afc1bdebf9fa8b178d6c9d89af94c5cc091760.
This commit caused the test suite on macOS to fail many tests. It
appears that setting breakpoints is the issue. One example that fails
is the lit test Breakpoint/case-sensitive.test.

llvm-svn: 362862
2019-06-08 00:55:03 +00:00
Adrian McCarthy 4447d15aef Fix lit tests on Windows related to CR+LF
Problem discovered in the breakpoint lit test, but probably exists in others.
lldb-test splits lines on LF.  Input files that are CR+LF separated (as is
common on Windows) then resulted in commands being sent to LLDB that ended
in CR, which confused the command interpreter.

This could be fixed at different levels:

1.  Treat '\r' like a tab or space in the argument splitter.
2.  Fix the line splitters (plural) in lldb-test.
3.  Normalize the test files to LF only.

If we did only 3, I'd expect similar problems to recur, so this patch does
1 and 2.  I may also do 3 in a separate patch later, but that's tricky
because I believe we have some input files that MUST use CR+LF.

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

llvm-svn: 362844
2019-06-07 21:13:30 +00:00
Jorge Gorbe Moya 13427e64de [lldb] Fix msan use-of-uninitialized-value in DWARFDebugLine::FileNameEntry.
lldb/lit/SymbolFile/DWARF/debug-types-expressions.test fails with msan.
This change fixes the issue by ensuring FileNameEntry::checksum is
always default-initialized.

llvm-svn: 362843
2019-06-07 21:09:30 +00:00
Pavel Labath 62c905a2e6 DWARF: Simplify SymbolFileDWARF::GetDWARFCompileUnit
Summary:
The DWARFCompileUnit is set as the "user data" of the lldb compile unit
directly in the constructor (see ParseCompileUnit).

This means that instead of going through unit indexes, we can just fetch
the DWARF unit directly from there.

Reviewers: clayborg, JDevlieghere

Subscribers: aprantl, jdoerfert, lldb-commits

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

llvm-svn: 362783
2019-06-07 09:43:47 +00:00
Davide Italiano ecf3ae4a70 [NativeProcessDarwin] Remove dead code. NFCI.
llvm-svn: 362639
2019-06-05 20:23:03 +00:00
Antonio Afonso 5659b36c15 [DynamicLoader] Make sure we always set the rendezvous breakpoint
Summary:
Once we've attached to the process we load all current modules and also set a breakpoint at the rendezvous break address.
However, we don't do this if we already have a load address for the image info address (e.g.: DT_DEBUG on ELF). This code was added 4 years ago when adding support for `$qXfer:Libraries:` packet (https://reviews.llvm.org/D9471) but its intention is not 100% clear to me. It seems to me we're using that check to know if the modules have already been loaded (which they have if `$qXfer:Libraries:` is supported by the gdb server) and skip loading the modules again in the following `if` block. The problem is that we also skip setting the Rendezvous breakpoint so we stop knowing when the process loads new modules.
I fix this by moving the call to set the breakpoint to the end of the function so we always call it as long as we have a valid executable.

Reviewers: ADodds, clayborg, eugene, labath

Reviewed By: eugene, labath

Subscribers: lldb-commits

Tags: #lldb

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

llvm-svn: 362619
2019-06-05 16:22:33 +00:00
Pavel Labath da7f033693 Ignore DIEs in the skeleton unit in a DWO scenario
Summary:
r362103 exposed a bug, where we could read incorrect data if a skeleton
unit contained more than the single unit DIE. Clang emits these kinds of
units with -fsplit-dwarf-inlining (which is also the default).

Changing lldb to handle these DIEs is nontrivial, as we'd have to change
the UID encoding logic to be able to reference these DIEs, and fix up
various places which are assuming that all DIEs come from the separate
compile unit.

However, it turns out this is not necessary, as the DWO unit contains
all the information that the skeleton unit does. So, this patch just
skips parsing the extra DIEs if we have successfully found the DWO file.
This enforces the invariant that the rest of the code is already
operating under.

This patch fixes a couple of existing tests, but I've also included a
simpler test which does not depend on execution of binaries, and would
have helped us in catching this sooner.

Reviewers: clayborg, JDevlieghere, aprantl

Subscribers: probinson, dblaikie, lldb-commits

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

llvm-svn: 362586
2019-06-05 07:29:55 +00:00
Fangrui Song ff918fb487 Fix -Wsign-compare by explicit cast after r362557
llvm-svn: 362570
2019-06-05 01:49:06 +00:00
Jason Molenda c93b99589f Call abs to avoid signed/unsigned comparison warning.
llvm-svn: 362557
2019-06-04 22:46:20 +00:00
Alex Langford 29975a2a5d [Target] Remove Process::GetCPPLanguageRuntime
Summary:
I want to remove this method because I think that Process should be
language agnostic, or at least, not have knowledge about specific language
runtimes. There is "GetLanguageRuntime()" which should be used instead. If the
caller a CPPLanguageRuntime, they should cast it as needed. Ideally, this
should only happen in plugins that need C++ specific knowledge.

The next step I would like to do is remove "GetObjCLanguageRuntime()" as well.
There are a lot more instances of that function being used, so I wanted to
upload this one first to get the general reception to this idea.

Reviewers: compnerd, davide, JDevlieghere, jingham, clayborg, labath, aprantl

Subscribers: lldb-commits

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

llvm-svn: 362544
2019-06-04 20:14:33 +00:00
Alex Langford a03e2b25ab [ABI] Fix SystemV ABI to handle nested aggregate type returned in register
Add a function to flatten the nested aggregate type

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

Patch by Wanyi Ye <kusmour@gmail.com>

llvm-svn: 362543
2019-06-04 19:29:59 +00:00
James Y Knight dbb4322e51 [lldb] Fix out-of-bounds read after c3ea7c66fe
"Add support for mid-function epilogues on x86 that end in a non-local jump."

Detected by asan.

llvm-svn: 362510
2019-06-04 15:27:19 +00:00
Alex Langford b978f72058 [Target] Generalize some behavior in Target::SymbolsDidLoad
Summary:
SymbolsDidLoad is currently only implemented for ObjCLanguageRuntime,
but that doesn't mean that it couldn't be useful for other Langauges. Although
this change seems like it's generalizing for the sake of purity, this removes
Target's dependency on ObjCLanguageRuntime.

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

llvm-svn: 362461
2019-06-03 23:12:11 +00:00
Alex Langford 1f8030630b [Target] Move ObjCLanguageRuntime::LookupRuntimeSymbol into LanguageRuntime
Summary:
LookupRuntimeSymbol seems like a general LanguageRuntime method.
Although no other language runtime currently implements this, there's no
reason another language runtime couldn't use this.

Additionally, this breaks IRExecutionUnit's dependency on
ObjCLanguageRuntime.

Reviewers: compnerd, labath, JDevlieghere, davide

Subscribers: lldb-commits

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

llvm-svn: 362458
2019-06-03 22:41:48 +00:00
Jason Molenda c3ea7c66fe Add support for mid-function epilogues on x86 that end in a non-local jump.
The x86 assembly inspection engine has code to support detecting a
mid-function epilogue that ends in a RET instruction; add support for 
recognizing an epilogue that ends in a JMP, and add a check that the
unwind state has been restored to the original stack setup; reinstate
the post-prologue unwind state after this JMP instruction.

The assembly inspection engine used for other architectures, 
UnwindAssemblyInstEmulation, detects mid-function epilogues by 
tracking branch instructions within the function and "forwards"
the current unwind state to the targets of the branches.  If
an epilogue unwinds the stack and exits, followed by a branch
target, we get back to the correct unwind state.  The x86 
unwinder should move to this same algorithm, or possibly even
look at implementing an x86 instruction emulation plugin and
get UnwindAssemblyInstEmulation to work for x86 too.  I added
a branch instruction recognizier method that will be necessary
if we want to switch the algorithm.

Differential Revision: https://reviews.llvm.org/D62764
<rdar://problem/51074422> 

llvm-svn: 362456
2019-06-03 22:34:12 +00:00
Tom Tan 382320ea02 [COFF, ARM64] Fix CodeView API change for getRegisterNames
Change rL362280 changed CodeView API getRegisterNames() by adding an input
parameter in CPUType. It is called in LLDB and needs to be updated.

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

llvm-svn: 362349
2019-06-03 00:48:16 +00:00
Alex Langford fde26d222d [Commands] Remove unused header
llvm-svn: 362339
2019-06-02 21:11:21 +00:00