Commit Graph

15618 Commits

Author SHA1 Message Date
Pavel Labath 7e2cfbf0b7 Remove TimeValue usage from Core/Module
Summary:
The only interesting part here is that TimePoint and TimeValue have different
natural string representations, which affects "target modules list" output. It
is now "2016-07-09 04:02:21.000000000", whereas previously in was
"Sat Jul  9 04:02:21 2016". I wanted to check if we're OK with that.

Reviewers: clayborg

Subscribers: lldb-commits

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

llvm-svn: 286349
2016-11-09 09:59:18 +00:00
Jason Molenda 73184de2d3 When deciding whether to use the source remapping dictionary from
a dSYM per-uuid plist, only use it when the DBGVersion key has a
value of 2 or greater.

<rdar://problem/28889578> 
<rdar://problem/29131339> 

llvm-svn: 286335
2016-11-09 03:42:12 +00:00
Jim Ingham 4f243e8d93 "thread backtrace" should use the thread-stop-format.
<rdar://problem/28273697>

llvm-svn: 286312
2016-11-08 23:43:36 +00:00
Zachary Turner cb3c9f6c74 Fix some cases where we were printf'ing StringRefs.
llvm-svn: 286303
2016-11-08 22:23:50 +00:00
Jim Ingham 0fc15ab5b5 Fix up the formats.html for the addition of the thread-stop-format.
<rdar://problem/28273697>

llvm-svn: 286301
2016-11-08 22:05:29 +00:00
Jim Ingham 6a9767c7e6 Clean up the stop printing header lines.
I added a "thread-stop-format" to distinguish between the form
that is just the thread info (since the stop printing immediately prints
the frame info) and one with more frame 0 info - which is useful for
"thread list" and the like.

I also added a frame.no-debug boolean to the format entities so you can
print frame information differently between frames with source info and those
without.

This closes https://reviews.llvm.org/D26383.
<rdar://problem/28273697>

llvm-svn: 286288
2016-11-08 20:36:40 +00:00
Chris Bieneman b6f833793d [Test Suite] Properly quote python string
Oops!

llvm-svn: 286258
2016-11-08 18:14:42 +00:00
Chris Bieneman 4b8dbcb74c [Test Suite] Attempt to fix issue zturner reported to me
Not sure why this didn't explode more massively, but this should fix the issue with the non-framework tests.

llvm-svn: 286254
2016-11-08 17:53:18 +00:00
Vedant Kumar 5ea41f30fd [lldb] Don't build unit tests for unsupported targets
Differential Revision: https://reviews.llvm.org/D26338

llvm-svn: 286215
2016-11-08 06:49:59 +00:00
Zachary Turner c5d7df9035 Convert some Expression parser functions to StringRef.
llvm-svn: 286208
2016-11-08 04:52:16 +00:00
Zachary Turner 0ac5f9846b Rewrite OutputFormattedHelpText in terms of StringRef.
This makes the logic easier to follow and also propagates
StringRef up to the API boundary, which is necessary for
making higher up StringRef API changes.

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

llvm-svn: 286204
2016-11-08 04:12:42 +00:00
Enrico Granata 65d86e4fa5 Simplify the PrintableRepresentationSpecialCases code; we never used the ePrintableRepresentationSpecialCasesOnly value and with enum classes the names doesn't need to be that long
llvm-svn: 286176
2016-11-07 23:32:20 +00:00
Jim Ingham 0298082541 UserExpression::Evaluate only returns a non-empty ValueObjectSP
if it returns eExpressionCompleted.  Don't try to get the error
from the ValueObjectSP if that's not true.

I just have a report of this from the field, I don't know how
to make it fail yet.

<rdar://problem/29113004>

llvm-svn: 286170
2016-11-07 22:47:01 +00:00
Enrico Granata 3949cb61a5 Fix an issue where LLDB would hang trying to launch tvOS simulator binaries
llvm-svn: 286116
2016-11-07 16:25:01 +00:00
Pavel Labath 1071ac1935 Make space for FreeBSD core file tests
This renames the functionalities/postmortem/linux-core to elf-core and puts the
"linux" part into the individual names of the core files. Since the tests for
linux and freebsd core files are going to be very similar, having them close
together means they can reuse most of the plumbing.

llvm-svn: 286101
2016-11-07 09:58:58 +00:00
Vedant Kumar 6ba1db9f78 [lldb] Fix -Waggressive-loop-optimizations warning
We shouldn't access past the end of an array, even if we think that the
layout of the struct containing the array is always what we expect. The
compiler is free to optimize away the stores as undefined behavior, and
in fact, GCC 6.2.1 claims it will do exactly this.

llvm-svn: 286093
2016-11-07 02:39:37 +00:00
Zachary Turner 6560d2c2d5 Convert some helper functions to use StringRef.
I will probably submit a lot of small trivial changes
like this over the coming weeks.  The end goal is to
convert Options::SetOptionValue to take the option arg
as a StringRef, but doing so in one pass would be a huge
mess of disparate changes just to satisfy the compiler,
and with a high risk of breaking.  So I'm going to do
this in small pieces, changing seemingly random things
here and there until the final change to the signature
of Options::SetOptionValue() can be done trivially.

llvm-svn: 286088
2016-11-07 00:07:25 +00:00
Ed Maste b30841ae95 make-core.sh: add FreeBSD support
Differential Revision:	https://reviews.llvm.org/D26315

llvm-svn: 286035
2016-11-05 14:45:13 +00:00
Enrico Granata 9ac0dac1a6 Preliminary plumbing work to make 'parray' able to take offset and stride options
llvm-svn: 286003
2016-11-04 18:15:39 +00:00
Pavel Labath 2fd9a1e0d9 Fix GDBRemoteCommunicationClientTest.TestPacketSpeedJSON
The mock server was listening for only one packet (I forgot to put a loop around
it), which caused the client to stall in debug builds, as the timeout there is
1000 seconds. In case of a release builds the test would just silently succeed as
the tested function does not check or report errors (which should be fixed).

This fixes the test by adding the server loop. Since the test was taking quite a
long time now (8s), I have added a parameter to control the amount of data sent
(default 4MB), and call it with a smaller value in the test, to make the test run
faster.

llvm-svn: 285992
2016-11-04 11:49:06 +00:00
Jim Ingham ed76d10038 Added a couple more odd dot patterns that we got out
of clang.

llvm-svn: 285977
2016-11-04 01:47:59 +00:00
Jim Ingham 225621596b Don't access the process in expressions w/o checking that
the process exists.

I also added some tests that crash before this fix, and work correctly after.

<rdar://problem/29083321>

llvm-svn: 285974
2016-11-03 23:42:09 +00:00
Enrico Granata 2de50d6026 Add RenderScriptScriptGroup to the Xcode project
llvm-svn: 285943
2016-11-03 17:33:11 +00:00
Enrico Granata 7700de8c30 Add support to the ObjC type scavenger for finding types via debug info
llvm-svn: 285941
2016-11-03 17:25:27 +00:00
Aidan Dodds 21fed052e0 [Renderscript] Add commands for scriptgroup interaction.
This commit hooks the nofity function that signals script group
compilation.  By tracking scriptgroups compiled at runtine, users
are able to place breakpoints by script group name.  Breakpoints
will be placed on the kernels forming the group.

llvm-svn: 285902
2016-11-03 13:20:37 +00:00
Pavel Labath 3aa330f98a Link lldb-mi only to the llvm components it uses
Summary:
liblldb does not re-export the llvm library contained within, so lldb-mi needs to
manage its own dependencies. Right now it only uses the llvm support library.

Reviewers: beanz, zturner, tfiala, clayborg, abidh

Subscribers: ki.stfu, mgorny, lldb-commits

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

llvm-svn: 285894
2016-11-03 10:52:17 +00:00
Pavel Labath 174c578bfe Fix Timer unit test
I did not take into account that the output of the Dump function will be
non-deterministic. Fix that by increasing of the times, this also makes the test
check that the dump function sorts the output.

llvm-svn: 285892
2016-11-03 10:07:47 +00:00
Pavel Labath bfa601f6b8 Remove TimeSpecTimeout class
the class is unused.

llvm-svn: 285891
2016-11-03 09:29:56 +00:00
Pavel Labath 96a3c91e66 Refactor Timer class
Summary:
While removing TimeValue from this class I noticed a lot of room for small
simplifications here. Main are:
  - instead of complicated start-stop dances to compute own time, each Timer
    just starts the timer once, and keeps track of the durations of child
    timers. Then the own time can be computed at the end by subtracting the two
    values.
  - remove double accounting in TimerStack - the stack object already knows the
    number of timers.
The interface does not lend itself well to unit testing, but I have added a
couple of tests which can (and did) catch any obvious errors.

Reviewers: tberghammer, clayborg

Subscribers: mgorny, lldb-commits

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

llvm-svn: 285890
2016-11-03 09:14:09 +00:00
Ravitheja Addepally 0f80cc84f0 Test for YMMRegisters.
Summary:
This patch contains test for reading YMM Registers. The test basically
contains an inferior that loads the ymm registers with a bit pattern
and the python test executes register read to check if the bit pattern
is correctly written in the registers. This test is repeated twice for
each register with a different pattern for better sanity.

Reviewers: tberghammer, zturner, clayborg

Subscribers: tberghammer, danalbert, srhines

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

llvm-svn: 285885
2016-11-03 08:35:55 +00:00
Michal Gorny 1f368434f0 [cmake] Build gtest from LLVM when building standalone
Include the gtest utility directory from LLVM sources when performing
a stand-alone build of LLDB. This is necessary to have a correct gtest
library to link tests against, as the one used by LLVM is not installed
(and not supposed to be). This is the same approach as used in clang.

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

llvm-svn: 285865
2016-11-02 22:57:23 +00:00
Dawn Perchik 49df3895e7 Fix typo which broke debugging on older OSX systems after r285172.
Reviewed by: jasonmolenda
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D26260

llvm-svn: 285858
2016-11-02 20:57:34 +00:00
Malcolm Parsons 771ef6d4f1 Fix Clang-tidy readability-redundant-string-cstr warnings
Reviewers: zturner, labath

Subscribers: tberghammer, danalbert, lldb-commits
    
