Commit Graph

18347 Commits

Author SHA1 Message Date
Adrian Prantl 36a03526e9 Fix REQUIRES line
llvm-svn: 349533
2018-12-18 20:28:54 +00:00
Pavel Labath 0d38e4fd2c ELF: Don't create sections for section header index 0
Summary:
The first section header does not define a real section. Instead it is
used for various elf extensions. This patch skips creation of a section
for index 0.

This has one furtunate side-effect, in that it allows us to use the section
header index as the Section ID (where 0 is also invalid). This way, we
can get rid of a lot of spurious +1s in the ObjectFileELF code.

Reviewers: clayborg, krytarowski, joerg, espindola

Subscribers: emaste, lldb-commits, arichardson

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

llvm-svn: 349498
2018-12-18 15:56:45 +00:00
Pavel Labath 56279cf24f Fix the "dangerous use of tempnam" warning in Host/SocketTest.cpp
instead, create a unique temporary directory, and place the socket file
there.

llvm-svn: 349495
2018-12-18 15:33:50 +00:00
Pavel Labath ef4d4f543a de-flake TestThreadStates.test_process_interrupt
the "self.assertEqual(thread.GetStopReason(), lldb.eStopReasonSignal)"
was occasionally failing because the stop reason would come out as
"trace" this happened if we issued the interrupt just as the processed
stopped due to single-stepping over the breakpoint (i.e., the it was not
necessary to send any signal).

Fix this by removing the breakpoint before resuming the process. This
ensures the process can run unobstructed.

After this, the test passed 200 consecutive runs successfully for me,
even while the system was under heavy load.

llvm-svn: 349491
2018-12-18 15:15:02 +00:00
Pavel Labath b4b7c148e3 Skip TestMultithreaded.test_sb_api_listener_resume on linux
The test still fails occasionally (1/100 runs). Upgrade the xfail to
skip.

llvm-svn: 349487
2018-12-18 14:24:55 +00:00
Pavel Labath 2ba9dad66d Un-XFail TestYMMRegister on linux
This test was disabled in r326756 as a part of "upstreaming debugserver
support for AVX-512 (zmm register set)". This looks like an error
because both register set and remote stubs are different.

In any case, the test passes now.

llvm-svn: 349485
2018-12-18 13:50:38 +00:00
Pavel Labath e0d47ca107 Un-XFail TestThreadStates.test_process_interrupt
This test is passing now on linux. The same test is claimed to be flaky
on darwin, so it's possible that's true on linux too. If that's the case
we'll have to skip it here too (or fix it).

I mark the test as not-debug-info-dependent as a drive-by.

llvm-svn: 349482
2018-12-18 13:32:42 +00:00
Pavel Labath 56168f0dbb Un-XFAIL TestExitDuringBreak.py for linux
This test is passing now on linux, and probably has been passing since
r282993.

llvm-svn: 349479
2018-12-18 13:12:36 +00:00
Pavel Labath 7f03203142 Un-XFAIL TestNamespaceLookup for linux
These tests are now passing on linux, at least with top-of-tree clang,
clang-6 and gcc-7.3. It's possible it may still be failing with some
older compilers, but I don't have those around to test.

llvm-svn: 349478
2018-12-18 12:55:30 +00:00
Luke Cheeseman 307839cca9 Fix typo in r349473
llvm-svn: 349474
2018-12-18 11:05:43 +00:00
Luke Cheeseman 9f236d85d9 Update CallFrameString API to account for r349472
- CallFrameString now takes an Arch parameter to account for multiplexing
  overlapping CFI directives

llvm-svn: 349473
2018-12-18 10:39:19 +00:00
Pavel Labath 784539458f build.py: inherit environment in the gcc builder
Summary:
This should enable the compiler to find the system linker for the link
step.

Reviewers: stella.stamenova, zturner

Subscribers: lldb-commits

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

llvm-svn: 349461
2018-12-18 09:07:21 +00:00
Jim Ingham 362d022d60 Call DeleteCurrentProcess before we replace the old process.
We need to ensure that Finalize gets called before we start
to destroy the old Process or the weak_ptr->shared_ptr link
from Threads to Target gets broken before the threads are 
destroyed.

<rdar://problem/43586979>

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

