Commit Graph

21095 Commits

Author SHA1 Message Date
Martin Svensson 0b0dca9f6f [lldb] Fix exception breakpoint not being resolved when set on dummy target
Summary: Ensure that breakpoint ivar is properly set in exception breakpoint resolver so that exception breakpoints set on dummy targets are resolved once real targets are created and run.

Reviewers: jingham

Reviewed By: jingham

Subscribers: teemperor, JDevlieghere, lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D69880
2019-11-22 11:20:09 +01:00
Raphael Isemann b30dabfe90 [lldb] Don't enable expression log in TestEmptyStdModule.py
Thanks for pointing this out Jason!
2019-11-22 08:34:08 +01:00
Adrian Prantl bc8e88e974 Early-exitify ClangASTContext::AddObjCClassProperty() (NFC) 2019-11-21 15:41:22 -08:00
Jonas Devlieghere 6c2e4e8801 [Driver] Fix newline at the end of help output
Print a regular newline at the end of the help output. The current
string literal seems to throw off shells.
2019-11-21 13:36:39 -08:00
Jonas Devlieghere bb090bb1ca [Reproducer] Make 'reproducer xcrash' behave the same during capture & replay
There's no point in preventing this command from running during replay.
We should simulate the same crash as during capture.
2019-11-21 13:34:04 -08:00
Jonas Devlieghere b26d9e417d [Reproducer] Instruct users to replay reproducer
Improve the message printed when LLDB crashes by asking the user to
replay the reproducer before attaching it to a bugreport..

********************
Crash reproducer for lldb version 10.0.0 (git@github.com:llvm/llvm-project.git revision ...)
  clang revision ...
  llvm revision ...

Reproducer written to '/path/to/reproducer'

Before attaching the reproducer to a bug report:
 - Look at the directory to ensure you're willing to share its content.
 - Make sure the reproducer works by replaying the reproducer.

Replay the reproducer with the following command:
./bin/lldb -replay /path/to/reproducer
********************
2019-11-21 13:25:53 -08:00
Jonas Devlieghere 44fe1f024d [test] Mark TestEditline as skipped with ASan.
As discussed in https://reviews.llvm.org/D70324.
2019-11-21 13:09:40 -08:00
Jonas Devlieghere f5759d5dbc [Test] Split up TestIntegerTypes.py
The unsplit test is timing out on GreenDragon's sanitized bot. By
splitting the test we avoid this issue and increase parallelism.
2019-11-21 11:24:14 -08:00
Jonas Devlieghere bb775bee21 [Docs] Generate the LLDB man page with Sphinx
This patch replaces the existing out-of-date man page for lldb and
replaces it with an RST file from which sphinx generates the actual
troff file. This is similar to how man pages are generated for the rest
of the LLVM utilities.

The man page is generated by building the `docs-lldb-man` target.

Differential revision: https://reviews.llvm.org/D70514
2019-11-21 10:04:11 -08:00
Adrian McCarthy 3b69f0c555 [NFC] Refactor and improve comments in CommandObjectTarget
Made small improvements while debugging through
CommandObjectTarget::AddModuleSymbols.

1.  Refactored error case for an early out, reducing the indentation of
the rest of this long function.
2.  Clarified some comments by correcting spelling and punctuation.
3.  Reduced duplicate code at the end of the function.

Tested with `ninja check-lldb`

Differential Review: https://reviews.llvm.org/D70458
2019-11-21 08:37:35 -08:00
Raphael Isemann 8cf8ec40a1 [lldb][NFC] Modernize string handling in ClangExpressionDeclMap::FindExternalVisibleDecl 2019-11-21 14:59:47 +01:00
Raphael Isemann 5fb7dd8a40 [lldb][NFC] Move searching functions in ClangExpressionDeclMap to own function 2019-11-21 14:31:31 +01:00
Raphael Isemann 24e9886793 [lldb][NFC] Reduce scope of some variables in ClangExpressionDeclMap::FindExternalVisibleDecls 2019-11-21 13:43:48 +01:00
Tatyana Krasnukha ffc4ff868f [lldb][NFC] Remove test directory completely
The test was moved to "completion-in-lambda-and-unnamed-class" by D66175.

+ Fix typo in the directory name.
2019-11-21 15:03:37 +03:00
Raphael Isemann 7fa976d57a [lldb][NFC] Move searching local variables into own function 2019-11-21 12:45:38 +01:00
Raphael Isemann a0408ab7f9 [lldb][NFC] Move searching the ClangModulesDeclVendor into own function 2019-11-21 12:04:43 +01:00
Raphael Isemann 337151f41e [lldb][NFC] Move searching for the local variable namespace into own function 2019-11-21 11:03:24 +01:00
Raphael Isemann 2cada1e4da [lldb][NFC] Early exit in ClangExpressionDeclMap::FindExternalVisibleDecls 2019-11-21 10:29:50 +01:00
Jonas Devlieghere 25f33d8318 [Reproducer] Limit signals to macro define sin <csignal>
SIGBUS is not part of the signal macros defined in the header <csignal>.
2019-11-20 14:28:37 -08:00
Jason Molenda f24ed3a051 Handle the case where the 'g' packet doesn't get all regs.
lldb would silently accept a response to the 'g' packet
(read all registers) which was too large; this handles the
case where it is too small.

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