Differential Revision: https://reviews.llvm.org/D26233

llvm-svn: 285855
2016-11-02 20:34:10 +00:00
Pavel Labath ad90734caf Remove KQueue.cpp
Summary:
This class is unused.

Reviewers: clayborg

Subscribers: mgorny, modocache, lldb-commits

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

llvm-svn: 285847
2016-11-02 18:06:17 +00:00
Zachary Turner 046bbafdf2 Fix crash in PseudoTerminal on Windows.
Patch by Rudy Pons
Differential Revision: https://reviews.llvm.org/D25681

llvm-svn: 285843
2016-11-02 17:42:12 +00:00
Chris Bieneman 668fe2f92b [CMake] Support LLDB_TEST_CLANG in check-lldb target(s)
This just hooks up the in-tree compiler to be optionally used when running the test suite.

llvm-svn: 285839
2016-11-02 17:19:26 +00:00
Chris Bieneman 5f15a30bb1 Find clang resource directory via *nix-style lookup
Summary:
This patch allows the Darwin build to fall back to to Posix-style lookups for the clang resource directory if the debugger library isn't inside a framework.

The patch also includes a bit of refactoring and cleanup around the *nix resolution of the binary and lib directories to reuse the code instead of duplicating it.

With this patch Darwin builds that don't build a framework only have 3 failing tests on my system (TestExec.py).

Reviewers: zturner, labath, spyffe, tfiala

Subscribers: lldb-commits

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

llvm-svn: 285838
2016-11-02 17:19:23 +00:00
Zachary Turner e9da8a8ec0 Fix some warnings compiling with clang-cl on Windows.
llvm-svn: 285834
2016-11-02 16:59:42 +00:00
Pavel Labath 774103c831 Remove TimeValue usage from two files
llvm-svn: 285801
2016-11-02 12:18:42 +00:00
Pavel Labath eaa419cf5e Fix printf errors in ProcessMinidump
llvm-svn: 285798
2016-11-02 10:29:47 +00:00
Pavel Labath 766fd11597 Remove TimeValue from UnwindLLDB.cpp
Really NFC, as the code is #ifdefed out, but I did make sure it compiles if I enable it.

llvm-svn: 285797
2016-11-02 10:27:54 +00:00
Pavel Labath 5cddd608cd Remove TimeValue usages from MacOSX-Kernel process plugin. NFC
llvm-svn: 285795
2016-11-02 10:13:54 +00:00
Jim Ingham c76c3f2f91 Fix SBWatchpoint::SetEnabled to send an event.
We really shouldn't be sending events for SB API's, dunno when we started
doing that.  We don't do it for other things.  But first restore the status quo.

llvm-svn: 285781
2016-11-02 01:06:42 +00:00
Jim Ingham 8a99f120bc Xfail this while I figure out why the event isn't getting sent.
llvm-svn: 285761
2016-11-01 22:53:54 +00:00
Zachary Turner 857086edda Add missing #include.
llvm-svn: 285749
2016-11-01 21:08:34 +00:00
Jim Ingham 306b62b4ae Switch SBWatchpoint::SetEnabled over to using Process::{Enable,Disable}Watchpoint.
We don't have a good story for what happens to watchpoints when you don't
have a process, or if your process exits.  Clearing that up will instruct 
how to fix this for real.

Also added a test to make sure disable->enable works as well.
This resolves llvm.org/pr30789.

llvm-svn: 285742
2016-11-01 20:37:02 +00:00
Enrico Granata f60216733f Add helpers for the notion of a type scavenger that is "either this or that" source, and one that is "both this and that" source
Use the helper to rewrite the ObjC type lookup logic (first modules, then runtime) in terms of an either scavenger

llvm-svn: 285736
2016-11-01 20:17:14 +00:00
Enrico Granata 63db2395f6 Implement a general type scavenger that can dig types from debug info + a filtering mechanism to accept/reject results thusly obtained
Implement the C++ type lookup support in terms of this general scavenger

The idea is that we may want other languages to do debug info based search (exclusively, or as an add-on to runtime/module based searching) and it makes sense to avoid duplicating this functionality

llvm-svn: 285727
2016-11-01 18:50:49 +00:00
Todd Fiala 4190199568 change ProcessAttach test to no-debug-info
Fixes:
https://bugs.swift.org/browse/SR-3103

llvm-svn: 285726
2016-11-01 18:50:34 +00:00
Eugene Zelenko a0b67bbed9 Fix RHEL 6 build with missing cerrno and some other Include What You Use warnings.
Differential revision: https://reviews.llvm.org/D26171

llvm-svn: 285710
2016-11-01 17:11:10 +00:00
Pavel Labath 1408bf7231 Remove TimeValue usage from FileSpec.h
Summary:
The only usage there was in GetModificationTime(). I also took the opportunity
to move this function from FileSpec to the FileSystem class - since we are
using FileSpecs to also represent remote files for which we cannot (easily)
retrieve modification time, it makes sense to make the decision to get the
modification time more explicit.

The new function returns a llvm::sys::TimePoint<>. To aid the transition
from TimeValue, I have added a constructor to it which enables implicit
conversion from a time_point.

Reviewers: zturner, clayborg

Subscribers: mehdi_amini, tberghammer, danalbert, beanz, mgorny, lldb-commits

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

llvm-svn: 285702
2016-11-01 16:11:14 +00:00
Dimitar Vlahovski 5a19c0cc50 Minidump plugin: Fix flaky test
Summary:
One of the tests was flaky, because similarly to
https://reviews.llvm.org/D18697 (rL265391) - if there is a process running
which is with the same PID as in the core file, the minidump
core file debugging will fail, because we get some information from the
running process.
The fix is routing the ProcessInfo requests through the Process class
and overriding it in ProcessMinidump to return correct data.

Reviewers: labath

Subscribers: lldb-commits, beanz

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