llvm-svn: 349435
2018-12-18 01:49:02 +00:00
Greg Clayton 48a28c1665 Add "dump" command as a custom "process plugin" subcommand when ProcessMinidump is used.
Each process plug-in can create its own custom commands. I figured it would be nice to be able to dump things from the minidump file from the lldb command line, so I added the start of the some custom commands.

Currently you can dump:

minidump stream directory
all linux specifc streams, most of which are strings
each linux stream individually if desired, or all with --linux
The idea is we can expand the command set to dump more things, search for data in the core file, and much more. This patch gets us started.

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

llvm-svn: 349429
2018-12-18 00:50:11 +00:00
Jason Molenda f47c734e49 A few small updates to the testsuite for running against an iOS device.
Remove the expected-fails for 34538611; using an alternate platform
implementation handles these correctly.

llvm-svn: 349417
2018-12-17 23:33:40 +00:00
Jason Molenda 28330b9cc0 Document the DBGSourcePathRemapping dictionary that may be
present in the dSYM per-uuid plist, its precedence order with
the older DBGBuildSourcePath/DBGSourcePath, and note that
must be present and have a value of 3 or the dictionary
will be ignored.
<rdar://problem/46421686> 

llvm-svn: 349409
2018-12-17 22:25:54 +00:00
Jason Molenda a305151c40 Add PdbAstBuilder.cpp.
llvm-svn: 349406
2018-12-17 22:07:39 +00:00
Jonas Devlieghere cba1b00c42 [lit] Detect unexpected passes in lldbtest.
This patch will have lit report unexpected passes when dotest reports at
least one XPASS and no failures.

llvm-svn: 349401
2018-12-17 21:40:37 +00:00
Zachary Turner b6bc1c5ba3 Fix case of source file in CMakeLists.txt
llvm-svn: 349399
2018-12-17 21:33:08 +00:00
Adrian Prantl 5a5b49060d Reflow readme
llvm-svn: 349398
2018-12-17 21:18:12 +00:00
Adrian Prantl 4cf98e2c7b Remove sleep() synchronisation from teststcase and
make the executable name more unique.

This test is failing sporadically on some bots. By removing the sleep
synchronisation, I'm hoping to get it to fail more reproducibly so I
can investigate what is going on.

llvm-svn: 349397
2018-12-17 21:18:11 +00:00
Zachary Turner 594c85e95f [NativePDB] Decouple AST reconstruction from lldb Symbol creation.
Previously the code that parsed debug info to create lldb's Symbol
objects such as Variable, Type, Function, etc was tightly coupled
to the AST reconstruction code.  This made it difficult / impossible
to implement functions such as ParseDeclsForContext() that were only
supposed to be operating on clang AST's.  By splitting these apart,
the logic becomes much cleaner and we have a clear separation of
responsibilities.

llvm-svn: 349383
2018-12-17 19:43:33 +00:00
Davide Italiano e1f760d5de Fix lldb's macosx/heap.py cstr command.
<rdar://problem/44432167>

llvm-svn: 349372
2018-12-17 18:21:51 +00:00
Jonas Devlieghere 7e89627728 [Driver] Fix --repl argument.
The --repl option was incorrectly defined as "Separate" (option and
value separated by a space). This resulted in the option not being
picked up when no value was specified.

This patch fixes the driver so that `--repl` is recognized again. I
split the option into two:

 - A flag: `--repl` and `-r` which take no arguments.
 - A joined option: `--repl=<flags>` and `-r=<flags>` that forward its
   values to the repl.

This should match the driver's old behavior.

llvm-svn: 349371
2018-12-17 18:11:48 +00:00
Adrian Prantl f700c8b253 Make crashlog.py work or binaries with spaces in their names
This is a little dangerous since the crashlog files aren't 100%
unambiguous, but the risk is mitigated by using a non-greedy +?
pattern.

rdar://problem/38478511

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

llvm-svn: 349367
2018-12-17 17:26:04 +00:00
Adrian Prantl fb5aa932b1 Make crashlog.py work when a .dSYM is present, but a binary is missing
Often users have a crash log an d a .dSYM bundle, but not the original
application binary. It turns out that for crash symbolication, we can
safely fall back to using the binary inside the .dSYM bundle.

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

llvm-svn: 349366
2018-12-17 17:25:57 +00:00
Zachary Turner 1639c6bbb1 [Clang AST Context] Add a few helper functions.
The first one allows us to add an enumerator to an enum if we
already have an APSInt, since ultimately the implementation just
constructs one anyway.  The second is just a general utility
function to covert a CompilerType to a clang::TagDecl.