<rdar://problem/34916465>
2019-11-20 14:15:08 -08:00
Jonas Devlieghere b03374584d [Driver] Fix missing space in lldb --help output. 2019-11-20 13:49:22 -08:00
Jonas Devlieghere 0ebb7803e6 [Docs] Fix Sphinx warning (treated as error)
Fixes "undefined label" warning: if the link has no caption the label
must precede a section header.
2019-11-20 13:49:22 -08:00
Jonas Devlieghere c8dfe90729 [Reproducer] Generate LLDB reproducer on crash
This patch hooks the reproducer infrastructure with the signal handlers.
When lldb crashes with reproducers capture enabled, it will now generate
the reproducer and print a short message the standard out. This doesn't
affect the pretty stack traces, which are still printed before.

This patch also introduces a new reproducer sub-command that
intentionally raises a given signal to test the reproducer signal
handling.

Currently the signal handler is doing too much work. Instead of copying
over files into the reproducers in the signal handler, we should
re-invoke ourselves with a special command line flag that looks at the
VFS mapping and performs the copy.

This is a NO-OP when reproducers are disabled.

Differential revision: https://reviews.llvm.org/D70474
2019-11-20 13:14:16 -08:00
Davide Italiano 6f4398d1b9 [lldb] Fix NSURL data formatter truncation issue
Remove hardcoded string prefix length assumption causing issues when
concatenating summary for NSURL in NSURLSummaryProvider. Provider relies
on concatenation of NSStringProvider results for summary, and while the
strings are prefixed with '@' in Objective-C, that is not the case in
Swift causing part of the description to be truncated.

This will be tested in the downstream fork.

Patch by Martin Svensson!
2019-11-20 12:28:14 -08:00
Michał Górny 923afb4a61 [lldb] [test] Un-XFAIL one lldb-server test on NetBSD 2019-11-20 21:16:34 +01:00
Vedant Kumar af331cbe14 [debugserver] Set arch based on TARGET_TRIPLE
Use TARGET_TRIPLE instead of LLVM_DEFAULT_TARGET_TRIPLE, as the latter
isn't exported by LLVMConfig.cmake, which means arch detection fails if
lldb is built separately from llvm.
2019-11-20 12:12:47 -08:00
Raphael Isemann 51ad025ff3 [lldb][NFC] Move searching for $__lldb_objc_class into its own function
Same as in commit e7cc833dda but with $__lldb_objc_class.
2019-11-20 16:10:24 +01:00
Raphael Isemann e7cc833dda [lldb][NFC] Move searching for $__lldb_class into its own function in ClangExpressionDeclMap 2019-11-20 15:12:31 +01:00
Raphael Isemann c34478f5f6 [lldb][NFC] Move ClangExpressionDeclMap's persistent decl search into its own function
Searching persistent decls is a small subset of the things
FindExternalVisibleDecls does. It should be its own function instead
of being encapsulated in this `do { } while(false);` pattern.
2019-11-20 14:17:35 +01:00
Raphael Isemann 54b86b010b [lldb][NFC] Remove unused ClangASTContext::GetUnknownAnyType 2019-11-20 13:07:43 +01:00
Raphael Isemann c502bae524 [lldb][NFC] Simplify ClangASTContext::GetBasicTypes
static convenience methods that do the clang::ASTContext -> ClangASTContext
conversion and handle errors by simply ignoring them are not a good idea.
2019-11-20 12:47:14 +01:00
Raphael Isemann 82800df4de [lldb][NFC] Remove ClangASTContext::GetAsDeclContext
Everything we pass to this function is already a DeclContext.
2019-11-20 12:28:16 +01:00
Raphael Isemann 02e9113665 [lldb][NFC] Remove ClangASTContext::FieldIsBitfield overload 2019-11-20 12:15:25 +01:00
Raphael Isemann 6640f2e7d4 [lldb][NFC] Remove ClangASTContext::GetUniqueNamespaceDeclaration overload
This overload is only used in one place and having static overloads for
all methods that only do an additional clang::ASTContext -> ClangASTContext
conversion is just not sustainable.
2019-11-20 12:02:38 +01:00
Djordje Todorovic ce1f95a6e0 Reland "[clang] Remove the DIFlagArgumentNotModified debug info flag"
It turns out that the ExprMutationAnalyzer can be very slow when AST
gets huge in some cases. The idea is to move this analysis to the LLVM
back-end level (more precisely, in the LiveDebugValues pass). The new
approach will remove the performance regression, simplify the
implementation and give us front-end independent implementation.

