Commit Graph

22887 Commits

Author SHA1 Message Date
Jonas Devlieghere 6e3faaeb44 [lldb/Lua] Remove redundant variable (NFC) 2020-06-20 23:28:22 -07:00
Jonas Devlieghere e13fca4fac [lldb] Remove unused <iostream> includes (NFC) 2020-06-20 22:38:45 -07:00
Eric Christopher 10b4354136 Temporarily Revert "[lldb][NFC] Add more test for builtin formats"
as it's failing on the debian buildbots:

http://lab.llvm.org:8011/builders/lldb-x86_64-debian/builds/12531

This reverts commit 90c1af106a.
2020-06-20 14:21:42 -07:00
Raphael Isemann 90c1af106a [lldb][NFC] Add more test for builtin formats
The previous tests apparently missed a few code branches in DumpDataExtractor
code. Also renames the 'test_instruction' which had the same name as another
test (and Python therefore ignored the test entirely).
2020-06-20 19:31:40 +02:00
Raphael Isemann ab888262b3 [lldb] Skip TestBuiltinFormats.py on arm for now 2020-06-20 11:22:44 +02:00
Jonas Devlieghere 8027f04a6d [lldb/Test] Disable TestBuiltinFormats.py on Windows
Disable the test to turn the Windows bot green again until Raphael has
time to investigate.
2020-06-19 22:41:29 -07:00
Jonas Devlieghere 7a9a341953 [lldb/Test] Temporarily skip watch simulator in TestSimulatorPlatform.py
The simulator doesn't launch on green-dragon-10.

rdar://problem/64552748
2020-06-19 22:41:29 -07:00
Eric Christopher 2db1d75396 As part of using inclusive language within the llvm project,
migrate away from the use of blacklist and whitelist.
2020-06-19 14:51:04 -07:00
Eric Christopher efb328f674 As part of using inclusive language with the llvm project,
migrate away from the use of blacklist and whitelist.
2020-06-19 14:48:48 -07:00
Raphael Isemann aa7cd42993 [lldb][NFC] Add test for builtin formats 2020-06-19 22:33:02 +02:00
Jonas Devlieghere 827c012297 [lldb] Replace calls to new with std::make_shared<> (NFC) 2020-06-19 11:20:15 -07:00
Raphael Isemann f5eaa2afe2 [lldb] Replace std::isprint/isspace with llvm's locale-independent version
Summary:
LLVM is using its own isPrint/isSpace implementation that doesn't change depending on the current locale. LLDB should do the same
to prevent that internal logic changes depending on the set locale.

Reviewers: JDevlieghere, labath, mib, totally_not_teemperor

Reviewed By: JDevlieghere

Differential Revision: https://reviews.llvm.org/D82175
2020-06-19 19:17:56 +02:00
Raphael Isemann 8340fbb9c7 [lldb] Reactivate Objective-C++ plugin
Summary:
Since commit 7b3ef05a37 the Objective-C++ plugin is dead code.
That commit added Objective-C++ to the list of languages for which `Language::LanguageIsCPlusPlus`
returns true. As the C++ language plugin also uses that method to figure out if it is responsible for a
given language, the C++ plugin since then also became the plugin that we found when looking for
a language plugin for Objective-C++. The only real fallout from that is that the source highlighting
for Objective-C++ files never worked as we always found the C++ plugin which refuses to highlight
files with Objective-C++ extensions.

This patch just adds a special exception for Objective-C++ to the list of languages that are governed
by the C++ plugin. Also adds a test that makes sure that we find the right plugin for all C language
types and that the highlighting for `.mm` (Objective-C++) and `.m` (Objective-C) files works.

I didn't revert 7b3ef05a37 as it does make sense to return
true for Objective-C++ from `Language::LanguageIsCPlusPlus` (e.g., we currently check if we care about
ODR violations by doing `if (Language::LanguageIsCPlusPlus(...))` and this should also work for
Objective-C++).

Fixes rdar://64420183

Reviewers: aprantl

Reviewed By: aprantl

Subscribers: mgorny, abidh, JDevlieghere