llvm-svn: 349360
2018-12-17 16:15:13 +00:00
Jason Molenda c14a6ae4a7 Add a description of the similar packets defined in the
gdb-remote serial protocol documentation, call out the 
incompatability of lldb's vFile:open: packet as it stands
today.  Need to think about whether to change lldb's
enum values (breaking any existing lldb-server's out there)
or create a different packet and abandon vFile:open: at
least for a while.

llvm-svn: 349316
2018-12-16 18:44:54 +00:00
Jason Molenda 65b60ba8b2 Clarify a few minor details.
llvm-svn: 349313
2018-12-16 18:33:58 +00:00
Jason Molenda fbdb8b2e1c Update the vFile:open: description to note that the flags
in the packet are lldb enum values, not the open(2) oflags -- 
forgot about that wrinkle.  Also added a comment to File.h 
noting that the existing values cannot be modified or we'll
have a compatibilty break with any alternative platform
implementations, or older versions of lldb-server.

llvm-svn: 349282
2018-12-15 18:40:38 +00:00
Pavel Labath d211d1a59c lldb-test: Improve newline handling
Summary:
Previously lldb-test's LinePrinter would output the indentation spaces
even on completely empty lines. This is not nice, as trailing spaces get
flagged as errors in some tools/editors, and it prevents FileCheck's
CHECK-EMPTY from working.

Equally annoying was the fact that the LinePrinter did not terminate
it's output with a newline (instead it would leave the unterminated hanging
indent from the last NewLine() command), which meant that the shell prompt
following the lldb-test command came out wrong.

This fixes both issues by changing how newlines are handled. NewLine(),
which was ending the previous line ('\n') *and* begging the next line by
printing the indent, is now "demoted" to just printing literal "\n".
Instead, lines are now delimited via a helper Line object, which makes
sure the line is indented and terminated in an RAII fashion. The typical
usage would be:
Printer.line() << "This text will be indented and terminated";
If one needs to do more work than it will fit into a single statement,
one can also assign the result of the line() function to a local
variable. The line will then be terminated when that object goes out of
scope.

Reviewers: zturner

Subscribers: lldb-commits

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

llvm-svn: 349269
2018-12-15 13:49:25 +00:00
Pavel Labath 62a8254f29 ELF: more section creation cleanup
Summary:
This patch attempts to move as much code as possible out of the
CreateSections function to make room for future improvements there. Some
of this may be slightly over-engineered (VMAddressProvider), but I
wanted to keep the logic of this function very simple, because once I
start taking segment headers into acount (as discussed in D55356), the
function is going to grow significantly.

While in there, I also added tests for various bits of functionality.

This should be NFC, except that I changed the order of hac^H^Heuristicks
for determining section type slightly. Previously, name-based deduction
(.symtab -> symtab) would take precedence over type-based (SHT_SYMTAB ->
symtab) one. In fact we would assert if we ran into a .text section with
type SHT_SYMTAB. Though unlikely to matter in practice, this order
seemed wrong to me, so I have inverted it.

Reviewers: clayborg, krytarowski, espindola

Subscribers: emaste, arichardson, lldb-commits

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

llvm-svn: 349268
2018-12-15 13:45:38 +00:00
Pavel Labath c8e364e80d Remove /proc/pid/maps parsing code from NativeProcessLinux
A utility function doing this was added in r349182, so use that instead.

llvm-svn: 349267
2018-12-15 13:38:16 +00:00
Jason Molenda 4e67b0a61a Ah, forgot qModuleInfo. Need to look that one up
and finish filling this in.

llvm-svn: 349232
2018-12-15 02:51:01 +00:00
Jason Molenda f1127d5224 A brief outline of the packets that need to be implemented
to write an lldb platform server that doesn't link against
LLDB.framework to be able to fully run the lldb testsuite
on a remote system.  The platform packets weren't covered 
in the existing lldb-gdb-remote.txt doc, so I wanted to 
jot them down in one place.

llvm-svn: 349231
2018-12-15 02:36:39 +00:00
Jonas Devlieghere a6682a413d Simplify Boolean expressions
This patch simplifies boolean expressions acorss LLDB. It was generated
using clang-tidy with the following command:

run-clang-tidy.py -checks='-*,readability-simplify-boolean-expr' -format -fix $PWD

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

