Commit Graph

1184 Commits

Author SHA1 Message Date
Adrian Prantl f0c08b7eac Move the Xcode SDK path caching to HostInfo
When debugging a remote platform, the platform you get from
GetPlatformForArchitecture doesn't inherit from PlatformDarwin.
HostInfoMacOSX seems like the right place to have a global store of
local paths.

Differential Revision: https://reviews.llvm.org/D79364
2020-05-06 13:43:50 -07:00
Vedant Kumar a37caebc2d [lldb/DataFormatters] Delete GetStringPrinterEscapingHelper
Summary:
Languages can have different ways of formatting special characters.
E.g. when debugging C++ code a string might look like "\b", but when
debugging Swift code the same string would look like "\u{8}".

To make this work, plugins override GetStringPrinterEscapingHelper.
However, because there's a large amount of subtly divergent work done in
each override, we end up with large amounts of duplicated code. And all
the memory smashers fixed in one copy of the logic (see D73860) don't
get fixed in the others.

IMO the GetStringPrinterEscapingHelper is overly general and hard to
use. I propose deleting it and replacing it with an EscapeStyle enum,
which can be set as needed by each plugin.

A fix for some swift-lldb memory smashers falls out fairly naturally
from this deletion (https://github.com/apple/llvm-project/pull/1046). As
the swift logic becomes really tiny, I propose moving it upstream as
part of this change. I've added unit tests to cover it.

rdar://61419673

Reviewers: JDevlieghere, davide

Subscribers: mgorny, lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D77843
2020-05-04 14:06:55 -07:00
Jonas Devlieghere bb7bde5bba Revert "[lldb/Platform] Return a std::string from GetSDKPath"
This reverts commit b14c37a29a.
2020-04-29 01:26:24 -07:00
Jonas Devlieghere b14c37a29a [lldb/Platform] Return a std::string from GetSDKPath
Nothing guarantees that the objects in the StringMap remains at the same
address when the StringMap grows. Therefore we shouldn't return a
reference into the StringMap but return a copy of the string instead.
2020-04-28 19:21:58 -07:00
Adrian Prantl 469580a967 Add missing include 2020-04-06 17:29:31 -07:00
Adrian Prantl 1e05d7b3d3 Remap the target (Xcode) SDK directory to the host SDK directory.
This is mostly useful for Swift support; it allows LLDB to substitute
a matching SDK it shipped with instead of the sysroot path that was
used at compile time.

The goal of this is to make the Xcode SDK something that behaves more
like the compiler's resource directory, as in that it ships with LLDB
rather than with the debugged program. This important primarily for
importing Swift and Clang modules in the expression evaluator, and
getting at the APINotes from the SDK in Swift.

For a cross-debugging scenario, this means you have to have an SDK for
your target installed alongside LLDB. In Xcode this will always be the
case.

rdar://problem/60640017

Differential Revision: https://reviews.llvm.org/D76471
2020-04-06 15:51:30 -07:00
Kazuaki Ishizaki e9264b746b [lldb] NFC: Fix trivial typo in comments, documents, and messages
Differential Revision: https://reviews.llvm.org/D77460
2020-04-07 01:06:16 +09:00
Raphael Isemann 203a8adb65 [lldb] Add option to retry Fix-Its multiple times to failed expressions
Summary:
Usually when Clang emits an error Fix-It it does two things. It emits the diagnostic and then it fixes the
currently generated AST to reflect the applied Fix-It. While emitting the diagnostic is easy to implement,
fixing the currently generated AST is often tricky. That causes that some Fix-Its just keep the AST as-is or
abort the parsing process entirely. Once the parser stopped, any Fix-Its for the rest of the expression are
not detected and when the user manually applies the Fix-It, the next expression will just produce a new
Fix-It.

This is often occurring with quickly made Fix-Its that are just used to bridge temporary API changes
and that often are not worth implementing a proper API fixup in addition to the diagnostic. To still
give some kind of reasonable user-experience for users that have these Fix-Its and rely on them to
fix their expressions, this patch adds the ability to retry parsing with applied Fix-Its multiple time to
give the normal Fix-It experience where things Clang knows how to fix are not causing actual expression
error (at least when automatically applying Fix-Its is activated).

The way this is implemented is just by having another setting in the expression options that specify how
often we should try applying Fix-Its and then reparse the expression. The default setting is still 1 for everyone
so this should not affect the speed in which we fail to parse expressions.

Reviewers: jingham, JDevlieghere, friss, shafik

Reviewed By: shafik

Subscribers: shafik, abidh

Differential Revision: https://reviews.llvm.org/D77214
2020-04-06 11:25:36 +02:00
Eric Christopher 3ccd454c10 Fix unused variable, format, and format string warnings.
NFC.
2020-04-03 17:58:59 -07:00
Jim Ingham 1893065d7b Allow the ThreadPlanStackMap to hold the thread plans for threads
that were not reported by the OS plugin.  To facilitate this, move
adding/updating the ThreadPlans for a Thread to the ThreadPlanStackMap.
Also move dumping thread plans there as well.

Added some tests for "thread plan list" and "thread plan discard" since
I didn't seem to have written any originally.

Differential Revision: https://reviews.llvm.org/D76814
2020-04-03 14:56:28 -07:00
Jim Ingham 61e8e6882d Move thread plan stacks into the Process, indexed by TID.
Differential Revision: https://reviews.llvm.org/D75880
2020-04-03 14:56:28 -07:00
Jim Ingham 2c1c57a1df Make ThreadPlanTracers use TID & Process rather than Thread *.
Differential Revision: https://reviews.llvm.org/D75720
2020-04-03 14:56:28 -07:00
Jim Ingham e4598dc04a Make ThreadPlans use TID and Process, rather than Thread *.
Differential Revision: https://reviews.llvm.org/D75711
2020-04-03 14:56:28 -07:00
Jim Ingham 67d67ebe8f Internal expressions shouldn't increment the result variable numbering.
There an option: EvaluateExpressionOptions::SetResultIsInternal to indicate
whether the result number should be returned to the pool or not.  It
got broken when the PersistentExpressionState was refactored.

This fixes the issue and provides a test of the behavior.

Differential Revision: https://reviews.llvm.org/D76532
2020-03-23 13:30:37 -07:00
Fred Riss b4a6e63ea1 [lldb/Target] Rework the way the inferior environment is created
Summary:
The interactions between the environment settings (`target.env-vars`,
`target.inherit-env`) and the inferior life-cycle are non-obvious
today. For example, if `target.inherit-env` is set, the `target.env-vars`
setting will be augmented with the contents of the host environment
the first time the launch environment is queried (usually at
launch). After that point, toggling `target.inherit-env` will have no
effect as there's no tracking of what comes from the host and what is
a user setting.

This patch computes the environment every time it is queried rather
than updating the contents of the `target.env-vars` property. This
means that toggling the `target.inherit-env` property later will now
have the intended effect.

This patch also adds a `target.unset-env-vars` settings that one can
use to remove variables from the launch environment. Using this, you
can inherit all but a few of the host environment.

The way the launch environment is constructed is:
  1/ if `target.inherit-env` is set, then read the host environment
  into the launch environment.
  2/ Remove for the environment the variables listed in
  `target.unset-env`.
  3/ Augment the launch environment with the contents of
  `target.env-vars`. This overrides any common values with the host
  environment.

The one functional difference here that could be seen as a regression
is that `target.env-vars` will not contain the inferior environment
after launch. The patch implements a better alternative in the
`target show-launch-environment` command which will return the
environment computed through the above rules.

Reviewers: labath, jingham

Subscribers: lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D76470
2020-03-23 07:58:34 -07:00
Fred Riss 9228a9efc6 [lldb/Target] Initialize new targets environment variables from target.env-vars
Summary:
The TargetProperties constructor invokes a series of callbacks to
prime the properties from the default ones. The one callback in
charge of updating the inferior environment was commented out
because it crashed.

The reason for the crash is that TargetProperties is a parent class
of Target and the callbacks were invoked using a Target that was
not fully initialized. This patch moves the initial callback
invocations to a separate function that can be called at the end
the Target constructor, thus preventing the crash.

One existing test had to be modified, because the initialization of
the environment properties now take place at the time the target is
created, not at the first use of the environment (usually launch
time).

The added test checks that the LaunchInfo object returned by
the target has been primed with the values from the settings.

Reviewers: jingham, labath

Subscribers: lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D76009
2020-03-23 07:58:33 -07:00
Med Ismail Bennani db31e2e1e6
[lldb/Target] Support more than 2 symbols in StackFrameRecognizer
This patch changes the way the StackFrame Recognizers match a certain
frame.

Until now, recognizers could be registered with a function
name but also an alternate symbol.
This change is motivated by a test failure for the Assert frame
recognizer on Linux. Depending the version of the libc, the abort
function (triggered by an assertion), could have more than two
signatures (i.e. `raise`, `__GI_raise` and `gsignal`).

Instead of only checking the default symbol name and the alternate one,
lldb will iterate over a list of symbols to match against.

rdar://60386577

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

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2020-03-18 14:15:58 +01:00
Tatyana Krasnukha 332edcc6bd [lldb] Remove unimplemented StackFrame::BehavesLikeZerothFrame
Commit [1] added a declaration of function-member
StackFrame::BehavesLikeZerothFrame but hasn't added an implementation
for the function. This commit removes this declation, because the
function is not used anywhere.

[1] 31e6dbe1c6 Fix PC adjustment in StackFrame::GetSymbolContext

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

Patch by Anton Kolesov <Anton.Kolesov@synopsys.com>
2020-03-16 16:20:12 +03:00
Jonas Devlieghere 638b06cf29 [lldb/Utility] Replace ProcessInstanceInfoList with std::vector. (NFCI)
Replace ProcessInstanceInfoList with std::vector<ProcessInstanceInfo>
and update the call sites.
2020-03-12 14:10:25 -07:00
Tatyana Krasnukha fe74df01a9 [lldb] Specify default value for platform.module-cache-directory
In addition to the commit rG352f16db87f583ec7f55f8028647b5fd8616111f,
this one fixes settings behavior on clearing - the setting should be
reverted to their default value, not an empty one.
2020-03-12 22:08:12 +03:00
Pavel Labath d00dff88b4 [lldb] Make UnwindLLDB a non-plugin
Summary:
This is the only real unwinder, and things have been this way for quite
a long time. At this point, the class has accumulated so many features
it is unlikely that anyone will want to reimplement the whole thing.

The class is also fairly closely coupled (through UnwindPlans and
FuncUnwinders) with a lot of other lldb components that it is hard to
imagine a different unwinder implementation being substantially
different without reimplementing all of those.

The existing unwinding functionality is nonetheless fairly complex and
there is space for adding more structure to it, but I believe a more
worthwhile effort would be to take the existing UnwindLLDB class and try
to break it down and introduce extension/customization points, instead
of writing a brand new Unwind implementation.

Reviewers: jasonmolenda, JDevlieghere, xiaobai

Subscribers: mgorny, lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D75848
2020-03-10 13:56:15 +01:00
Pavel Labath c0b1af6878 [lldb] Return Unwinder& from Thread::GetUnwinder
The function always returns a valid object. Let the return type reflect
that, and remove some null checks.
2020-03-09 14:13:22 +01:00
Tatyana Krasnukha 6c17cc531f [lldb] Make BreakpointResolver hold weak_ptr instead of raw pointer to breakpoint
This prevents calling Breakpoint::shared_from_this of an object that is not owned by any shared_ptr.

Differential Revision: https://reviews.llvm.org/D74557
2020-03-04 16:56:50 +03:00
Raphael Isemann 2affdcee61 [lldb][NFC] Fix several -Wdocumentation warnings
The GetOffset documentation was copied from the function above
so I completely deleted that one. The rest was just outdated
documentation that didn't keep up with renamed or changed
function parameters/return types.
2020-02-27 11:17:16 +01:00
Med Ismail Bennani eefda18227 [lldb/Plugins] Move SBTarget::GetExtendedCrashInformation to SBProcess
This patch moves the SB API method GetExtendedCrashInformation from
SBTarget to SBProcess since it only makes sense to call this method on a
sane process which might not be the case on a SBTarget object.

It also addresses some feedbacks received after landing the first patch
for the 'crash-info' feature.

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

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2020-02-24 23:37:04 +01:00
Med Ismail Bennani d7c403e640 [lldb/Plugins] Add ability to fetch crash information on crashed processes
Currently, in macOS, when a process crashes, lldb halts inside the
implementation disassembly without yielding any useful information.
The only way to get more information is to detach from the process, then wait
for ReportCrash to generate a report, find the report, then see what error
message was included in it. Instead of waiting for this to happen, lldb could
locate the error_string and make it available to the user.

This patch addresses this issue by enabling the user to fetch extended
crash information for crashed processes using `process status --verbose`.

Depending on the platform, this will try to gather different crash information
into an structured data dictionnary. This dictionnary is generic and extensible,
as it contains an array for each different type of crash information.

On Darwin Platforms, lldb will iterate over each of the target's images,
extract their `__crash_info` section and generated a StructuredData::Array
containing, in each entry, the module spec, its UUID, the crash messages
and the abort cause. The array will be inserted into the platform's
`m_extended_crash_info` dictionnary and `FetchExtendedCrashInformation` will
return its JSON representation like this:

```
{
  "crash-info annotations": [
    {
      "abort-cause": 0,
      "image": "/usr/lib/system/libsystem_malloc.dylib",
      "message": "main(76483,0x1000cedc0) malloc: *** error for object 0x1003040a0: pointer being freed was not allocated",
      "message2": "",
      "uuid": "5747D0C9-900D-3306-8D70-1E2EA4B7E821"
    },
    ...
  ],
  ...
}
```

This crash information can also be fetched using the SB API or lldb-rpc protocol
using SBTarget::GetExtendedCrashInformation().

rdar://37736535

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

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2020-02-21 22:44:36 +01:00
Pavel Labath b807a28787 [lldb] Merge RangeArray and RangeVector
The two classes are equivalent, except:
- the former uses a llvm::SmallVector (with a configurable size), while
  the latter uses std::vector.
- the former has a typo in one of the functions name

This patch just leaves one class, using llvm::SmallVector, and defaults
the small size to zero. This is the same thing we did with the
RangeDataVector class in D56170.
2020-02-18 15:22:55 +01:00
Tatyana Krasnukha 7fb06796ab [lldb][NFC] Remove unused parameter
Rename search-filter's CopyForBreakpoint to CreateCopy, since they don't
do anything with breakpoints.
2020-02-18 13:49:08 +03:00
Jonas Devlieghere cdc514e4c6 [lldb] Update header guards to be consistent and compliant with LLVM (NFC)
LLDB has a few different styles of header guards and they're not very
consistent because things get moved around or copy/pasted. This patch
unifies the header guards across LLDB and converts everything to match
LLVM's style.

Differential revision: https://reviews.llvm.org/D74743
2020-02-17 23:15:40 -08:00
Pavel Labath 07355c1c08 [lldb] Delete register info definitions in the x86_64 ABI classes
Summary:
These definitions are used to "augment" information received from the remote
target with eh/debug frame and "generic" register numbers.

Besides being verbose, this information was also incomplete (new registers like
xmm16-31 were missing) and sometimes even downright wrong (ymm register
numbers).

Most of this information is available via llvm's MCRegisterInfo. This patch
creates a new class, MCBasedABI, which retrieves the eh and debug frame register
numbers this way. The tricky part here is that the llvm class uses all-caps
register names, whereas lldb register are lowercase, and sometimes called
slightly differently. Therefore this class introduces some hooks to allow a
subclass to customize the MC lookup. The subclass also needs to suply the
"generic" register numbers, as this is an lldb invention.

This patch ports the x86_64 ABI classes to use the new register info mechanism.
It also creates a new "ABIx86_64" class which can be used to house code common
to x86_64 both ABIs. Right now, this just consists of a single function, but
there are plenty of other things that could be moved here too.

Reviewers: JDevlieghere, jasonmolenda

Subscribers: mgorny, lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D74244
2020-02-17 14:01:36 +01:00
Pavel Labath 12e32d32d3 [lldb] Introduce "RegInfoBasedABI"
Summary:
This patch creates a new subclass of the ABI class in order to abstract away the
mechanism in which we "augment" register information. This enables alternate
augmentation strategies to be introduced.

All existing ABI classes have been modified to inherit from RegInfoBasedABI, but
they will be refactored in subsequent patches.

Reviewers: JDevlieghere, jasonmolenda

Subscribers: sdardis, nemanjai, kbarton, jrtc27, atanasyan, jsji, lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D74243
2020-02-13 15:29:12 +01:00
Med Ismail Bennani cb0c4ee3eb [lldb/test] Add alternate symbol to StackFrame Recognizer
This reimplements commit 6b2979c123 and updates
the tests to reflect the addition of the alternate symbol attribute.

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2020-02-11 11:44:37 +01:00
Davide Italiano 6b2979c123 Revert "[lldb] Fix+re-enable Assert StackFrame Recognizer on Linux"
This reverts commit 1a39f1b966 as
it breaks macOS.
2020-02-10 13:27:35 -08:00
Jan Kratochvil 1a39f1b966 [lldb] Fix+re-enable Assert StackFrame Recognizer on Linux
D73303 was failing on Fedora Linux and so it was disabled by Skip the
AssertFrameRecognizer test for Linux.

I find no easy way how to find out if it gets recognized as
`__assert_fail` or `__GI___assert_fail` as during `Process` ctor
libc.so.6 is not yet loaded by the debuggee.

DWARF symbol `__GI___assert_fail` overrides the ELF symbol `__assert_fail`.
While external debug info (=DWARF) gets disabled for testsuite (D55859)
that sure does not apply for real world usage.

Differential Revision: https://reviews.llvm.org/D74252
2020-02-10 10:29:32 +01:00
Med Ismail Bennani 7ebe9cc4fc [lldb/Target] Add Assert StackFrame Recognizer
When a thread stops, this checks depending on the platform if the top frame is
an abort stack frame. If so, it looks for an assert stack frame in the upper
frames and set it as the most relavant frame when found.

To do so, the StackFrameRecognizer class holds a "Most Relevant Frame" and a
"cooked" stop reason description. When the thread is about to stop, it checks
if the current frame is recognized, and if so, it fetches the recognized frame's
attributes and applies them.

rdar://58528686

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

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2020-02-06 18:27:48 +01:00
Pavel Labath 98b273c893 Revert "[lldb/Target] Add Assert StackFrame Recognizer"
This reverts commit 2b7f32892b because of test
failures due to dangling pointers.
2020-02-05 15:51:38 -08:00
Med Ismail Bennani 2b7f32892b [lldb/Target] Add Assert StackFrame Recognizer
When a thread stops, this checks depending on the platform if the top frame is
an abort stack frame. If so, it looks for an assert stack frame in the upper
frames and set it as the most relavant frame when found.

To do so, the StackFrameRecognizer class holds a "Most Relevant Frame" and a
"cooked" stop reason description. When the thread is about to stop, it checks
if the current frame is recognized, and if so, it fetches the recognized frame's
attributes and applies them.

rdar://58528686

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

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2020-02-05 17:49:13 +01:00
Alex Langford 7c9ebdd3d6 [lldb] Remove clang classes from lldb-forward.h
Summary:
lldb-forward.h is convenient in many ways, but having clang-based
class forward declarations in there makes it easy to proliferate uses of clang
outside of plugins. Removing them makes you much more conscious of when
you're using something from clang and marks where we're using things
from clang in non-plugins.

Differential Revision: https://reviews.llvm.org/D73935
2020-02-04 14:23:58 -08:00
Alex Langford 2637769b9f [lldb] Remove LanguageRuntime::GetOverrideExprOptions
LanguageRuntime::GetOverrideExprOptions is specific to clang and was
only overridden in RenderScriptRuntime. LanguageRuntime in shouldn't
have any knowledge of clang, so remove it from LanguageRuntime and leave
it only in RenderScriptRuntime.
2020-01-31 22:05:23 -08:00
Benjamin Kramer adcd026838 Make llvm::StringRef to std::string conversions explicit.
This is how it should've been and brings it more in line with
std::string_view. There should be no functional change here.

This is mostly mechanical from a custom clang-tidy check, with a lot of
manual fixups. It uncovers a lot of minor inefficiencies.

This doesn't actually modify StringRef yet, I'll do that in a follow-up.
2020-01-28 23:25:25 +01:00
Alex Langford c4f6fbe971 [lldb] Remove ClangASTImporter from Target
Target is one of the classes responsible for vending ClangASTImporter.
Target doesn't need to know anything about ClangASTImporter, so if we
instead have ClangPersistentVariables vend it, we can preserve
existing behavior while improving layering and removing dependencies
from non-plugins to plugins.
2020-01-28 13:40:49 -08:00
Med Ismail Bennani 954d04295b Revert "[lldb/Target] Add Assert StackFrame Recognizer"
This reverts commit 03a6b858fd.

The test doesn't pass on Debian.
2020-01-28 18:40:08 +01:00
Med Ismail Bennani 03a6b858fd [lldb/Target] Add Assert StackFrame Recognizer
When a thread stops, this checks depending on the platform if the top frame is
an abort stack frame. If so, it looks for an assert stack frame in the upper
frames and set it as the most relavant frame when found.

To do so, the StackFrameRecognizer class holds a "Most Relevant Frame" and a
"cooked" stop reason description. When the thread is about to stop, it checks
if the current frame is recognized, and if so, it fetches the recognized frame's
attributes and applies them.

rdar://58528686

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

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2020-01-28 18:21:29 +01:00
Jim Ingham 29c7e6c8c9 Clang added a new feature to the ObjC compiler that will translate method
calls to commonly un-overridden methods into a function that checks whether
the method is overridden anywhere and if not directly dispatches to the
NSObject implementation.

That means if you do override any of these methods, "step-in" will not step
into your code, since we hit the wrapper function, which has no debug info,
and immediately step out again.

Add code to recognize these functions as "trampolines" and a thread plan that
will get us from the function to the user code, if overridden.

<rdar://problem/54404114>

Differential Revision: https://reviews.llvm.org/D73225
2020-01-23 12:41:14 -08:00
Daniel Kiss 95116c591f [lldb] Add a setting to not install the main executable
Summary:
Add setting target.auto-install-main-executable that controls whether
the main executable should be automatically installed when connected to
a remote platform even if it does not have an explicit install path
specified. The default is true as the current behaviour.

Reviewers: omjavaid, JDevlieghere, srhines, labath, clayborg

Reviewed By: clayborg

Subscribers: kevin.brodsky, lldb-commits, llvm-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D71761
2020-01-21 19:26:18 +00:00
Francesco Petrogalli 9bb11785dc Revert "[lldb] Add a setting to not install the main executable"
The commit has been reverted as it does not mention the author of the
patch.

This reverts commit 7c9bcba644.
2020-01-21 19:24:02 +00:00
Francesco Petrogalli 7c9bcba644 [lldb] Add a setting to not install the main executable
Summary:
Add setting target.auto-install-main-executable that controls whether
the main executable should be automatically installed when connected to
a remote platform even if it does not have an explicit install path
specified. The default is true as the current behaviour.

Reviewers: omjavaid, JDevlieghere, srhines, labath, clayborg

Reviewed By: clayborg

Subscribers: kevin.brodsky, lldb-commits, llvm-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D71761
2020-01-21 19:06:44 +00:00
Pavel Labath 5c4661b778 [lldb] Modernize OptionValue::SetValueChangedCallback
instead of a function pointer + void*, take a std::function. This
removes a bunch of repetitive, unsafe void* casts.
2020-01-09 14:17:17 +01:00
Jim Ingham 2a42a5a2f4 In 'thread step-out' command, only insert a breakpoint in executable memory.
Previously, if the current function had a nonstandard stack layout/ABI, and had a valid
data pointer in the location where the return address is usually located, data corruption
would occur when the breakpoint was written. This could lead to an incorrectly reported
crash or silent corruption of the program's state. Now, if the above check fails, the command safely aborts.

Differential Revision: https://reviews.llvm.org/D71372
2019-12-20 11:02:24 -08:00
Raphael Isemann ff0102b32c [lldb] Remove modern-type-lookup
Summary:
As discussed on the mailing list [1] we have to make a decision for how to proceed with the modern-type-lookup.

This patch removes modern-type-lookup from LLDB. This just removes all the code behind the modern-type-lookup
setting but it does *not* remove any code from Clang (i.e., the ExternalASTMerger and the clang-import-test stay around
for now).

The motivation for this is that I don't think that the current approach of implementing modern-type-lookup
will work out. Especially creating a completely new lookup system behind some setting that is never turned on by anyone
and then one day make one big switch to the new system seems wrong. It doesn't fit into the way LLVM is developed and has
so far made the transition work much more complicated than it has to be.

A lot of the benefits that were supposed to come with the modern-type-lookup are related to having a better organization
in the way types move across LLDB and having less dependencies on unrelated LLDB code. By just looking at the current code (mostly
the ClangASTImporter) I think we can reach the same goals by just incrementally cleaning up, documenting, refactoring
and actually testing the existing code we have.

[1] http://lists.llvm.org/pipermail/lldb-dev/2019-December/015831.html

Reviewers: shafik, martong

Subscribers: rnkovacs, christof, arphaman, JDevlieghere, usaxena95, lldb-commits, friss

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D71562
2019-12-17 12:24:31 +01:00