Differential Revision: https://reviews.llvm.org/D82109
2020-06-19 19:16:46 +02:00
Raphael Isemann be18df3d23 [lldb] Fix that SIGWINCH crashes IOHandlerEditline when we are not using the editline backend
Summary:
TerminalSizeChanged is called from our SIGWINCH signal handler but the
IOHandlerEditline currently doesn't check if we are actually using the real
editline backend. If we're not using the real editline backend, `m_editline_up`
won't be set and `IOHandlerEditline::TerminalSizeChanged` will access
the empty unique_ptr. In a real use case we don't use the editline backend
when we for example read input from a file. We also create some temporary
IOHandlerEditline's during LLDB startup it seems that are also treated
as non-interactive (apparently to read startup commands).

This patch just adds a nullptr check for`m_editline_up` as we do in the rest of
IOHandlerEditline.

Fixes rdar://problem/63921950

Reviewers: labath, friss

Reviewed By: friss

Subscribers: abidh, JDevlieghere

Differential Revision: https://reviews.llvm.org/D81729
2020-06-19 19:14:16 +02:00
Adrian Prantl 7e825abd57 Repair support for launching ios/tv/watch simulator binaries through platform
and delete a bunch (but not all) redundant code. If you compare the remaining implementations of Platform*Simulator.cpp, there is still an obvious leftover cleanup task.

Specifically, this patch

- removes SDK initialization from dotest (there is equivalent but more
  complete code in Makefile.rules)

- make Platform*Simulator inherit the generic implementation of
  PlatformAppleSimulator (more can be done here)

- simplify the platform logic in Makefile.rules

- replace the custom SDK finding logic in Platform*Simulator with XcodeSDK

- adds a test for each supported simulator

Differential Revision: https://reviews.llvm.org/D81980
2020-06-19 09:42:44 -07:00
Raphael Isemann 6331c7d0be [lldb] Disable complex tests on Windows
The tests fail to compile there:
```
complex/main.c:4:16: error: expected ';' at end of declaration
  float complex complex_float = -1.5f + -2.5f * I;
               ^
               ;
```
2020-06-19 18:40:08 +02:00
Raphael Isemann 85e7e3b1c9 [lldb] Fix TestComplexInt on ARM
On the buildbot long and int have the same size but long and long long don't,
so the bug where we find the first type by size will produce a different error.
Make the test dynamic based on int/long/long long size to fix the bot.
2020-06-19 17:47:16 +02:00
Raphael Isemann 1e8e1ec00c [lldb][NFC] Remove unused DEPTH_INCREMENT in CompilerType.cpp 2020-06-19 16:35:03 +02:00
Raphael Isemann 3e66bd291f [lldb][NFC] Add test for C99 and GCC complex types
LLDB has a lot of code for supporting complex types but we don't have a single
test for it. This adds some basic tests and documents the found bugs.
2020-06-19 16:22:16 +02:00
Derek Schuff c1709e5d90 Set appropriate host defines for building under emscripten
Emscripten has emulations for several headers found on Linux,
including spwan.h and endian.h

Differential Revision: https://reviews.llvm.org/D82121
2020-06-18 17:00:53 -07:00
Eric Christopher 50939c0a67 Add SveBFloat16 to type switch. 2020-06-18 12:39:03 -07:00
Muhammad Omair Javaid 6c45532908 Remove code duplication from RegisterContextPOSIX_*
Summary:
This patch aims to remove multiple copies of GetByteOrder() and ConvertRegisterKindToRegisterNumber used in various versions of RegisterContextPOSIX_*.

Both register implementations are move to RegisterContext class which is parent of RegisterContextPOSIX_* classes.

Built and tested on x86_64-linux-gnu, aarch64-linux-gnu and arm-linux-gnueabihf targets.

Reviewers: labath

Reviewed By: labath

Subscribers: wuzish, nemanjai, kristof.beyls, kbarton, atanasyan, lldb-commits