Differential Revision: https://reviews.llvm.org/D68206
2019-11-20 10:08:07 +01:00
Jonas Devlieghere 36eea5c31f [Reproducer] Namespace the reproducer dump options.
Make it clear that the current reproducer options are for dumping.
2019-11-19 16:19:43 -08:00
Jordan Rupprecht 327a18ca0a [lldb][test] Prevent \n in calls to lldb's expect() test helper.
Summary:
expect() forwards its command to sendline(). This can be problematic if the command already contains a newline: sendline() unconditionally adds a newline to the command, which causes the command to run twice (hitting enter in lldb runs the previous command). The expect() helper looks for the prompt and finds the first one, but because the command has run a second time, the buffer will contain the contents of the second time the command ran, causing potential erroneous matching.

Simplify the editline test, which was using different commands to workaround this misunderstanding.

Reviewers: labath

Reviewed By: labath

Subscribers: merge_guards_bot, lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D70324
2019-11-19 15:17:35 -08:00
Adrian Prantl 77f8a3324b Add a "Using LLDB" section to the welcome page of the website
This is an attempt to feature the user-facing resources more
prominently on the LLDB website by calling out the tutorial and the
GDB command map wight on the start page.

I also moved the "Why a new debugger" section to the "Goals"
subpage. Given that LLDB's first release is almost a decade in the
past now, the title is a bit of an anachronism.

Lastly, I moved the Architecture sub-page from "use" to "resources",
since end-users do not care about the source code layout.

Differential Revision: https://reviews.llvm.org/D70449
2019-11-19 10:55:50 -08:00
Jonas Devlieghere b117ec8be0 [LLDB] Fix formatting in the driver (NFC) 2019-11-19 10:23:56 -08:00
Raphael Isemann 4a6d03ad0e [lldb] Add logging to IRExecutionUnit::GetStaticInitializers 2019-11-19 15:52:01 +01:00
Raphael Isemann c54d21c848 [lldb][NFC] Early exit in IRExecutionUnit::GetStaticInitializers 2019-11-19 15:06:30 +01:00
Raphael Isemann f6ffe6fc9d [lldb] Also test Get[De]mangledName of SBType in TestSBTypeClassMembers.py
I just used the mangled names as this test is anyway a Darwin-only ObjC++ test.
We probably should also test this on other platforms but that will be
another commit as we need to untangle the ObjC and C++ parts first.
2019-11-19 14:04:02 +01:00
Raphael Isemann 96d814a5fe [lldb] Remove ClangExpressionDeclMap::ResolveUnknownTypes
Summary:
This is some really shady code. It's supposed to kick in after an expression already failed and then try to look
up "unknown types" that for some undocumented reason can't be resolved during/before parsing. Beside the
fact that we never mark any type as `EVUnknownType` in either swift-lldb or lldb (which means this code is unreachable),
this code doesn't even make the expression evaluation succeed if if would ever be executed but instead seems
to try to load more debug info that maybe any following expression evaluations might succeed.

This patch removes ClangExpressionDeclMap::ResolveUnknownTypes and the related data structures/checks/calls.

Reviewers: davide

Reviewed By: davide

Subscribers: aprantl, abidh, JDevlieghere, lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D70388
2019-11-19 12:44:27 +01:00
Diana Picus bb7c8e984f Mark PR44037 tests as XFAIL on AArch64 Linux dwo
These tests are failing with various assertion failures, but they all
throw the following error message first:

error: a.out 0x0000002d: adding range [0x14-0x24) which has a base that
is less than the function's low PC 0x40060c.

See llvm.org/pr44037.

Differential Revision: https://reviews.llvm.org/D70381
2019-11-19 10:49:00 +01:00
Martin Storsjö 926d283893 [lldb-server] Use LLDB_LOG_ERROR to consume Error<> even if logging is disabled
Differential Revision: https://reviews.llvm.org/D70386
2019-11-19 09:12:50 +02:00
Jonas Devlieghere a921f587f7 Revert "[CMake] Re-enable -Wno-gnu-anonymous-struct & -Wno-nested-anon-types."
Whoops, they should be enabled, not disabled.
2019-11-18 17:00:35 -08:00
Jonas Devlieghere 755afc0af8 [CMake] Re-enable -Wno-gnu-anonymous-struct & -Wno-nested-anon-types.
We're checking for support but we're discarding the result. My best
guess is that these warnings were disabled in the past. However, I don't
see a reason to keep it that way.
2019-11-18 16:58:40 -08:00
Jonas Devlieghere f19ea6ea5f [Docs] Add reproducer documentation
This adds a page about LLDB reproducers. It describes how to use the
reproducers on the command line and lists some of the known
issues/limitations.

Differential revision: https://reviews.llvm.org/D70409
2019-11-18 16:03:06 -08:00
Michał Górny 0854867798 [lldb] [test] XFAIL more lldb-server tests on NetBSD 2019-11-18 22:36:04 +01:00
Michał Górny 4539a2d20c [lldb] [test] Mark segv-related tests XFAIL on NetBSD
There seems to be a regression in the kernel causing those tests
to fail.  Mark them XFAIL, to be addressed later.
2019-11-18 22:36:03 +01:00