llvm-svn: 285698
2016-11-01 15:48:24 +00:00
Jason Molenda e322332a09 Fix a bug where the EmulateInstructionARM64 handling of STP/LDP instructions
for floating point registers was not recording them correctly.  I needed to
change the EmulateInstructionARM64 unwind plans from using the DWARF 
register numbering scheme to using the LLDB register numbering scheme
(because dwarf doesn't define register numbers for the 64-bit "d" registers).
Updated the EmulateInstructionARM64 unit tests to work with the LLDB
register numbering scheme and added a unit test to check the floating
point register spills & restores are correctly recorded.

https://reviews.llvm.org/D25864
<rdar://problem/28745483> 

llvm-svn: 285662
2016-11-01 01:26:54 +00:00
Stephane Sezer 8004a57d79 Remove executable bit on a source file
llvm-svn: 285658
2016-11-01 00:21:57 +00:00
Chris Bieneman b9fc4727cc [CMake] Populate the build directory's framework
This ensures that the Resources and clang headers are properly symlinked in LLDB's framework. This should fix the modules-related tests when building on Darwin with CMake if you are building a framework.

I have another fix coming which gets them working on Darwin if you're building liblldb instead of a framework.

llvm-svn: 285651
2016-10-31 22:31:07 +00:00
Chris Bieneman 5d51a76994 [Test-Suite] Speculative fix for darwin bots
When building with Xcode it looks like some of the logic in my test changes went haywire. This should fix it.

llvm-svn: 285646
2016-10-31 22:06:52 +00:00
Pavel Labath 3aa049102f Remove usages of TimeValue from gdb-remote process plugin
Summary:
Most of the changes are very straight-forward, the only tricky part was the
"packet speed-test" function, which is very time-heavy. As the function was
completely untested, I added a quick unit smoke test for it.

Reviewers: clayborg, zturner

Subscribers: lldb-commits

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

llvm-svn: 285602
2016-10-31 17:19:42 +00:00
Enrico Granata 5b6198d369 Remove a couple of old TODOs and don't make a new ConstString each time; none of this is super-critical since it applies to older versions of macOS (or OSX, I guess?) but still..
llvm-svn: 285599
2016-10-31 17:12:16 +00:00
Enrico Granata a8ab2b0c46 Add the new minidump plugin files to the Xcode project
llvm-svn: 285596
2016-10-31 17:00:54 +00:00
Pavel Labath 218770b827 Improve ".." handling in FileSpec normalization
Summary:
.. handling for windows path was completely broken because the function was
expecting \ as path separators, but we were passing it normalized file paths,
where these have been replaced by forward slashes. Apart from this, the function
was incorrect for posix paths as well in some corner cases, as well as being
generally hard to follow.

The corner cases were:
- /../bar -> should be same as /bar
- /bar/.. -> should be same as / (slightly dodgy as the former depends on /bar actually
  existing, but since we're doing it in an abstract way, I think the
  transformation is reasonable)

I rewrite the function to fix these corner cases and handle windows paths more
correctly. The function should now handle the posix paths (modulo symlinks, but
we cannot really do anything about that without a real filesystem). For windows
paths, there are a couple of corner cases left, mostly to do with drive letter
handling, which cannot be fixed until the rest of the class understands drive
letters better.

Reviewers: clayborg, zturner

Subscribers: lldb-commits

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

llvm-svn: 285593
2016-10-31 16:22:07 +00:00
Dimitar Vlahovski 7b18dd4f77 Minidump plugin: Adding ProcessMinidump, ThreadMinidump and register the plugin in SystemInitializerFull
Summary:
This plugin resembles the already existing Windows-only Minidump plugin.
The WinMinidumpPlugin uses the Windows API for parsing Minidumps
while this plugin is cross-platform because it includes a Minidump
parser (which is already commited)

It is able to produce a backtrace, to read the general puprose regiters,
inspect local variables, show image list, do memory reads, etc.

For now the only arches that this supports are x86_32 and x86_64.
This is because I have only written register contexts for those.
Others will come in next CLs.

I copied the WinMinidump tests and adapted them a little bit for them to
work with the new plugin (and they pass)
I will add more tests, aiming for better code coverage.

There is still functionality to be added, see TODOs in code.

Reviewers: labath, zturner

Subscribers: beanz, mgorny, modocache, lldb-commits, amccarth

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

llvm-svn: 285587
2016-10-31 15:35:18 +00:00
Dimitar Vlahovski a7eebeb156 Minidump plugin: Adding x86_32 register context converter
Summary:
This, like the x86_64 case, reads the register values from the minidump
file, and emits a binary buffer that is ordered using the offsets from
the RegisterInfoInterface argument. That way we can reuse an existing
register context.
Added unit tests.

Reviewers: labath, zturner

Subscribers: beanz, mgorny, modocache, amccarth, lldb-commits

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

llvm-svn: 285584
2016-10-31 15:26:44 +00:00
Pavel Labath 6b91e405e3 Use the right dwarf attributes for parsing location list entries (fixup for r285441)
Note that the parsing code here is still incorrect wrt. the new draft of the
dwarf 5 spec (seconds arguments to DW_LLE_startx_length should be uleb128, not
u32). Once we have compilers actually emitting dwarf conformant with the new
spec, we'll need to revisit this and figure out the proper behavior there.

This should unbreak the linux bot.

llvm-svn: 285562
2016-10-31 11:53:13 +00:00
Chris Bieneman f8ac2da114 [Test Suite] Pull generateSource into lldbtest
Summary:
Convert tests using LLDB headers to use generateSource to put the right include paths in place regardless of whether or not you're building a framework.

This also abstracted generateSource out of TestPublicAPIHeaders.py into lldbtest.py.

Reviewers: tfiala, zturner

Subscribers: lldb-commits

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

llvm-svn: 285542
2016-10-31 04:48:19 +00:00
Chris Bieneman bd6d69987c [Test Suite] Properly respect --framework option
Summary:
dotest.py has a framework option that is not respected. This patch makes the framework path properly configurable via the --framework option.

This patch also adds a function to the lldbtest.Base class named "hasDarwinFramework" which allows us to not rely on the host platform to determine if a framework is present. If running on Darwin, and not building a framework, this will follow the *nix code paths which are appropriate for Darwin.

Reviewers: tfiala

Subscribers: lldb-commits, mgorny

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

llvm-svn: 285541
2016-10-31 04:48:10 +00:00
Todd Fiala fe68f09975 Limit LLDB_EXPORT_ALL_SYMBOLS to lldb symbols
LLDB_EXPORT_ALL_SYMBOLS used to instruct the build to export all
the symbols in liblldb on CMake builds.  This change limits the
CMake define to only add in the lldb_private namespace to the
symbols that normally get exported, such that we export all the
symbols in the public lldb namespace and the lldb_private namespace.

This is a fix for:
https://llvm.org/bugs/show_bug.cgi?id=30822

Reviewers: labath, beanz

Subscribers: lldb-commits

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

llvm-svn: 285484
2016-10-29 00:29:15 +00:00
Adrian Prantl e704506c93 Rename DWARF 5 constants to adapt to change in LLVM
llvm-svn: 285441
2016-10-28 20:11:27 +00:00
Adrian Prantl 1c0bf1baca Rename DWARF 5 constants to adapt to change in LLVM
llvm-svn: 285424
2016-10-28 18:14:43 +00:00
Pavel Labath 10c606295f Add a couple of fun unit tests for FileSpec::Equal
Most of them fail right now and are commented out. The main problem is handling
of backslashes on windows, but also the posix path code has a couple of issues.

llvm-svn: 285393
2016-10-28 11:28:01 +00:00
Jason Molenda ed2977fabe Check that we got back an object from MakeFunctionCaller
before we call through it.  

<rdar://problem/28979705> 

llvm-svn: 285369
2016-10-27 23:52:46 +00:00
Chris Bieneman 614dc150ec Revert "[Test Suite] Pull generateSource into lldbtest"
This reverts commit r285357.

I committed this patch accidentally out of order. Will recommit when the change this depends on is landed.

llvm-svn: 285361
2016-10-27 23:18:52 +00:00
Chris Bieneman f817bae161 [Test Suite] Pull generateSource into lldbtest
Summary:
Convert tests using LLDB headers to use generateSource to put the right include paths in place regardless of whether or not you're building a framework.

This also abstracted generateSource out of TestPublicAPIHeaders.py into lldbtest.py.

Reviewers: tfiala, zturner

Subscribers: lldb-commits

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

llvm-svn: 285357
2016-10-27 22:52:32 +00:00
Chris Bieneman 91967bd301 [CMake] Rename lldb-launcher to darwin-debug
Summary: This tool is only built on Darwin, and the name darwin-debug matches the Xcode project. We should have this in sync unless there is a good reason not to.

Reviewers: zturner, tfiala, labath

Subscribers: labath, mgorny, lldb-commits

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

llvm-svn: 285356
2016-10-27 22:51:41 +00:00
Enrico Granata c046497bf0 Add support for "type lookup" to find C and C++ types
This is an important first step in closing the functionality gap between "type lookup" and "images lookup -t"

rdar://28971388

llvm-svn: 285332
2016-10-27 18:44:45 +00:00
Enrico Granata 73418dfe61 Fix an issue where frame variable -s <varname> would not show the scope even though the user asked for it
Part of rdar://28434047

llvm-svn: 285226
2016-10-26 19:17:49 +00:00
Enrico Granata 0cd95447db Actually use = delete to mark constructors and operators we want to not exist. Just declaring them as private works, but it can confuse certain tools as it doesn't actually declare intent, and the C++11 way is more expressive anyway, so this is pure win
rdar://28960209

llvm-svn: 285216
2016-10-26 18:12:52 +00:00
Pavel Labath 42eb6908e0 Don't set a software stepping breakpoint at 0 on arm or mips.
Summary:
Check whether the setting the breakpoint failed during instruction emulation. If
it did, the next pc is likely in unmapped memory, and the inferior will crash
anyway after the next instruction. Do not return an error in this case, but just
continue stepping.
Reenabled the crash during step test for android/linux.

Reviewers: labath

Subscribers: aemerson, rengolin, tberghammer, danalbert, srhines, lldb-commits

Differential Revision: https://reviews.llvm.org/D25926
Author: Jason Majors <jmajors@google.com>

llvm-svn: 285187
2016-10-26 11:13:56 +00:00
Jason Molenda a3b7527ccb Enable the use of the new dyld SPI on the current
generation macosx/ios/tvos/watchos.

llvm-svn: 285172
2016-10-26 04:48:41 +00:00
Jim Ingham f2673d6480 SBWatchpoint::Disable doesn't actually work. Add a test that shows this.
Next to fix it!

llvm-svn: 285153
2016-10-26 01:09:21 +00:00
Jim Ingham 209a77d8d9 Fix a race condition between the "ephemeral watchpoint disabling" and commands the continue the process.
This closes https://reviews.llvm.org/D25875.

llvm-svn: 285114
2016-10-25 20:34:32 +00:00
Jim Ingham 8bd8e463b7 Fixing up the project file for the removal of LibStdcppSmartPointer.cpp.
llvm-svn: 285113
2016-10-25 20:32:26 +00:00
Pavel Labath e7dd397209 Revert "Improve the libstdc++ smart pointer formatters"
This reverts commit r284828, as it causes an infinite loop in
TestPrintStackTraces (funnily enough, only when logging is enabled).

llvm-svn: 285068
2016-10-25 13:24:53 +00:00
Todd Fiala 409252fcef remove xfail from TestObjCNewSyntax.py test_expr_gmodules()
Fixes:
rdar://27792848

llvm-svn: 285032
2016-10-24 21:46:46 +00:00
Pavel Labath b0f359e610 Use shorter names in TestConcurrentEvents tests
Otherwise, they tend to generate filename too long errors.

They already contain the same test name in the directory, file, and class names,
so no information is really lost here.

llvm-svn: 284987
2016-10-24 16:20:43 +00:00
Pavel Labath 7a8ba4ffbe Fix arm64 sub-register definitions
The "value regs" field was filled incorrectly. It is supposed to list the
registers that *this* register is a sub-register of, not the other way around.
This manifested itself in "register read" showing only the smaller sub-registers
(and a bunch of tests not passing). I am not sure if the "invalidates" field is
correct either, but it's usage seems to be inconsistent, so I'll leave that as-is
for now.

llvm-svn: 284981
2016-10-24 14:57:50 +00:00
Pavel Labath 183098ca47 Reformat RegisterInfos_arm64 into a table. NFC
llvm-svn: 284976
2016-10-24 14:01:52 +00:00
Pavel Labath 16706dcbd4 Add the new arm64 sub-register definitions to NativeRegisterContextLinux
It's quite sad that we have to edit so many files just to add a register. I am
going to investigate how to merge these definitions somehow, but for now this
should at least get arm64 linux working again.

llvm-svn: 284970
2016-10-24 12:59:20 +00:00
Jason Molenda bc22c8d8d8 Add some additional logging to
DynamicLoaderDarwinKernel::CheckForKernelImageAtAddress to debug
corefiles that may not be correctly formed.

<rdar://problem/28884846> 

llvm-svn: 284900
2016-10-21 23:45:07 +00:00
Chris Bieneman 7ba5581b84 [Test Suite] Allow overriding codesign identity
Summary: Not everyone names their code sign identity "lldb_codesign", so it is nice to allow this to be overridden.

Reviewers: zturner, tfiala

Subscribers: labath, mgorny, lldb-commits

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

llvm-svn: 284893
2016-10-21 22:13:55 +00:00
Chris Bieneman 1bd5f52e68 [CMake] Fix standalone build
not and FileCheck targets may not be defined in standalone builds.

llvm-svn: 284854
2016-10-21 18:38:44 +00:00
Jim Ingham e3b7ba2ffe Add the new stdcpp formatters to the Xcode project.
llvm-svn: 284851
2016-10-21 18:18:25 +00:00
Enrico Granata 5a75a0d8f5 I hadn't fixed all the instances of the old marker for scripted format strings; do so now
llvm-svn: 284847
2016-10-21 18:03:55 +00:00
Tamas Berghammer de2cc6e4b4 Fix incorrect header order introduced in rL284830
llvm-svn: 284831
2016-10-21 15:05:03 +00:00
Tamas Berghammer d161b2147b Add data formatter for libstdc++ unique_ptr
Differential revision: https://reviews.llvm.org/D25734

llvm-svn: 284830
2016-10-21 15:02:44 +00:00
Tamas Berghammer 7f15dba16d Add data formatter for libstdc++ tuple
Differential revision: https://reviews.llvm.org/D25733

llvm-svn: 284829
2016-10-21 15:02:38 +00:00
Tamas Berghammer 0789722d85 Improve the libstdc++ smart pointer formatters
* Display the strong/weak count in the summary
* Display the pointed object as a synthetic member
* Create synthetic children for weak/strong count

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

llvm-svn: 284828
2016-10-21 15:02:32 +00:00
Pavel Labath eb01a169c2 Add TestMultipleHits.py
This tests that lldb handles the situation when a single instruction triggers
multiple watchpoint hits. It currently fails on arm due to what appears to be a
lldb-server bug (pr30758).

llvm-svn: 284819
2016-10-21 11:14:04 +00:00
Pavel Labath 2e8fe80447 Revert "Fix a race condition between "ephemeral watchpoint disable/enable" and continue in commands."
This reverts commit r284795, as it breaks watchpoint handling on arm (and
presumable all architectures that report watchpoint hits without executing the
tripping instruction).

There seems to be something fundamentally wrong with this patch: it uses
process_sp->AddPreResumeAction to re-enable the watchpoint, but the whole point
of the step-over-watchpoint logic (which AFAIK is the only user of this class) is
to disable the watchpoint *after* we resume to do the single step.

I have no idea how to fix this except by reverting the offending patch.

llvm-svn: 284817
2016-10-21 10:52:11 +00:00
Jason Molenda 14699cf1c6 Guard GetEscapedHostname against a nullptr hostname.
This can happen if you debug an iOS corefile on
a mac, where PlatformPOSIX::GetHostname ends up
not providing a hostname because we're working 
with a platform of remote-ios.

llvm-svn: 284799
2016-10-21 02:32:08 +00:00
Jim Ingham 94bd575c73 Fix a race condition between "ephemeral watchpoint disable/enable" and continue in commands.
Also, watchpoint commands, like breakpoint commands, need to run in async mode.

This was causing intermittent failures in TestWatchpointCommandPython.py, which is now solid.

llvm-svn: 284795
2016-10-21 00:06:38 +00:00
Jim Ingham ffd9175f74 Add an API to remove an action from the Process PreResumeActions.
llvm-svn: 284792
2016-10-20 22:50:00 +00:00
Jim Ingham 1d9284c3bc Remove an unnecessary and incorrect check for num locations of a breakpoint
by grubbing the break list output.  If you pass a number of locations into
the run_break_* functions, they will check that this is right for you.

llvm-svn: 284791
2016-10-20 22:49:06 +00:00
Enrico Granata f3a8803b76 frame.script became script.frame a while ago; fix up the docs
llvm-svn: 284788
2016-10-20 22:10:07 +00:00
Enrico Granata c8af52df86 This debugging message has been left in the code for years, until one day it randomly hit on some corrupted memory
It is misleading to users in its current form, and only interesting to me - remove it

rdar://28812568

llvm-svn: 284787
2016-10-20 22:05:21 +00:00
Chris Bieneman 53a7844383 Re-landing a cleaned up implementation of r284550
This time it should actually work. The previous implementaiton was not
getting the linker or compiler flag set correctly in all the right
situations. By moving the check down and basing it of whether or not CXX
is set I we can have the logic to add the flags exist only once for the
linker and once for the compiler instead of duplicating it.

llvm-svn: 284756
2016-10-20 18:01:19 +00:00
Dimitar Vlahovski 039983b915 Minidump plugin: redesign the x86_64 register context
Summary:
I misunderstood the format of the register context layout.
I thought it was a dynamically changing structure, and that it's size
depended on context_flags.
It turned out that it always has the same fixed layout and size,
and the context_flags says which fields of the
struct have valid values.
This required a minor redesign of the register context class.

The layout inconsistency, however, was not a "problem" before (e.g. the plugin was working)
because there also was a bug with checking context_flags - the code was
parsing the entire struct regardless of context_flags.
This bug is also fixed in this commit.

Reviewers: labath, zturner

Subscribers: lldb-commits, amccarth

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

llvm-svn: 284741
2016-10-20 16:01:36 +00:00
Tamas Berghammer 5ac6e91c4f Re-generate the python and cpp reference documentation
They haven't been updated since July 2013 so they missed a lot of new
function added to the SB API since.

Bug: llvm.org/pr30603
llvm-svn: 284725
2016-10-20 13:04:32 +00:00
Omair Javaid 05ac4c445c Fix ARM/AArch64 Step-Over watchpoint issue remove provision for duplicate watchpoints
This patch fixes ARM/AArch64 watchpoint bug which was taking inferior out of control while stepping over watchpoints.
Also adds a test case that tests above problem.

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

llvm-svn: 284706
2016-10-20 09:07:26 +00:00
Sean Callanan 7ef7b449a0 Added a decorator for the macOS version and switched over testcases that used platform.release
llvm-svn: 284674
2016-10-20 00:03:39 +00:00
Jason Molenda 0b5102fd7e Add lldb register definitions for w0-w28, s0-s31, and d0-d31 to
RegisterInfos_arm64.h.  These register definitions include the
offset into the register context, which will vary depending on the
endianness of the arm64 target system (e.g. s8 is at offset 0 in
v8 on little-endian, it is at offset 12 on big-endian) and I've
only added the little-endian definitions to the table.  If we want
to add a big-endian arm64 target, we'll need a separate table which
uses the big-endian offsets for these registers.  I changed the
name of the register table from g_register_infos_arm64 to
g_register_infos_arm64_le to make it explicit that this is the
little-endian version of that table, and updated users of the table
to use the new name.

I added support for the "w", "s", and "d" registers to
RegisterContextDarwin_arm64 but it was more an example than anything
useful -- this plugin is only used when working with core files and
darwin core files do not (today) include the floating point register
context, so it only added the support for the "w" pseudo registers.
When we're connected to a real arm64 device, we use the ProcessGDBRemote
code.

llvm-svn: 284666
2016-10-19 23:38:38 +00:00
Pavel Labath 5f05ea84d5 Simplify GetGlobalProperties functions of Thread/Process/Target
Summary:
"Initialization of function-local statics is guaranteed to occur only once even when called from
multiple threads, and may be more efficient than the equivalent code using std::call_once."
<http://en.cppreference.com/w/cpp/thread/call_once>

I'd add that it's also more readable.

Reviewers: clayborg, zturner

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D17710

llvm-svn: 284601
2016-10-19 15:12:45 +00:00
Pavel Labath 37dabc2427 Remove IntervalTimer class
Summary:
it was added back in 2013, but there are no uses of it. I started refactoring
it, but then it occured to me it would better to delete it.

Reviewers: clayborg, zturner

Subscribers: lldb-commits

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

llvm-svn: 284599
2016-10-19 15:01:22 +00:00
Dimitar Vlahovski b52206decc Minidump plugin: functions parsing memory structures and filtering module list
Summary:
Now the Minidump parser can parse the:
1) MemoryInfoList - containing region info about memory ranges (readable,
writable, executable)
2) Memory64List - this is the stuct used when the Minidump is a
full-memory one.
3) Adding filtering of the module list (shared libraries list) - there
can be mutliple records in the module list under the same name but with
different load address (e.g. when the binary has non contigious
sections). FilterModuleList eliminates the duplicated modules, leaving
the one with the lowest load addr.