Differential Revision: https://reviews.llvm.org/D80104
2020-06-18 01:02:46 +05:00
Jonas Devlieghere 64c87a94ca [lldb/Test] Fix tests that rely on logfiles with reproducers.
Now that the log file is included in the reproducers, the path needs to
be remapped for the test to find the new file in the reproducer.
2020-06-17 10:09:06 -07:00
Muhammad Omair Javaid e29b31513f [lldb] Remove xfail aarch64/linux from TestBuiltinTrap.py
The underlying clang bug seems to have been fixed in and test is
consistently passing on aarch64-linux buildbot.
2020-06-17 15:48:59 +05:00
Jonas Devlieghere c151230533 [lldb/Test] Cleanup TestJITLoaderGDB and make it compatible with reproducers 2020-06-16 15:46:14 -07:00
Jonas Devlieghere c0f1dcf31e [lldb/Test] Pass the lldb_tool_dir when setting the lldb-repro substitutions
Otherwise LIT can't find the lldb-repro script in standalone builds.
2020-06-16 13:56:16 -07:00
Jonas Devlieghere 4dd3dfe8e3 [lldb/Python] Fix the infinitely looping Python prompt bug
Executing commands below will get you bombarded by a wall of Python
command prompts (>>> ).

$ echo 'foo' | ./bin/lldb -o script
$ cat /tmp/script
script
print("foo")
$ lldb --source /tmp/script

The issue is that our custom input reader doesn't handle EOF. According
to the Python documentation, file.readline always includes a trailing
newline character unless the file ends with an incomplete line. An empty
string signals EOF. This patch raises an EOFError when that happens.

[1] https://docs.python.org/2/library/stdtypes.html#file.readline

Differential revision: https://reviews.llvm.org/D81898
2020-06-16 11:05:19 -07:00
Jonas Devlieghere e4a84590e8 [lldb/Test] Create dir if it doesn't yet exist in getReproducerArtifact
The type test use this method to store the golden output. This currently
fails if the reproducer directory hasn't yet been created.
2020-06-16 09:46:48 -07:00
Jonas Devlieghere 388afd8406 [lldb] Remove redundant access specifiers (NFC) 2020-06-15 21:34:13 -07:00
Jonas Devlieghere 5ddd4fc5a6 [lldb/Lua] Fix override/virtual in ScriptInterpreterLua (NFC) 2020-06-15 21:15:35 -07:00
Jonas Devlieghere 93571c3c3b [lldb/Python] Various cleanups in ScriptInterpreterPython (NFC) 2020-06-15 21:07:43 -07:00
Jonas Devlieghere 8d2acfc40e [lldb/Interpreter] Use std::make_shared<StreamString> (NFC) 2020-06-15 20:48:55 -07:00
Jonas Devlieghere 18e356b75d [lldb/Docs] Reword paragraph and omit 'build slave' 2020-06-15 18:25:57 -07:00
Jonas Devlieghere 0965b59bf4 [lldb/debugserver] Rename Master/Slave to Primary/Secondary (NFC) 2020-06-15 18:22:22 -07:00
Jason Molenda 480a383551 Upstream two performance monitor collectors to MachTask
Add two more perf monitors to MachTask::GetProfileData.

<rdar://problem/63984105>
2020-06-15 16:37:56 -07:00
Jonas Devlieghere 64ec505dd4 [lldb] Rename Master/Slave to Primary/Secondary (NFC) 2020-06-15 15:38:28 -07:00
Jonas Devlieghere d74323606d [lldb] Remove indentation before help output.
This patch remove the indentation before the command help output.
Supposedly it was meant to be aligned with the different subcommands.