llvm-svn: 349215
2018-12-15 00:15:33 +00:00
Jim Ingham d81b96ece8 Fix the unittests for the move of Listener & Broadcaster
from Core to Utility.

llvm-svn: 349211
2018-12-14 23:27:08 +00:00
Tatyana Krasnukha 0127883373 Update a comment according to r255360 "Remove -r and -R options from dotest.py"
llvm-svn: 349208
2018-12-14 23:02:41 +00:00
Adrian Prantl 8f06d10291 Remove the Disassembly benchmarks.
While I was out hunting for remaining pexpect-based tests, I came
across these tests that can't possibly work an any modern system, as
they rely on having gdb available in /Developer.

This patch simply removes the test without replacement.

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

llvm-svn: 349194
2018-12-14 21:06:00 +00:00
Greg Clayton baaf2cc7ba Add missing .dmp files to test inputs.
llvm-svn: 349183
2018-12-14 19:38:08 +00:00
Greg Clayton 026e1bf56a Cache memory regions in ProcessMinidump and use the linux maps as the source of the information if available
Breakpad creates minidump files that sometimes have:
- linux maps textual content
- no MemoryInfoList

Right now unless the file has a MemoryInfoList we get no region information.

This patch:

- reads and caches the memory region info one time and sorts it for easy subsequent access
- get the region info from the best source in this order:
  - linux maps info (if available)
  - MemoryInfoList (if available)
  - MemoryList or Memory64List
- returns memory region info for the gaps between regions (before the first and after the last)

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

llvm-svn: 349182
2018-12-14 19:36:01 +00:00
Greg Clayton 82694abac7 Fix Xcode project for MIPS architecture plug-in and move of Event, Listener and Broadcaster to Utility.
llvm-svn: 349180
2018-12-14 19:22:24 +00:00
Zachary Turner 298e268155 [NativePDB] Fix local-variables.cpp test.
Since we're actually running an executable on the host now, different
versions of Windows could load different system libraries, so we need
to regex out the number of loaded modules.

llvm-svn: 349175
2018-12-14 18:43:42 +00:00
Pavel Labath 181b823b04 Move Broadcaster+Listener+Event combo from Core into Utility
Summary:
These are general purpose "utility" classes, whose functionality is not
debugger-specific in any way. As such, I believe they belong in the
Utility module.

This doesn't break any particular dependency (yet), but it reduces the
number of Core dependencies across the board.

Reviewers: zturner, jingham, teemperor, clayborg

Subscribers: mgorny, lldb-commits

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

llvm-svn: 349157
2018-12-14 15:59:49 +00:00
Pavel Labath eed7b2eeca Fix minidump unit test failures from r349062
This commit added new test inputs, but it did not add them to the cmake
files. This caused the test to fail at runtime.

While in there, I also sorted the list of minidump test inputs.

llvm-svn: 349154
2018-12-14 14:41:04 +00:00
Pavel Labath 091fcdb10b Fix build with older (<3.0) swigs
It turns out it wasn't the compilers, but swig who had issues with my
previous patch -- older versions do not recognise the "constexpr"
keyword.

Fortunately, that can be fixed the same way we fix all other swig
incompatibilities: #ifndef SWIG.

llvm-svn: 349153
2018-12-14 14:25:20 +00:00
Pavel Labath b3ce98ac7c Mark Permissions as a bitmask enum
this allows one to use bitwise operators on the variables of this type
without complicated casting.

The gotcha here is that the combinations of these enums were being used
in some constexpr contexts such as case labels (case
ePermissionsWritable | ePermissionsExecutable:), which is not possible
if the user-defined operator| is not constexpr.

So, this commit also marks these operators as constexpr. I am committing
this as a small standalone patch so it can be easily reverted if some
compiler has an issue with this.

llvm-svn: 349149
2018-12-14 13:51:20 +00:00
Richard Trieu f03e8023b7 Remove unused variable.
llvm-svn: 349128
2018-12-14 05:40:30 +00:00
Greg Clayton 918adb56d8 Fix test failures that depended on module order
llvm-svn: 349122
2018-12-14 03:07:15 +00:00
Zachary Turner d3d2b9b891 [NativePDB] Add support for local variables.
This patch adds support for parsing and evaluating local variables.
using the native pdb plugin.

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

llvm-svn: 349067
2018-12-13 18:17:51 +00:00