Added unit tests for everything.

Reviewers: labath, zturner

Subscribers: beanz, mgorny, modocache, lldb-commits, amccarth

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

llvm-svn: 284593
2016-10-19 14:14:18 +00:00
Michal Gorny e2f4b25d04 [cmake] Use LLVM_CMAKE_PATH for GetSVN script
Use the LLVM_CMAKE_PATH variable to locate the GetSVN.cmake script.
The variable was already available in stand-alone builds, and is also
set by LLVM since r284581.

llvm-svn: 284584
2016-10-19 12:54:28 +00:00
Chris Bieneman e0dcd6d7f4 Revert back to the state before r284550
This patch is causing a lot of issues on bots that I didn't see in local testing. I'm going to have to work on this. Reverting for now while I sort it out.

llvm-svn: 284565
2016-10-19 02:44:20 +00:00
Chris Bieneman 716ac7684c Trying to fix a few more missing LDFLAGS.
llvm-svn: 284564
2016-10-19 02:31:31 +00:00
Chris Bieneman 87378bd21e Fixing the linux bots I broke in r284550
Need to gate cxx linker adding driver-mode flag based on the linker being clang.

llvm-svn: 284555
2016-10-19 00:13:56 +00:00
Chris Bieneman b47711ab27 When invoking Terminal, don't assume the default shell
Summary:
If a user has their shell set to a non-POSIX conferment shell the TestTerminal.py tests fail because the shell blurb constructed here may not work in their shell.