Differential revision: https://reviews.llvm.org/D81783
2020-06-15 09:27:17 -07:00
Kirill Bobyrev 2d8f8c4de3
[lldb] Handle all Clang::Type::Builtin enums
Cleanup after https://reviews.llvm.org/D81459
2020-06-15 10:18:59 +02:00
Xing GUO 8a2ff19272 [lldb][test] Trying to fix build bot after 0431e4bcb2 2020-06-13 23:53:13 +08:00
Xing GUO 0431e4bcb2 Recommit "[DWARFYAML][debug_line] Replace `InitialLength` with `Format` and `Length`."
This recommits fcc0c186e9
2020-06-13 23:39:11 +08:00
Jonas Devlieghere ff058e7331 [lldb] Remove unnecessary c_str() in OutputFormattedHelpText calls (NFC) 2020-06-12 21:13:21 -07:00
Jonas Devlieghere 58e34ede5b [lldb] Small improvements in ValueObjectPrinter::PrintDecl (NFC)
Remove unused argument, simply code and reformat.
2020-06-12 21:05:05 -07:00
Jonas Devlieghere da601ea731 [lldb/Test] Assert that no targets or modules remain after a test completes.
The reproducer intentionally leak every object allocated during replay,
which means that modules never get orphaned. If this were to happen for
another reason, we might not be testing what we think we are. Assert
that there are no targets left at the end of a test and that the global
module cache is empty in the non-reproducer scenario.

Differential revision: https://reviews.llvm.org/D81612
2020-06-12 15:17:44 -07:00
Jonas Devlieghere 8f9eb70353 [lldb/Test] Fix unit test suffixes and add a CMake error.
Lit will only look for unittest targets ending in `Tests`. Add an error
when the target doesn't have the `Tests` suffix.
2020-06-12 14:18:27 -07:00
Jonas Devlieghere bfea1df9f0 [lldb/Test] Fix unittest name
Lit looks for the Tests prefix in the unit test name.
2020-06-12 14:01:14 -07:00
Jonas Devlieghere 2b34632a57 [lldb/SymbolFile] Don't parse the whole line table for the support files
Prior to my patch of using the LLVM line table parsing code,
SymbolFileDWARF::ParseSupportFiles would only parse the line table
prologues to get the file list for any files that could be in the line
table.

With the old behavior, if we found the file that someone is setting the
breakpoint in in the support files list, we would get a valid index. If
we didn't, we would not look any further. So someone sets a breakpoint
one "MyFile.cpp:12" and if we find "MyFile.cpp" in the support file list
for the compile unit, then and only then would we get the entire line
table for that compile unit.

With the current behavior, no matter what, we always fully parse the
line table for all compile units any time any file and line breakpoint
is set. This creates a serious problem when debugging a large DWARF in
.o file project.

This patch re-instates the old behavior. Unfortunately it means we might
end up parsing to prologue twice, but I don't think that outweighs the
cost of trying to cache/reuse it.

Differential revision: https://reviews.llvm.org/D81589
2020-06-12 09:39:17 -07:00
Raphael Isemann a8c755545b [lldb] Test creating persistent variables with $[digit] names 2020-06-12 16:12:33 +02:00
Raphael Isemann f52e4129a7 [lldb][NFC] Modernize TestPersistentVariables 2020-06-12 16:06:05 +02:00
Raphael Isemann 91728b9172 [lldb] Don't print IRForTarget errors directly to the console
Summary:

When we get an error back from IRForTarget we directly print that error to the
debugger output stream instead of putting it in the result object. The result
object only gets a vague "The expression could not be prepared to run in the
target" error message that doesn't actually tell the user what went wrong.

This patch just puts the IRForTarget errors into the status object that is
returned to the caller instead of directly printing it to the debugger. Also
updates one test that now can actually check for the error message it is
supposed to check for (instead of the default error which is all we had before).

Reviewers: JDevlieghere

Reviewed By: JDevlieghere

Differential Revision: https://reviews.llvm.org/D81654
2020-06-12 10:27:25 +02:00
Jonas Devlieghere 526e0c8d15 [lldb/Test] Fix ASan/TSan workaround for Xcode Python 3
The Python 3 interpreter in Xcode has a relative RPATH and dyld fails to
load it when we copy it into the build directory.

This patch adds an additional check that the copied binary can be
executed. If it doesn't, we assume we're dealing with the Xcode python
interpreter and return the path to the real executable. That is
sufficient for the sanitizers because only system binaries need to be
copied to work around SIP.

This patch also moves all that logic out of LLDBTest and into the lit
configuration so that it's executed only once per test run, instead of
once for every test. Although I didn't benchmark the difference this
should result in a mild speedup.

Differential revision: https://reviews.llvm.org/D81696
2020-06-11 19:36:42 -07:00