In my specific case fish-shell (The Friendly Interactive Shell - http://fishshell.com) does not support $?, it instead uses $status (because it is friendly).

This patch removes the assumption of your default shell by running the constructed bash command via "/bin/bash -c ...". This should be safer for users mutating their shell environment.

Reviewers: tfiala

Subscribers: joerg, lldb-commits

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

llvm-svn: 284552
2016-10-18 23:55:34 +00:00
Chris Bieneman f50761f128 [CMake] Don't include LLDB_TEST_COMPILER in cached variable
Summary:
CMake has no builtin mechanism for cache invalidation. As a general convention you want to not expand user-specified variables in other cached variables because they will not get updated when the user changes their specified value.

This patch moves the "-C" option for dotest.py into the LLDB_TEST_COMMON_ARGS and out of the CMake cache. In order to prevent issues with out-of-date cache files on builders I've added code to scrub "-C ${LLDB_TEST_COMPILER}" out of the CMake caches, by Force writing the variable. This code can be removed in a few days once the change has trickled through CI systems.

Reviewers: tfiala, labath, zturner

Subscribers: lldb-commits, mgorny

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

llvm-svn: 284551
2016-10-18 23:54:28 +00:00
Chris Bieneman e80f007dfb Use clang --driver-mode instead of guessing c++ compiler path
Summary:
When building the LLDB test programs, if your CC is clang it actually isn't safe to make CXX a string replace of "clang -> clang++". This falls down on unix configurations if your compiler is clang-${version}.

A safer approach is to use the "--driver-mode=g++" option to tell clang to act like clang++.

Reviewers: tfiala, zturner, labath

Subscribers: lldb-commits

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

llvm-svn: 284550
2016-10-18 23:53:24 +00:00
Todd Fiala af6ff2a91b xfail TestMiSyntax.py's test_lldbmi_output_grammar on macOS
Needs to be investigated.  This is failing locally and on the
Xcode CI.

rdar://28805064

llvm-svn: 284484
2016-10-18 15:15:24 +00:00
Pavel Labath 3318642466 Fixup r284466 - try to unbreak NetBSD
NetBSD does not have getopt as well - we need to apply the workaround there too.
FreeBSD seems to be fine though.

llvm-svn: 284469
2016-10-18 10:46:45 +00:00
Pavel Labath 01a955a341 [cmake] Make dependencies of lldb libraries private, take 2
Summary:
The dependencies of our libraries (only liblldb, really) we marked as public, which caused all
their dependencies to be repeated when linking any executables to them. This is a problem because
then all the .a files could end up being linked twice, once to liblldb and once
again to to the executable linking against liblldb (lldb, lldb-mi). As it turns out,
our build actually depends on this behavior:
- on windows, lldb does not have getopt, so it pulls it from inside liblldb, even
  though getopt is not a part of the exported interface of liblldb (maybe some of
  the bsd variants have this problem as well)
- lldb-mi uses llvm, which again is not exported by liblldb

This change does not actually fix these problems (that is going to be a hard
one), but it does make them explicit by moving this magic from add_lldb_library
to the places the executable targets are defined. That way, I can link the
additional .a files only on targets that really need it, and the other targets
can build cleanly and make sure we don't regress further. It also fixes the
LLVM_LINK_LLVM_DYLIB build on linux.

Reviewers: zturner, beanz

Subscribers: ki.stfu, lldb-commits, mgorny

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

llvm-svn: 284466
2016-10-18 10:26:57 +00:00
Jim Ingham 8d50e0c26e Remove a debug print statement.
llvm-svn: 284448
2016-10-18 01:52:32 +00:00
Jim Ingham a7d25264eb More testsuite xfail markings cleanup.
llvm-svn: 284446
2016-10-18 01:43:22 +00:00
Jim Ingham 981da8d37b Fix a crash in expressions with fixits in the dummy target.
In the expression command, if the target is NULL, you have to use the dummy
target.

<rdar://problem/28811687>

llvm-svn: 284439
2016-10-17 23:59:41 +00:00
Walter Erquinigo 344546bd6e [lldb] Read modules from memory when a local copy is not available
Summary:
When the local lldb doesn't have access to a copy of the modules in the target, e.g. winphone, with this change now we read these modules from memory.

There are mainly 2 changes:
1. create pecoff object files from memory
2. read from memory when the local file is not available

Reviewers: sas, fjricci, zturner

Subscribers: #lldb

Tags: #lldb

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

llvm-svn: 284422
2016-10-17 20:28:19 +00:00
Justin Bogner b69c3169b0 unittests: Specify types in a bunch of unittest EXPECT's
The EXPECT and ASSERT macros in gtest don't do the usual arithmetic
conversions. Specify types in several of them to fix -Werror.

llvm-svn: 284405
2016-10-17 18:22:03 +00:00
Justin Bogner 812101d862 Interpreter: Don't return StringRef from functions whose return value is never used
StringRef is passed through all of these APIs but never actually
used. Just remove it from the API for now and if people want to use it
they can add it back.

llvm-svn: 284362
2016-10-17 06:17:56 +00:00
Jim Ingham 4b4e705b67 This test is no longer failing for gmodules.
llvm-svn: 284296
2016-10-15 00:04:38 +00:00
Chris Bieneman 9a6502f1cd [CMake] Populate LLDB.framework's headers directory
Summary:
This patch adds support for installing public headers in LLDB.framework, and symlinking the headers into the build directory.

While writing the patch I discovered a bug in CMake that prevents applying POST_BUILD steps to framework targets (https://gitlab.kitware.com/cmake/cmake/issues/16363).

I've implemented the support using POST_BUILD steps wrapped under a CMake version check with a TODO so that we can track the fix.

Reviewers: tfiala, zturner, spyffe

Subscribers: lldb-commits, mgorny

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

llvm-svn: 284250
2016-10-14 17:09:55 +00:00
Vadim Macagon 4b7bb3cc96 [LLDB-MI] Minor cleanup of CMICmnLLDBUtilSBValue class
Summary:
Placeholder c-strings don't need to be instance variables.

Reviewers: ki.stfu, abidh

Subscribers: lldb-commits

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

llvm-svn: 284231
2016-10-14 12:58:02 +00:00
Jim Ingham f70847deef This test passes on i386 now.
llvm-svn: 284183
2016-10-14 01:11:19 +00:00
Jim Ingham f5afb8bd80 This test is passing on i386 now.
llvm-svn: 284182
2016-10-14 01:03:03 +00:00
Richard Chamberlain a0c82e18d5 [lldb] Improve identification of Linux core dumps. Fix for bug #30485.
Summary:
ObjectFileELF::RefineModuleDetailsFromNote() identifies Linux core dumps by searching for
 library paths starting with /lib/x86_64-linux-gnu or /lib/i386-linux-gnu. This change widens the
test to allow for linux installations which have addition directories in the path.

Reviewers: ted, hhellyer, clayborg

Subscribers: lldb-commits

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

llvm-svn: 284114
2016-10-13 12:11:00 +00:00
Vadim Macagon bdff2dc8d7 Fix Python binding generation build step on Windows
Summary:
If Python is installed to a location that contains spaces
(e.g. "C:\Program Files\Python3") then the build fails while attempting
to run the modify-python-lldb.py script because the path to the Python
executable is not double-quoted before being passed to the shell. The
fix consists of letting Python handle the formatting of the command
line, since subprocess.Popen() is perfectly capable of handling paths
containing spaces if it's given the command and arguments as a list
instead of a single pre-formatted string.

Reviewers: zturner, clayborg

Subscribers: lldb-commits

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

llvm-svn: 284100
2016-10-13 04:07:22 +00:00
Chris Bieneman e549894b7d [CMake] Cleanup check-lldb targets
Summary:
This patch adds the following fixes to the check-lldb targets:

* Adds missing dependencies on lldb tools so they get built before tests execute
* Adds Ninja USES_TERMINAL to the target so that the output streams to stdout as it executes
* Uses a generator expression to find the lldb executable, this is more robust than constructing the path manually

Reviewers: tfiala, zturner

Subscribers: mgorny, lldb-commits

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

llvm-svn: 284046
2016-10-12 20:26:13 +00:00
Chris Bieneman 47df0196b8 Use LLDB_SRC for relative paths
Summary:
Going from LLDB_SRC instead of the file path is safer when looking for compiler-rt. Also need to add support for looking inside the LLVM runtimes subdirectory.

Eventually we should just get CMake to provide these paths during configuration.

Reviewers: tfiala, zturner

Subscribers: lldb-commits

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

llvm-svn: 284045
2016-10-12 20:24:42 +00:00
Chris Bieneman c6667075b3 Fix test suite lookup path for LLDB.h
Summary:
When running on Darwin, the test suite assumes a specific directory structure for the build directory. This works for the Xcode project builds, but fails for CMake builds regardless of whether or not you are generating the LLDB framework.

This patch allows the Darwin code path to fall back to the more generic code path used by other platforms in the event that LLDB.h isn't where the test suite expects it.

This allows API tests to run on Darwin when building with CMake with the framework build enabled or disabled.

Reviewers: tfiala, zturner

Subscribers: labath, lldb-commits

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

llvm-svn: 284043
2016-10-12 20:22:02 +00:00
Chris Bieneman 4c63acc39e Fix building tests without system headers on Darwin
Summary: Default installations of OS X do not have system headers installed at /usr/include. This patch allows the LLDB test executables to properly compile when built on a system without headers at /usr/include by specifying a default value for the apple-sdk flag as "macosx".

Reviewers: tfiala, zturner

Subscribers: lldb-commits

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

llvm-svn: 284042
2016-10-12 20:19:19 +00:00
Chris Bieneman 35e5457e0c Fix lookup path for lldb-mi
Summary:
The test suite calls realpath on the lldb executable then append "-mi" to it to find the path of the lldb-mi executable. This does not work when using CMake builds on *nix platforms. On *nix platforms when a version number is set on executables CMake generates the binary as ${name}-${version} with a symlink named ${name} pointing to it.

This results in the lldb executable being named lldb-4.0.0, and since lldb-4.0.0-mi doesn't ever match the lldb-mi executable these tests are always disabled.

This patch looks for lldb-mi in the same directory as lldb.

Reviewers: zturner, tfiala

Subscribers: ki.stfu, enlight, lldb-commits

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

llvm-svn: 284041
2016-10-12 20:15:46 +00:00
Nitesh Jain 47a2c55447 [LLDB][MIPS] fix Floating point register read/write for big endian
Reviewers: clayborg, labath, jaydeep

Subscribers: bhushan, slthakur, lldb-commits

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

llvm-svn: 284003
2016-10-12 10:53:57 +00:00
Nitesh Jain 8999edf2f6 [LLDB][MIPS] Fix qProcessInfo to return correct pointer size based on ELF ABI
Reviewers: clayborg, labath

Subscribers: jaydeep, bhushan, slthakur, lldb-commits

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

llvm-svn: 284001
2016-10-12 10:21:09 +00:00
Jason Molenda c4be4be5dd Add an arm64 unit test where the function saves x20 in the
prologue, then loads & stores x20 on the stack from a different
location in the middle of the function, and then restores the
reg in the epilogue.  The saving/restoring of x20 in the middle
of the function should be ignored.

llvm-svn: 283969
2016-10-12 03:53:01 +00:00
Jason Molenda 075605c8d4 Add a simple frameless function test case to the arm64 unwind unit tests
with return statements in the body of the function.

llvm-svn: 283966
2016-10-12 02:46:22 +00:00
Jim Ingham 569bc27843 This test now passes.
llvm-svn: 283959
2016-10-12 00:05:36 +00:00
Jim Ingham 5afd6f7b2e This was skipped due to a clang PR that has been fixed.
llvm-svn: 283957
2016-10-11 23:55:13 +00:00
Jim Ingham 6aa9d1d756 Added a radar on our end for this test's failure.
llvm-svn: 283956
2016-10-11 23:30:38 +00:00
Jim Ingham 7d84aff200 Add the radar number on our end.
llvm-svn: 283940
2016-10-11 21:08:27 +00:00
Jim Ingham 2aa6ef7567 This test now passes.
llvm-svn: 283929
2016-10-11 20:09:40 +00:00
Jim Ingham e8be3ad9b2 Added a bugreport tracking the failure to get float return values
on i386.

llvm-svn: 283923
2016-10-11 19:29:25 +00:00
Sean Callanan 0354a6888f Clarified the explanation of expr --top-level.
llvm-svn: 283904
2016-10-11 16:57:21 +00:00
Pavel Labath 628c5377b0 Fix Arm64InstEmulation tests for windows
MSVC does not like the declaration of a terminate() function (I guess it looks
too much like std::terminate()). While I'm there, move the setup/teardown code
into the functions gtest provides for that purpose.

llvm-svn: 283870
2016-10-11 11:05:34 +00:00
Jason Molenda 086a78cf23 Add a second, more complicated, arm64 example program to
the arm64 assembly unwind tests.

llvm-svn: 283849
2016-10-11 03:44:48 +00:00
Jason Molenda 6853cca1c9 Add a first unit test for the arm64 instruction profiled unwind
plan generator.

Fix a small bug in EmulateInstructionARM64::GetFramePointerRegister
which was returning the stack pointer reg instead of fp, prevented
the unwinder from recognizing the switch to using the fp in a
function. (<rdar://problem/28663117>)

Add a new eContextRestoreStackPointer context hint so that the arm64
emulator can flag when the frame pointer value is copied back in to
the stack pointer and that should be used to compute the canonical
frame address again in an epilogue sequence.  (<rdar://problem/28704862>)

Small changes to UnwindAssemblyInstEmulation to have a method we can
call without a live process/thread/etc for unit tests.

<rdar://problem/28663117> 
<rdar://problem/28704862> 
<rdar://problem/28509178> 

llvm-svn: 283847
2016-10-11 02:24:00 +00:00
Jim Ingham 8e7fe2c741 Fixing the bug number for darwin on this failure.
llvm-svn: 283843
2016-10-11 01:53:43 +00:00
Jim Ingham bc3236ba20 This test was failing because /bin/ls is no longer debuggable on OS X.
Add an executable that we can debug.

llvm-svn: 283835
2016-10-11 00:35:41 +00:00
Jim Ingham dfaf9ccacf Adding radar number on our end for llvm.org/pr15824.
llvm-svn: 283821
2016-10-10 23:31:36 +00:00
Jim Ingham 43f5e983b3 Add the related radar on our end for llvm.org/pr15824.
llvm-svn: 283820
2016-10-10 23:29:01 +00:00
Jim Ingham 400892bd48 Add the radar number on our end.
llvm-svn: 283813
2016-10-10 22:21:47 +00:00
Nitesh Jain 2e2c24d2b2 [LLDB][MIPS] All tests get errors in dotest after this test.
Subscribers: jaydeep, bhushan, slthakur, llvm-commits
llvm-svn: 283739
2016-10-10 10:47:53 +00:00
Nitesh Jain a9b79e666c [LLDB][MIPS] Skip some test case which were causing LLDB to go into infinite loop
Reviewers: clayborg, labath

Subscribers: jaydeep, bhushan, slthakur, llvm-commits

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

llvm-svn: 283732
2016-10-10 10:02:09 +00:00
Nitesh Jain 75e213c985 [LLDB][MIPS] Fix TestReturnValue failure for MIPS
Reviewers: clayborg, labath, bhushan

Subscribers: jaydeep, slthakur, llvm-commits

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

llvm-svn: 283729
2016-10-10 09:16:20 +00:00
Nitesh Jain a160ae8a04 [LLDB][MIPS] Fix register read/write for 32 bit big endian system
Reviewers: clayborg, labath

Subscribers: jaydeep, bhushan, mohit.bhakkad, slthakur, llvm-commits

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

llvm-svn: 283728
2016-10-10 09:02:41 +00:00
Pavel Labath 5d7d305d1c Fix compiler warnings in TestClangASTContext.cpp
llvm-svn: 283652
2016-10-08 04:03:19 +00:00
Pavel Labath 909ce372f2 Fix compiler warnings in PlatformDarwinTest.cpp
llvm-svn: 283651
2016-10-08 04:03:15 +00:00
Zachary Turner 563d7e8a39 Fix a few warnings caught by clang.
llvm-svn: 283607
2016-10-07 21:32:16 +00:00
Sean Callanan 8f04805c9f Remove a stray dump().
<rdar://problem/28635530>

llvm-svn: 283604
2016-10-07 21:25:29 +00:00
Zachary Turner 311a4f0a00 Remove unused variable.
llvm-svn: 283603
2016-10-07 21:23:31 +00:00
Jim Ingham 9aa53a8ced The PR that caused this test ot fail was fixed in July, removing the XFAIL.
llvm-svn: 283578
2016-10-07 18:15:11 +00:00
Valentina Giusti 1c2c728ab1 Fix build failure on lldb-amd64-ninja-freebsd11 error caused by rL283474
Differential Revision: https://reviews.llvm.org/D25362

llvm-svn: 283548
2016-10-07 13:21:59 +00:00
Hal Finkel 752c5bab03 [lit] Don't assume you'll find debugserver
On Linux, there is no "debugserver" process, and the RUN-line substitution will
fail if you try to substitute '%debugserver' with None.

Fixes PR30492.

llvm-svn: 283520
2016-10-07 02:26:41 +00:00
Todd Fiala 4c1ed9d3ca disable TSAN tests on macOS i386
These are erroring out on macOS i386.

Tracked by:
rdar://28659145

llvm-svn: 283497
2016-10-06 21:30:33 +00:00
Zachary Turner 4fa098a5c0 Convert UniqueCStringMap to use StringRef.
llvm-svn: 283494
2016-10-06 21:22:44 +00:00
Todd Fiala 60fb35b20a xfail TestReportData.py on i386
Tracked by:
rdar://28658860

llvm-svn: 283493
2016-10-06 21:16:37 +00:00
Todd Fiala 8e2208b237 xfail TestQueues on macOS
This test is failing on CI.  I cannot get it to fail on my
local setup.

Tracked by:
rdar://28658529

llvm-svn: 283492
2016-10-06 21:07:45 +00:00
Francis Ricci 51019244ab Fix GetDisplayName when only a demangled name is available
Summary:
GetDisplayDemangledName will already return a ConstString() when
there is neither a mangled name or a demangled name, so we don't need to special
case here. This will fix GetDisplayName in cases where m_mangled contains
only a demangled name and not a mangled name.

Reviewers: clayborg, granata.enrico, sas

Subscribers: lldb-commits

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

llvm-svn: 283491
2016-10-06 20:41:11 +00:00
Todd Fiala 83380c2a00 xfail TestSBTypeTypeClass.py on macOS i386
Tracked by:
rdar://28656677

llvm-svn: 283484
2016-10-06 19:23:29 +00:00
Todd Fiala 396bbe3cf5 xfail TestDataFormatterNSIndexPath.py on macOS i386
Tracked by:
rdar://28656605

llvm-svn: 283483
2016-10-06 19:18:48 +00:00
Todd Fiala 50d328b282 xfail TestExec.py on macOS i386
Tracked by:
rdar://28656532

llvm-svn: 283482
2016-10-06 19:12:05 +00:00
Todd Fiala b801095087 xfail TestDiagnoseDereferenceFunctionReturn.py on macOS i386
Tracked by:
rdar://28656408

llvm-svn: 283481
2016-10-06 19:04:58 +00:00
Jim Ingham d35ff4cb0d StringRef::front asserts on empty strings, causing "break modify -c ''" to assert.
Added a check for empty at the point where we were going to crash.

<rdar://problem/28654032>

llvm-svn: 283479
2016-10-06 18:57:30 +00:00
Todd Fiala 81f508012c xfail TestDarwinLogBasic.py for i386 macOS
Tracked by:
rdar://28655626

llvm-svn: 283477
2016-10-06 18:25:54 +00:00
Valentina Giusti 6f8c1f8da7 Add bound violation handling for Intel(R) Memory Protection Extensions (Intel(R) MPX)
Summary:
This patch adds support for handling the SIGSEGV signal with 'si_code ==
SEGV_BNDERR', which is thrown when a bound violation is caught by the
Intel(R) MPX technology.

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

llvm-svn: 283474
2016-10-06 18:05:12 +00:00
Ed Maste 9a605f93a7 Match printf field width arg and type
A '*' as a field width or precision specifies that the field width or
precision is supplied by an int argument.

llvm-svn: 283472
2016-10-06 17:55:22 +00:00
Jim Ingham f4b9659e7c These test cases don't test different debug info formats.
llvm-svn: 283468
2016-10-06 17:01:00 +00:00
Valentina Giusti 0670ad14f8 Improve test for Intel(R) MPX registers.
Summary:
Let the inferior test code determine if CPU and kernel support Intel(R)
MPX and cleanup test script.

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

llvm-svn: 283461
2016-10-06 15:49:10 +00:00
Zachary Turner eb61f388fa Fix build error on Android again.
This one was my fault since I can't compile Android.

llvm-svn: 283414
2016-10-05 23:51:13 +00:00
Zachary Turner 97d2c4011b Convert some Args index-based iteration to range-style iteration.
This is better for a number of reasons.  Mostly style, but also:

1) Signed-unsigned comparison warnings disappear since there is
   no loop index.
2) Iterating with the range-for style gives you back an entry
   that has more than just a const char*, so it's more efficient
   and more useful.
3) Makes code safter since the type system enforces that it's
   impossible to index out of bounds.

llvm-svn: 283413
2016-10-05 23:40:23 +00:00
Jason Molenda d99f947dd1 Add i386/x86_64 tests of the eh_frame augmentation code in the x86
insturction profiling.  Add a test that verifies that we reject a
32-bit only instruction in 64-bit (long) mode.

This wraps up all the testing I want to add for 
x86AssemblyInspectionEngine.

llvm-svn: 283404
2016-10-05 22:37:01 +00:00
Enrico Granata d22a94377f Fixes for libc++ std::unordered_map data formatter against trunk
Fixes rdar://28237467

llvm-svn: 283396
2016-10-05 22:04:43 +00:00
Zachary Turner a01bccdbe6 Convert some more aliasing and CI functions to StringRef.
llvm-svn: 283386
2016-10-05 21:14:56 +00:00
Zachary Turner a483f57942 Update some command aliasing functions to use StringRef.
llvm-svn: 283385
2016-10-05 21:14:49 +00:00
Zachary Turner a449698cdc Convert CommandObject constructors to StringRef.
llvm-svn: 283384
2016-10-05 21:14:38 +00:00
Zachary Turner 9c69bc9776 Fixup the xfail situation on Windows.
Xfails added and/or removed to reflect the current state of Windows.

llvm-svn: 283380
2016-10-05 20:47:17 +00:00
Zachary Turner 11eb9c64a2 Convert various CommandInterpreter functions to StringRef.
llvm-svn: 283370
2016-10-05 20:03:37 +00:00
Luke Drummond b3bbcb1229 Add the ability to set breakpoints on named RenderScript reductions
- Add new `lldb_private::lldb_renderscript::RSReduceBreakpointResolver`
class that can set breakpoints on kernels that are constituent
functions of named reduction groups. Also support debugging of subsets
of the the reduction group with the `-t, --function-role` flag which
takes a comma-separated list of reduction function types
outconverter,combiner,initializer,accumulator (defaults to all)

- Add 2 new helper methods to `RenderScriptRuntime`,
  1. `CreateReductionBreakpoint(name, types)`: instantiates a new
  RSReduceBreakpointResolver and inserts that resolver into the running
  process.
  2. `PlaceBreakpointOnReduction`: which is a public helper function.

- hook up the above functionality to the command-line with new
  `CommandObject*` classes that handle parsing of function roles and
  dispatch to the runtime. These are namespaced under the snappy
  `language renderscript reduction breakpoint ...` subcommand

- [incidental] Factor multiple common uses of
  `FindFirstSymbolWithNameAndType(ConstString(".rs.info")` into static
  `IsRenderScriptScriptModule(ModuleSP module)` function, and replace
  original uses.

llvm-svn: 283362
2016-10-05 19:10:47 +00:00
Zachary Turner 0d4f23c565 Fix some test failures due to the recent Breakpoint patch.
llvm-svn: 283358
2016-10-05 18:40:51 +00:00
Dimitar Vlahovski 36e21a3d56 Removing the new Minidump plugin
Tests are failing and build is failing on windows and darwin.
Will fix and commit it later
-------------------------------------------------------------

Revert "xfailing minidump tests again ... :("
This reverts commit 97eade002c9e43c1e0d11475a4888083a8965044.

Revert "Fixing new Minidump plugin tests"
This reverts commit 0dd93b3ab39c8288696001dd50b9a093b813b09c.

Revert "Add the new minidump files to the Xcode project."
This reverts commit 2f638a1d046b8a88e61e212220edc40aecd2ce44.

Revert "xfailing tests for Minidump plugin"
This reverts commit 99311c0b22338a83e6a00c4fbddfd3577914c003.

Revert "Adding a new Minidump post-mortem debugging plugin"
This reverts commit b09a7e4dae231663095a84dac4be3da00b03a021.

llvm-svn: 283352
2016-10-05 18:11:45 +00:00
Zachary Turner 0debabb3d0 Try to fix Android build.
Seems it doesn't like the implicit conversion from
StringRef[] to ArrayRef<StringRef>.

llvm-svn: 283351
2016-10-05 17:58:46 +00:00
Zachary Turner 401f55df93 Convert some breakpoint code to use StringRef.
Differential revision: https://reviews.llvm.org/D25158

llvm-svn: 283345
2016-10-05 17:07:47 +00:00
Zachary Turner 5a8ad4591b Make lldb -Werror clean on Windows.
Differential Revision: https://reviews.llvm.org/D25247

llvm-svn: 283344
2016-10-05 17:07:34 +00:00
Zachary Turner d6ef28462b Disable warnings in LLDBWrapPython.cpp with -Werror.
When -Werror is used, we don't have control over the generated
code from SWIG, and it often has warnings.  Just disable them for
this file when -Werror is used, they are usually not important
anyway.

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

llvm-svn: 283343
2016-10-05 17:07:16 +00:00
Luke Drummond 80af0b9e3c [RenderScript] reflow/reword some comments and normalize names
Pay more attention to comment alignement (Since _The Great Reformat_ (a015ff50)
comments are no longer properly aligned) and variable naming conventions.

- Manually reflow and cleanup comments and array literals
- Be more economical with our naming conventions
- Be internally consistent with regard to local variable/member function
  naming

llvm-svn: 283335
2016-10-05 16:27:48 +00:00
Dimitar Vlahovski 9078e15aba xfailing minidump tests again ... :(
llvm-svn: 283324
2016-10-05 15:00:29 +00:00
Dimitar Vlahovski c5a4269def Fixing new Minidump plugin tests
llvm-svn: 283321
2016-10-05 14:35:30 +00:00
Luke Drummond 00f56eebcd cleanup RSCoordinate handling and factor out coordinate parser
- This change updates the signature of
`RenderScriptRuntime::PlaceBreakpointOnKernel` to take a default
RSCoordinate pointer of nullptr. We use this as the predicate value for
the breakpoint coordinate rather than trying to fit a sentinel `-1` into
a signed version.

```
- void
- PlaceBreakpointOnKernel(Stream &strm, const char *name, const std::array<int, 3> coords, Error &error,
- lldb::TargetSP target);
```

```
+ bool
+ PlaceBreakpointOnKernel(lldb::TargetSP target, Stream &messages, const char *name,
+ const lldb_renderscript::RSCoordinate *coords = nullptr);
```
The above change makes the API for setting breakpoints on kernels
cleaner as it returns a failure value rather than modify a sentinel in
the caller. The optional arguments are now last and have a default
(falsey) value.

- RSCoordinate objects are now comparable with operator== and have
  zero initializers which should make them easier to work on.
- Added a `FMT_COORD` macro for use in logging format strings which
  should make format strings a little less verbose.

llvm-svn: 283320
2016-10-05 14:34:52 +00:00
Luke Drummond e22098fb35 Delete unused global in ClangExpressionVariable.cpp
Differential Revision: https://reviews.llvm.org/D24793

llvm-svn: 283313
2016-10-05 12:40:49 +00:00
Mehdi Amini 149f6eaed9 Re-commit "Use StringRef in Support/Darf APIs (NFC)"
This reverts commit r283285 and re-commit r283275 with
a fix for format("%s", Str); where Str is a StringRef.

llvm-svn: 283298
2016-10-05 05:59:29 +00:00
Jason Molenda 3fce2fdf4c Change Platform::GetRemoteSharedModule so if it's given a ModuleSpec
which specifies a file path and UUID but not an architecture, open
the file at that path and try every one of the architectures in the
file to see if there is a UUID match.  Currently we'll pick the
first slice of a multi-architecture file and return that as the
match, and when the UUID doesn't match because it's the wrong
architecture, we'll end up ignoring the file.

<rdar://problem/28487804> 

llvm-svn: 283295
2016-10-05 02:29:13 +00:00
Jim Ingham 9ff9713f8a The collision of class C and libsystem_c.dylib:C is a failure
worth preserving, but not essential to the purpose of this test
so I broke it into a separate test.

llvm-svn: 283289
2016-10-05 01:19:15 +00:00
Jim Ingham f5fe75a6e0 This test is failing because there's a global symbol "C" in libsystem_c.dylib,
and that is defeating the lookup of the "struct C" here.  Adding the bug for that.

llvm-svn: 283287
2016-10-05 01:09:43 +00:00
Mehdi Amini 2bcac0fac4 Revert "Re-commit "Use StringRef in Support/Darf APIs (NFC)""
One test seems randomly broken: DebugInfo/X86/gnu-public-names.ll

llvm-svn: 283285
2016-10-05 01:04:02 +00:00
Mehdi Amini 32b297a42f Re-commit "Use StringRef in Support/Darf APIs (NFC)"
This reverts commit r283278 and re-commit r283275 with
the update to fix the build on the LLDB side.

llvm-svn: 283281
2016-10-05 00:37:18 +00:00
Jim Ingham 2e91a9f697 Add the new minidump files to the Xcode project.
llvm-svn: 283276
2016-10-05 00:07:01 +00:00
Dimitar Vlahovski e7439392f1 xfailing tests for Minidump plugin
the tests are failing on the buildbot because there is an extra frame
(maybe) on the call stack.
Will investigate tomorrow.

llvm-svn: 283263
2016-10-04 21:55:47 +00:00
Tamas Berghammer d69faef383 Fix the decorator of TestBreakpointCaseSensitivity
llvm-svn: 283262
2016-10-04 21:32:46 +00:00
Dimitar Vlahovski 8cabfb764d Adding a new Minidump post-mortem debugging plugin
Summary:
This plugin resembles the already existing Windows-only Minidump plugin.
The WinMinidumpPlugin uses the Windows API for parsing Minidumps
while this plugin is cross-platform because it includes a Minidump
parser (which is already commited)

It is able to produce a backtrace, to read the general puprose regiters,
inspect local variables, show image list, do memory reads, etc.

For now the only arch that this supports is x86 64 bit
This is because I have only written a register context for that arch.
Others will come in next CLs.

I copied the WinMinidump tests and adapted them a little bit for them to
work with the new plugin (and they pass)
I will add more tests, aiming for better code coverage.

There is still functionality to be added, see TODOs in code.

Reviewers: labath, zturner

Subscribers: beanz, mgorny, amccarth, lldb-commits, modocache

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

llvm-svn: 283259
2016-10-04 21:02:13 +00:00
Francis Ricci f833f173fb Improvements to testing blacklist
Summary:
This patch is necessary because individual test cases are not required
to have unique names. Therefore, test cases must now
be specified explicitly in the form <TestCase>.<TestMethod>.
Because it works by regex matching, passing just <TestCase> will
still disable an entire file.

This also allows for multiple exclusion files to be specified.

Reviewers: zturner, labath, jingham, tfiala

Subscribers: lldb-commits, sas

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

llvm-svn: 283238
2016-10-04 18:48:00 +00:00
Tamas Berghammer fa262c98f8 Fix FixupEnvironment on Android after the Args refactor
llvm-svn: 283237
2016-10-04 18:35:39 +00:00
Jason Molenda 2630acc0c5 Finish adding the individual instruction tests to the x86 unwinder
unittests.  If I have time, I'd like to see if I can write some
tests of the eh_frame augmentation which is a wholly separate code
path (it seems like maybe it should be rolled into the main instruction
scanning codepath, to be honest, and operate on the generated
UnwindPlan instead of bothering with raw instructions at all).  

Outside the eh_frame augmentation, I'm comfortable that this unwind
generator is being tested well now.

llvm-svn: 283186
2016-10-04 05:10:06 +00:00
Zachary Turner f9fd8cbf22 Fix TestNestedAliases.py
I missed an if/else branch when doing the conversion.

llvm-svn: 283176
2016-10-04 01:34:39 +00:00
Pavel Labath 9b13b5a1d9 Fix test when using remote debugging.
Summary:
Use os.getcwd() instead of get_process_working_directory() as prefix for
souce file.

Reviewers: labath

Subscribers: lldb-commits

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

llvm-svn: 283171
2016-10-04 00:32:20 +00:00
Zachary Turner bbae6a94e8 Try to fix failing tests when running remote test suite.
llvm-svn: 283168
2016-10-04 00:09:44 +00:00
Enrico Granata 038aadd87f Fix the data formatter for std::multiset in libc++ - this is a trivial amount of extra change on top of multimap
Also, proper formatting..

llvm-svn: 283167
2016-10-04 00:07:42 +00:00
Enrico Granata be3be28b5d Changes to the std::multimap formatter to make it work against trunk libc++
Fixes rdar://28237486

llvm-svn: 283160
2016-10-03 23:33:00 +00:00
Zachary Turner 5c28c66f23 Modernize some code related to Args usage / implementation.
Mostly this involves simplifying some logical constructs and using
some ranges instead of index-based iteration.  NFC

llvm-svn: 283159
2016-10-03 23:20:36 +00:00
Zachary Turner 691405be38 Refactor the Args class.
There were a number of issues with the Args class preventing
efficient use of strings and incoporating LLVM's StringRef class.
The two biggest were:

1. Backing memory stored in a std::string, so we would frequently
   have to use const_cast to get a mutable buffer for passing to
   various low level APIs.
2. backing std::strings stored in a std::list, which doesn't
   provide random access.

I wanted to solve these two issues so that we could provide
StringRef access to the underlying arguments, and also a way
to provide range-based access to the underlying argument array
while still providing convenient c-style access via an argv style
const char**.

The solution here is to store arguments in a single "entry" class
which contains the backing memory, a StringRef with precomputed
length, and the quote char.  The backing memory is a manually
allocated const char* so that it is not invalidated when the
container is resized, and there is a separate argv array provided
for c-style access.

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

llvm-svn: 283157
2016-10-03 22:51:09 +00:00
Todd Fiala 44761a6e47 add a simple test case to validate test id()
Since we count on it in a few places, the test verifies that the
test instance has an id() method that returns something non-None.

llvm-svn: 283156
2016-10-03 22:49:13 +00:00
Tim Hammerquist 81dd7dfb25 Fix regex in lldb lit test TestCallStopAndContinue
https://reviews.llvm.org/D25167

llvm-svn: 283082
2016-10-03 00:07:24 +00:00
Chris Bieneman dfa23206a8 [CMake] Fixing a few missing dependencies on intrinsics_gen
These are missing dependencies that have been exposed in builds as a result of my change to make lldb libraries depend on CLANG_TABLEGEN_TARGETS instead of libclang.

llvm-svn: 283081
2016-10-03 00:03:43 +00:00
Pavel Labath 6b582bf91f Revert "XFAIL TestSBData for gcc-4.9 i386"
Test fixed.

llvm-svn: 283069
2016-10-02 15:56:33 +00:00
Dawn Perchik 341e47891b [lldb-mi] Fix prompt which can get inserted in the middle of program output in lldb-mi
Summary: The code added in svn r264332 causes "(lldb) " to be printed in the
middle of program console output. This fix restores the behavior for non-Windows
platforms to before the patch.

Reviewers: ted, zturner, clayborg
Subscribers: amccarth, lldb-commits
Differential Revision: http://reviews.llvm.org/D25137

llvm-svn: 283031
2016-10-01 10:37:56 +00:00
Mehdi Amini 36d33fc109 Use StringRef instead of raw pointers in MCAsmInfo/MCInstrInfo APIs (NFC)
llvm-svn: 283018
2016-10-01 06:46:33 +00:00
Jason Molenda 56f0497bb8 Add unit tests for specific instruction patterns that the x86
assembly inspection class is designed to detect.  This is only about
half of the instructions that it needs to recognize - I'll complete
this in a separate checkin.

The larger full-function style test cases I'd checked in previously
covered nearly all of these already, but I wanted simpler test cases
too, so if they fail in the future, it will be easier to spot the
issue.

llvm-svn: 283010
2016-10-01 04:50:25 +00:00
Jim Ingham a479026012 Fix up this test case.
The lldbutil.run_break_set_by_file_and_line has already checked that the number of 
locations was 1, so don't check it again.  And certainly don't check it again by 
grubbing in break list output.

Also, we know the Thread's IsStopped state is wrong, and have a test for that, so 
don't keep testing it in other files where that isn't the primary thing we're testing.

I removed the xfail for Darwin.  If this also passes on other systems, we can remove
the xfails from them as we find that out.

llvm-svn: 282993
2016-10-01 00:49:12 +00:00
Jason Molenda c0657a6ceb Add support for some extended push instructions in i386/x86_64 like
'push 0x20(%esp)' which clang can generate when emitting
-fomit-frame-pointer code for 32-bit.

Add a unit test program which includes this instruction.

Also fix a bug in the refactoring/rewrite of the x86 assembly
instruction profiler where I'd hard coded it as a 64-bit disassembler
instead of using the ArchSpec to pick a 32-bit or 64-bit disassembler
from llvm.  When the disassembler would hit an instruction
that is invalid in 64-bit mode, it would stop disassembling the function.
This likely led to the TestSBData testsuite failure on linux with 32-bit
i386 and gcc-4.9; I'll test that in a bit.

The newly added unit test program is 32-bit i386 code and it includes
an instruction which is invalid in 64-bit mode so it will catch this.

<rdar://problem/28557876> 

llvm-svn: 282991
2016-10-01 00:19:26 +00:00
Todd Fiala 8cc2bddb32 test infra: clear file-charged issues on rerun of file
This change addresses the corner case bug in the test
infrastructure where a test file times out *outside*
of any running test method.  In those cases, the issue
was charged to the file, not to a test method within
the file.  When that file is re-run successfully,
none of the test-method-level successes would clear
the file-level issue.

This change fixes that: for all test files that are
getting rerun (whether by being marked flaky or
via the --rerun-all-issues flag), file-level test
issues are searched for in each of those files.  Each
file-level issue found in the rerun file list then
gets cleared.

A test of this feature is added to issue_verification,
using the technique there of moving the *.py.park file
to *.py to do an end-to-end validation.

This change also adds a .gitignore entry for pyenv
project-level files and fixes up a few minor pep8
formatting violations in files I touched.

Fixes:
llvm.org/pr27423

llvm-svn: 282990
2016-10-01 00:17:08 +00:00
Jim Ingham 57ec60a842 Fix up the test so it gets closer to passing.
Remove the test for thread stopped states from this test.  
That isn't set properly now, and its setting doesn't matter till we actually support non-stop debugging, so
we shouldn't have unrelated tests failing from it.

Also changed some code that was trying and failing to grub command line output, and replaced
it by SB API calls.

llvm-svn: 282976
2016-09-30 22:55:57 +00:00
Jim Ingham fad073a6ab Add the radar on our end to the bugreport string.
llvm-svn: 282970
2016-09-30 22:24:11 +00:00
Jim Ingham a2773357c4 Add the radar from our end to the bugreport string.
llvm-svn: 282969
2016-09-30 22:22:09 +00:00
Jim Ingham 8231b05c7d IsValid is the way to ask a breakpoint location whether it is valid.
llvm-svn: 282966
2016-09-30 22:07:41 +00:00
Sean Callanan 9c2cd9aadc Adding ivars in class extensions isn't supported on i386; skip a test.
llvm-svn: 282943
2016-09-30 20:46:09 +00:00
Dawn Perchik 9d9474ba35 Fix comment - Module::PrepareForFunctionNameLookup should be Module::LookupInfo::LookupInfo.
llvm-svn: 282941
2016-09-30 20:38:33 +00:00
Sean Callanan f9c622adfc Fixed several i386 Objective-C tests by completing objects, not their pointers.
llvm-svn: 282898
2016-09-30 18:44:43 +00:00
Adrian McCarthy 5908249840 Add namespace qualifiers for UTF functions that just moved.
llvm-svn: 282871
2016-09-30 16:11:42 +00:00
Sean Callanan 64bf0509f6 Skip TestRuntimeIvars on i386; the Objective-C V1 runtime doesn't list ivars.
llvm-svn: 282869
2016-09-30 16:02:28 +00:00
Dimitar Vlahovski 17d9caf665 Again fixing windows build breakage like in rL282862
llvm-svn: 282866
2016-09-30 15:41:33 +00:00
Dimitar Vlahovski 7ca05307c9 Fixing windows build breakage caused by rL282822
The breakage was because of the moving of the UTF functions to the llvm
namespace

llvm-svn: 282862
2016-09-30 14:36:17 +00:00
Pavel Labath f85ac77c9f XFAIL TestSBData for gcc-4.9 i386
test broken in r282659.

llvm-svn: 282849
2016-09-30 12:12:15 +00:00