Commit Graph

12713 Commits

Author SHA1 Message Date
Jim Ingham 0ca778eb2e Make the source-map help grammatical.
llvm-svn: 247709
2015-09-15 18:03:00 +00:00
Daniel Sanders 32764b5917 Fix build after llvm r247683 was reverted.
llvm-svn: 247703
2015-09-15 16:33:17 +00:00
Tamas Berghammer f304d5eb2b Skip TestGoASTContext on remote targets as it it not remote compatible
llvm-svn: 247690
2015-09-15 14:04:52 +00:00
Pavel Labath 360a543d04 Fix build after llvm r247683
llvm-svn: 247687
2015-09-15 13:49:10 +00:00
Bruce Mitchener 7dd8c12d84 [lldb-mi] Clean up CMICmdArgSet usage.
Summary:
CMICmdArgSet stores a vector of non-const pointers to the arguments
that it is validating. It owns them and is responsible for deleting
them.

We don't need to pass a const reference to the argument to
CMICmdArgSet::Add and then take the address and const_cast it
when we can just pass the argument pointer in directly.

This lets us remove some noise at every call site for CMICmdArgSet::Add
and then clean up a couple of bits inside CMICmdArgSet to remove
const_casts.

Reviewers: abidh, ki.stfu, domipheus

Subscribers: lldb-commits

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

llvm-svn: 247677
2015-09-15 12:00:08 +00:00
Bruce Mitchener 3be88564e9 [lldb-mi] Simplify CMICmnLLDBDebugSessionInfo::Shutdown.
Summary:
* SharedDataDestroy couldn't fail, so no need to return a status.
* No need for status, so can remove error message. The error message
  wasn't displayed or used anywhere anyway.

Reviewers: abidh, ki.stfu

Subscribers: lldb-commits

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

llvm-svn: 247673
2015-09-15 10:36:08 +00:00
Tamas Berghammer 41b1f73122 Add support for DW_OP_GNU_const_index to dwarf expression
DW_OP_GNU_const_index is a new opcode used when split dwarf is enabled

Differential revision: http://reviews.llvm.org/D12849

llvm-svn: 247672
2015-09-15 10:33:54 +00:00
Tamas Berghammer d536a6d9dc Fix several issues arount dwo symbol file handling
Differential revision: http://reviews.llvm.org/D12804

llvm-svn: 247671
2015-09-15 10:33:41 +00:00
Bhushan D. Attarde 1bcc7bac8f [LLDB][MIPS] Add support for DT_MIPS_RLD_MAP_REL
SUMMARY:
    This patch provides support for MIPS specific DT_MIPS_RLD_MAP_REL tag in LLDB.
    This tag allows debugging of MIPS position independent executables and provides access to shared library information.

    Reviewers: clayborg
    Subscribers: mohit.bhakkad, sagar, jaydeep, lldb-commits
    Differential Revision: http://reviews.llvm.org/D12794

llvm-svn: 247666
2015-09-15 05:45:29 +00:00
Todd Fiala d089060d87 Mark TestMultipleDebuggers as flakey on Darwin.
See if this gets us past a few machines that are failing it when
it is expected to pass.

llvm-svn: 247665
2015-09-15 05:31:27 +00:00
Todd Fiala 25bddd3b52 Fixed up TestConstVariables for Linux/FreeBSD, take 2.
Marked XFAIL for:
clang - all versions < 3.5.  I verified the first version it passes on Linux is 3.5.
clang - version 3.7 (verified this fails)
clang - TOT/3.8 (verified this currently fails)

Ideally we dig into why this started failing and (hopefully) get this passing again.

llvm-svn: 247664
2015-09-15 04:53:14 +00:00
Bruce Mitchener b0f54b8b31 Coding style fix.
llvm-svn: 247663
2015-09-15 04:50:56 +00:00
Bruce Mitchener 500737e694 Use uint64_t for GoArray size.
Summary:
This was int64_t, but all usages of it came from code that was passing
in unsigned values. The usages of the array size, except for one, were
also treating it as an unsigned value.  The usage that treated it as
signed was to try to figure out if it was a complete type or not, but
the callers creating the array didn't seem to be aware of using -1 as
an indicator for an incomplete array.

Reviewers: ribrdb, clayborg

Subscribers: lldb-commits

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

llvm-svn: 247662
2015-09-15 04:33:48 +00:00
Chaoren Lin cadbf3dcf8 Revert "Fixup XFAIL marking on TestConstVariables for clang version"
Summary:
Linux with ToT clang (3.8) fails.

This reverts commit r247633.

Reviewers: tfiala

Subscribers: lldb-commits

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

llvm-svn: 247648
2015-09-15 00:52:00 +00:00
Ryan Brown d03c2e0051 Fix error on windows:
c:\buildbot\lldb-windows-x86\lldb-windows-x86\llvm\tools\lldb\source\symbol\goastcontext.cpp(906) : warning C4715: 'lldb_private::GoASTContext::GetBitSize' : not all control paths return a value
c:\buildbot\lldb-windows-x86\lldb-windows-x86\llvm\tools\lldb\source\symbol\goastcontext.cpp(1175) : error C4716: 'lldb_private::GoASTContext::ConvertStringToFloatValue' : must return a value

llvm-svn: 247647
2015-09-15 00:50:43 +00:00
Greg Clayton 6c6eab162a Avoid a crash in the test suite where if we have a ObjC "id" type and we ask it for the PointeeType() we would get a CompilerType with a valid TypeSystem, but invalid opaque type, and ClangASTContext::IsClangType() previously would return true saying that it was a valid clang type and it would crash in removing qualifiers from a clang::QualType that was constructed with an NULL opaque type.
llvm-svn: 247641
2015-09-14 23:55:01 +00:00
Todd Fiala 6d4742d8a1 Marked TestEvents test as flakey on Linux.
It's passing all the time for me (50/50), and was passing what
looks like 9/10 times for the originator.

llvm-svn: 247639
2015-09-14 23:35:00 +00:00
Greg Clayton 4bc6f19e77 Darwin has a debug info format that stores module types in stand alone files and it uses some of the DWO attributes. Don't assert in SymbolFileDWARFDwo, just return null so everything works.
llvm-svn: 247638
2015-09-14 23:34:26 +00:00
Todd Fiala 8ef7a5b4b7 Fixup XFAIL marking on TestConstVariables for clang version
Linux/clang on clang 3.6+ is passing this test.  As OS X was
in a similar position, I'm guessing this was fixed by a recent
compiler.  Might work on 3.5/3.4, but it is definitely working
on clang 3.6.  I didn't break out FreeBSD since this appears to
be related to a compiler fix.

llvm-svn: 247633
2015-09-14 23:17:15 +00:00
Greg Clayton 73781e7557 Fix the Xcode project to compile Cocoa.cpp instead of Coca.cpp.
llvm-svn: 247631
2015-09-14 22:57:25 +00:00
Greg Clayton c892672ffd Remove include that isn't needed.
llvm-svn: 247630
2015-09-14 22:56:46 +00:00
Ryan Brown 57bee1edfc Add a TypeSystem for Go
Add GoASTContext and DWARFASTParserGo to support go.

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

llvm-svn: 247629
2015-09-14 22:45:11 +00:00
Chaoren Lin 3e13005031 Fix CMake build.
- Typo: Coca.cpp -> Cocoa.cpp
- Missing include.

llvm-svn: 247628
2015-09-14 22:39:34 +00:00
Enrico Granata 170c395e70 Move Objective-C data formatters to the Objective-C language plugin where they belong
llvm-svn: 247627
2015-09-14 22:18:32 +00:00
Sean Callanan 85aabaf935 ClangExpressionDeclMap should only disable the Clang parser-specific state on
Clang persistent variables.

llvm-svn: 247615
2015-09-14 21:03:44 +00:00
Todd Fiala ff1fa40cdf Final unexpected success cleanup for OS X.
Top of tree is running with no unexpected successes with this
change, on latest available El Capitan and Xcode betas.

llvm-svn: 247608
2015-09-14 20:16:34 +00:00
Todd Fiala a22006183f Fixes lldb-server commandline test xpass for OS X and Linux; resolves llvm.org/pr20273
llvm-svn: 247605
2015-09-14 19:53:00 +00:00
Todd Fiala a85feabe3a Another round of macosx unexpected success corrections.
llvm-svn: 247602
2015-09-14 19:25:22 +00:00
Todd Fiala 7b6fbcf365 OS X unexpected success cleanup
TestPersistObjCPointeeType and TestObjCNewSyntax marked up to expect
success on clang >= 7.0.0.

TestMultipleDebuggers passed 25/25 times, taking off intermittent.
If this changes, I'll make sure it goes into a flaky/flakey category.

llvm-svn: 247601
2015-09-14 19:12:56 +00:00
Ed Maste a5f384487a Remove expectedFailureFreeBSD from now-passing test
ExprCommandCallUserDefinedFunction::test_with_dwarf

llvm.org/pr20274

llvm-svn: 247596
2015-09-14 18:50:23 +00:00
Ed Maste 6052b4cd02 Correct XFAIL OS list after r247576
In ConstVariableTestCase::test_with_dwarf_and_run_command - the test
fails with Clang (and presumably ICC) also on FreeBSD.

llvm-svn: 247594
2015-09-14 18:40:52 +00:00
Todd Fiala f9fe8b8d49 Fix up bad compiler spec on ConstVariableTestCase; fixup two more OS X unexpected successes.
llvm-svn: 247591
2015-09-14 18:34:36 +00:00
Jim Ingham a2fcee9cba Remove a debugging printf that got left in SymbolFileDWARFDebugMap.
llvm-svn: 247589
2015-09-14 18:28:28 +00:00
Stephane Sezer e0f603fad5 Use SI_KERNEL on platforms defining it
Summary:
Linux and FreeBSD occasionally send SI_KERNEL codes, nonexistent on other platforms.

Problem caught on NetBSD.

Reviewers: joerg, sas

Subscribers: sas, lldb-commits, emaste

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

Change by Kamil Rytarowski <n54@gmx.com>

llvm-svn: 247579
2015-09-14 16:51:58 +00:00
Todd Fiala 5c37863daf Cleaned up a few unexpected successes on OS X
TestCallStdStringFunction
TestCallWithTimeout
TestConstVariables
TestClassTypes

llvm-svn: 247576
2015-09-14 16:25:34 +00:00
Pavel Labath 11282dcac6 Skip TestBatchMode for remote platforms
the test does not know how to run executables on the remote platform.

llvm-svn: 247574
2015-09-14 16:11:11 +00:00
Tamas Berghammer f8fd9b5263 Fix a possible SEGV in SymbolFileDWARF
The iterator pointing to an element of a dense map was used after
the element from was removed from the map what isn't guaranteed to be
valid at that time.

llvm-svn: 247571
2015-09-14 15:44:29 +00:00
Ed Maste 37366e5698 The pipe2(2) call is supported on NetBSD
Patch by Kamil Rytarowski.

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

llvm-svn: 247568
2015-09-14 15:12:49 +00:00
Todd Fiala e68a15e7bc Removed XFAIL marker from passing tests, rdars 18684124, 15367233
Related to these two test case classes:
test/driver/batch_mode/TestBatchMode.py
test/functionalities/inferior-assert/TestInferiorAssert.py

llvm-svn: 247567
2015-09-14 14:48:53 +00:00
Ed Maste 703c30904e Add expectedFlakeyFreeBSD to TestMultithreaded tests
One or more of these tests failed in 25 of 100 dotest.py runs.

llvm-svn: 247566
2015-09-14 14:42:22 +00:00
Ed Maste 32868feeee Enable StopHookForMultipleThreadsTestCase::test_stop_hook_multiple_threads_with_dwarf on FreeBSD
This test passes locally but was disabled due to pexpect issues on the
FreeBSD buildbot. That buildbot has been retired as it was overloaded,
and we will investigate again if this fails once a new buildbot is in
place. Noted by John Wolfe.

llvm.org/pr22784

This re-applies r247013.

llvm-svn: 247565
2015-09-14 14:41:58 +00:00
Ed Maste 906d7be922 Remove expectedFailureFreeBSD from passing test_inferior_asserting_disassemble
llvm.org/pr18533

llvm-svn: 247564
2015-09-14 14:40:22 +00:00
Ed Maste e1daedfbb4 Remove expectedFailureFreeBSD from passing test_with_dwarf_formatters_api
llvm.org/pr24282

llvm-svn: 247563
2015-09-14 14:31:46 +00:00
Ed Maste 149a352eb3 Remove expectedFailureFreeBSD from passing test_process_list
This test passes locally but was marked XFAIL due to failures on the
FreeBSD buildbot. That buildbot has been retired as it was overloaded,
and we will investigate again if this fails once a new buildbot is in
place.

llvm.org/pr23747

llvm-svn: 247562
2015-09-14 14:27:05 +00:00
Ed Maste 1b3f13d776 Move RegisterContextPOSIX.h to FreeBSD subdir
It is now used only by the FreeBSD in-process ptrace implementation.

llvm-svn: 247561
2015-09-14 14:20:56 +00:00
Ed Maste fee8ace132 Limit scope of RegisterContextPOSIX.h header
RegisterContextPOSIX.h is poorly named and contains only the declaration
of POSIXBreakpointProtocol, which is used for in-process live kernel
debugging. It is now relevant only to FreeBSD.

In source/Plugins/Process/Utility/RegisterContext*.h (after assorted
rework and refactoring) it only served the purpose of #including other
necessary headers as a side-effect. Remove it from them and just include
the required headers directly.

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

llvm-svn: 247558
2015-09-14 13:16:59 +00:00
Pavel Labath 7cc26d1765 Remove XTIMEOUT from TestChangeProcessGroup on linux
llvm-svn: 247552
2015-09-14 12:31:47 +00:00
Pavel Labath d6a8ca6ec3 Switch default disposition of realtime signals
Summary:
Realtime signals generally do not represent an error condition in an application but are more
like a regular means of IPC. As such, we shouldn't interrupt an application whenever it recieves
one. If any application will use these signals, it will probably use them a lot, rendering it's
debugging tiresome if we stopped at every signal. Furthermore, these signals are likely to be used
in a low level library, and the programmer may not even be aware of their presence.

For these reasons, I am switching the default disposition of realtime signals on all supported
platforms (i.e. Linux and Freebsd) to no-stop, no-notify. Any user still wishing to receive these
signals can always change the default to suit his needs.

Reviewers: ovyalov, emaste

Subscribers: lldb-commits, emaste

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

llvm-svn: 247537
2015-09-14 09:05:43 +00:00
Zachary Turner 14181dbb57 Fix a thinko causing test logs for crashes to not get written.
llvm-svn: 247479
2015-09-11 21:27:37 +00:00
Oleksiy Vyalov b00792e2dc Add missed import lldbtest.
llvm-svn: 247469
2015-09-11 20:46:46 +00:00
Zachary Turner 9c7b08e609 XFAIL miscellaneous tests on windows.
llvm.org/pr24778

llvm-svn: 247460
2015-09-11 20:01:24 +00:00
Zachary Turner 3109990048 XFAIL 2 breakpoint tests on Windows.
llvm.org/pr24777

llvm-svn: 247459
2015-09-11 20:00:39 +00:00
Zachary Turner 0df2865083 XFAIL some more tests related to value api
llvm.org/pr24772

llvm-svn: 247458
2015-09-11 20:00:25 +00:00
Zachary Turner db8201f11c XFAIL TestDisassembleBreakpoint.
This is a trivial issue to fix, just marking it for later.
Windows prints function signatures a bit differently, and the
test expects a specific format.

llvm-svn: 247457
2015-09-11 20:00:09 +00:00
Zachary Turner 608cb82e46 XFAIL tests that try to call a function in the inferior.
llvm.org/pr21765

llvm-svn: 247456
2015-09-11 20:00:00 +00:00
Zachary Turner 6e8cbc0ff2 XFAIL some C++ language specific tests on Windows.
http://llvm.org/pr24764

llvm-svn: 247455
2015-09-11 19:59:39 +00:00
Stephane Sezer 9187e73bda Fix a small typo in ObjectFileELF.cpp.
llvm-svn: 247452
2015-09-11 18:56:59 +00:00
Ed Maste 8bc3f5cd50 Demote TestAttachResume back to @expectedFailureFreeBSD
It turns out it fails consistently for me.

llvm.org/pr19310

llvm-svn: 247411
2015-09-11 13:43:07 +00:00
Bruce Mitchener 13ce0fd140 [lldb-mi] No need to call Format with no varargs.
Summary:
There's no need to call CMIUtilString::Format
with a string and no args.

Reviewers: abidh, ki.stfu

Subscribers: lldb-commits

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

llvm-svn: 247403
2015-09-11 11:17:30 +00:00
Bruce Mitchener 82fd1f7d6c Clean up build of JITLoader/GDB in autoconf build.
Summary:
This builds on all platforms, so remove duplication in build
configuration.

Reviewers: labath, clayborg, emaste

Subscribers: lldb-commits

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

llvm-svn: 247402
2015-09-11 10:37:17 +00:00
Tamas Berghammer c7776e4139 Improve the arm/aarch64 mapping symbol handling
Change the mapping symbol handling to handle the case when the mapping
symbols are prefixed with an arbitrary prefix. This isn't strictly standard
compliance, but if all symbols in an object file is prefixed with objcopy
then the prefix will be added to the mapping symbol also. We still want to
treat these symbols as mapping symbols to get the correct address class data.

Differential revision: http://reviews.llvm.org/D12755

llvm-svn: 247400
2015-09-11 10:04:00 +00:00
Bruce Mitchener 6a706b7055 [lldb-mi] Fix failure in log file initialization.
I broke this in r247388.

llvm-svn: 247390
2015-09-11 08:02:50 +00:00
Bruce Mitchener cf1baae6b8 [lldb-mi] Remove MIUtilSystem*.
Summary:
This platform-specific code wasn't fully implemented and wasn't
actually needed. There was one call for the log file path and
that has been addressed.

This lets us also remove an error message from MICmnLogMediumFile
as it is no longer used.

Reviewers: ki.stfu, domipheus, abidh

Subscribers: lldb-commits

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

llvm-svn: 247388
2015-09-11 04:50:44 +00:00
Bruce Mitchener 8385ea602d Link liblldb.so with LLVMObjCARCOpts.a
Summary:
Problems reported on NetBSD:

```
llvm[4]: Linking Debug+Asserts executable lldb
/tmp/build-llvm/Debug+Asserts/lib/liblldb.so: undefined reference to `llvm::createObjCARCExpandPass()'
/tmp/build-llvm/Debug+Asserts/lib/liblldb.so: undefined reference to `llvm::createObjCARCOptPass()'
/tmp/build-llvm/Debug+Asserts/lib/liblldb.so: undefined reference to `llvm::createObjCARCAPElimPass()'
/tmp/build-llvm/Debug+Asserts/lib/liblldb.so: undefined reference to `llvm::createObjCARCContractPass()'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
 /tmp/llvm/Makefile.rules:1434: recipe for target '/tmp/build-llvm/Debug+Asserts/bin/lldb' failed
```

Reviewers: joerg, sas

Subscribers: brucem, sas, lldb-commits

Change by Kamil Rytarowski <n54@gmx.com>

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

llvm-svn: 247383
2015-09-11 03:52:08 +00:00
Bruce Mitchener b56c8bce32 Clean up building & linking of Process/elf-core.
Summary:
* cmake/LLDBDependencies.cmake: elf-core is already included
  globally in LLDB_USED_LIBS, so it doesn't need to be re-added
  on individual platforms.

* lib/Makefile: elf-core is linked on each platform, so move it
  to the global list of used libraries.

* source/Plugins/Makefile: elf-core is built on each platform, so
  move it to the global list of things to build.

Reviewers: clayborg, labath

Subscribers: lldb-commits

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

llvm-svn: 247366
2015-09-11 00:31:33 +00:00
Greg Clayton 886c7d42df A little more cleanup in the build script that creates a list of archive directories to make things more clear.
llvm-svn: 247329
2015-09-10 19:46:25 +00:00
Bruce Mitchener 809b860bd3 Build Plugin/JITLoader/GDB on all platforms.
Summary:
We currently link to this on all platforms, so don't need to re-include
it into the LLDB_USED_LIBS. Also don't need to special case building
it for every supported platform.

Reviewers: clayborg, labath

Subscribers: lldb-commits

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

llvm-svn: 247284
2015-09-10 14:28:49 +00:00
Tamas Berghammer bb97321003 Fix crash in lldb-server caused by an API change in LLVM
llvm-svn: 247267
2015-09-10 11:08:41 +00:00
Ewan Crawford 7dc7771cd5 New RenderScript command to break on all kernels
Patch adds a command to RenderScript plugin allowing users to automatically set breakpoints on every RS kernel.

Command syntax is 'language renderscript kernel breakpoint all <enable/disable>.'
Enable sets breakpoints on all currently loaded kernels, and any kernels which will be loaded in future.
Disable results in breakpoints no longer being set on loaded kernels, but doesn't affect existing breakpoints.

Current command 'language renderscript kernel breakpoint' is changed to 'language renderscript kernel breakpoint set'

Reviewed by: clayborg, jingham
Subscribers: lldb-commits, ADodds, domipheus
Differential Revision: http://reviews.llvm.org/D12728

llvm-svn: 247262
2015-09-10 10:08:48 +00:00
Ilia K dae2e564d8 Fix an AttributeError in dotest.py if --executable points to a wrong place
This patch fixes the following case:
```
  $ ./dotest.py --executable=~/p/llvm/build_ninja/bin/lldb tools/lldb-mi/
  '~/p/llvm/build_ninja/bin/lldb' is not a path to a valid executable
  Traceback (most recent call last):
    File "./dotest.py", line 1306, in <module>
      setupSysPath()
    File "./dotest.py", line 1004, in setupSysPath
      if not lldbtest_config.lldbExec:
  AttributeError: 'module' object has no attribute 'lldbExec'
```

And with this fix:
```
  $ ./dotest.py --executable=~/p/llvm/build_ninja/bin/lldb tools/lldb-mi/
  '~/p/llvm/build_ninja/bin/lldb' is not a path to a valid executable
  The 'lldb' executable cannot be located.  Some of the tests may not be run as a result.
```

llvm-svn: 247256
2015-09-10 09:24:43 +00:00
Greg Clayton a865b80c5a Removed debug prints that I accidentally left in.
llvm-svn: 247227
2015-09-10 00:57:34 +00:00
Greg Clayton a93877b9dc On MacOSX, revamp the way we link against the llvm/clang .a files by making a text file that contains all .a filenames and use that when linking in Xcode.
llvm-svn: 247224
2015-09-10 00:48:44 +00:00
Stephane Sezer eee657045f Fix a small comment typo in Windows Process code.
llvm-svn: 247206
2015-09-09 22:58:23 +00:00
Greg Clayton 140038a4ee Fix the build-llvm.pl to not create one monster .a file from all of the llvm and clang .a files. We now just make a file list which we pass to the linker.
llvm-svn: 247202
2015-09-09 22:35:25 +00:00
Enrico Granata ac49453b58 Introduce the notion of an escape helper. Different languages have different notion of what to print in a string and how to escape non-printable things. The escape helper is where this notion is provided to LLDB
This is NFC, other than a code re-org

llvm-svn: 247200
2015-09-09 22:30:24 +00:00
Greg Clayton 13f11bba7d Remove unused function.
llvm-svn: 247197
2015-09-09 22:13:36 +00:00
Greg Clayton 34e2180a00 Now that CompilerType uses a "TypeSystem *" and a "void *" instead of a "clang::ASTContext *" and a "void *", we need to know if anyone is trying to create a CompilerType from a clang::ASTContext that has no backing ClangASTContext.
This assert will fire if this is the case and we will need to fix the offending code.

llvm-svn: 247196
2015-09-09 22:13:01 +00:00
Enrico Granata a4846c8524 Remove Target::GetBasicType()
I was experimenting with it briefly, and then settled on Target::GetTypeSystem + TypeSystem::GetBasicType, so this API is not necessary to have

Thanks to Ryan Brown for bringing it to my attention

llvm-svn: 247195
2015-09-09 22:00:18 +00:00
Greg Clayton 51c63e3b30 Remove a call to deleted function.
llvm-svn: 247193
2015-09-09 21:34:32 +00:00
Ed Maste 81f3ccb505 For now skip ThreadSpecificBreakTestCase on FreeBSD
It often hangs or times out, and obscures issues with other tests.
Just skip it for now (until the FreeBSD test suite is producing
consistent results) so that we can get a buildbot back.

Previous investigation (for failures) in llvm.org/pr18522

llvm-svn: 247190
2015-09-09 21:00:10 +00:00
Enrico Granata ad650a189c Preparatory work for letting language plugins help the StringPrinter with formatting special characters
llvm-svn: 247189
2015-09-09 20:59:49 +00:00
Greg Clayton aa61a1563b Make sure to flush the stream to make sure the string is up to date when we query its size.
llvm-svn: 247175
2015-09-09 18:41:50 +00:00
Zachary Turner 1132152db4 Don't allow duplicate names for tests.
We had 2 tests named TestCPPBreakpoints.py.  If one of those tests
failed, both of them would be reported as failures and contribute
to the failure count.  There may be other examples of duplicate
test names, and we should fix those as we find them.

llvm-svn: 247173
2015-09-09 18:25:13 +00:00
Zachary Turner 84f5b0df8e Fix some compiler warnings.
llvm-svn: 247164
2015-09-09 17:25:43 +00:00
Ed Maste d7b073e0aa Update expectedFailureFreeBSD to expectedFlakeyFreeBSD for intermittent tests
Due to LLDB or test race conditions these tests do not pass
consistently.

llvm.org/pr15037
llvm.org/pr19310
llvm.org/pr22611

llvm-svn: 247143
2015-09-09 13:15:14 +00:00
Ed Maste bfd03da5ba XFAIL TestFormatters on FreeBSD
The test is hitting an assertion in Clang.  This is an extension of
r246766.

llvm.org/pr24691

llvm-svn: 247141
2015-09-09 13:10:33 +00:00
Tamas Berghammer 3366f0b42f Fix type in include header name
llvm-svn: 247137
2015-09-09 11:28:52 +00:00
Tamas Berghammer bc99ce88f5 Add missing include after rL247131
llvm-svn: 247135
2015-09-09 11:16:32 +00:00
Mohit K. Bhakkad 9514a383c8 [LLDB][MIPS] Added support for the debugging of N32/O32 applications on MIPS64 target.
Patch by Nitesh Jain

Reviewers: clayborg, ovyalov.
Subscribers: jaydeep, bhushan, mohit.bhakkad, sagar, nitesh.jain, lldb-commits.
Differential Revision: http://reviews.llvm.org/D12671

llvm-svn: 247134
2015-09-09 10:32:20 +00:00
Tamas Berghammer 025103cc61 Change the looping stack detection code
In some special case (e.g. signal handlers, hand written assembly) it is
valid to have 2 stack frame with the same CFA value. This CL change the
looping stack detection code to report a loop only if at least 3
consecutive frames have the same CFA.

Differential revision: http://reviews.llvm.org/D12699

llvm-svn: 247133
2015-09-09 10:26:50 +00:00
Tamas Berghammer eb882fc1f8 Add basic fission support to SymbolFileDWARF
* Create new dwo symbol file class
* Add handling for .dwo sections
* Change indexes in SymbolFileDWARF to store compile unit offset next to
  DIE offset
* Propagate queries from dwarf compile unit to the dwo compile unit
  where applicable

Differential revision: http://reviews.llvm.org/D12291

llvm-svn: 247132
2015-09-09 10:20:48 +00:00
Tamas Berghammer 715cbe8939 Code cleanup in preparation of adding split dwarf support
* Remove some unused code
* Remove usage of DWARFDebugInfoEntry::Attributes where usage isn't
  reasonable
* Cleanup DWARFMappedHash with separating it to header and implementation
  file and fixing the visibility of the functions

Differential revision: http://reviews.llvm.org/D12374

llvm-svn: 247131
2015-09-09 10:20:36 +00:00
Tamas Berghammer 1535bebac6 Remove the dwo files in the cleanup stage of the tests
The dwo files are generated when the tests run with split dwarf info.

llvm-svn: 247130
2015-09-09 10:20:30 +00:00
Mohit K. Bhakkad a73239f860 [LLDB][MIPS] MIPS load/store instruction emulation for hardware watchpoints
Reviewers: clayborg.
Subscribers: jaydeep, bhushan, sagar, nitesh.jain, lldb-commits.
Differential Revision: http://reviews.llvm.org/D12670

llvm-svn: 247129
2015-09-09 10:17:58 +00:00
Hafiz Abid Qadeer 87f4f413ba Remove an invalid check in DW_OP_piece processing.
Summary:
When lldb is processing a location containing DW_OP_piece, the result is being
stored in the 'pieces' variable. The location is popped from the 'stack' variable.
So this check to see that 'stack' is not empty was invalid and caused the pieces
after the first to not get processed.

I am working on an architecture which has 16-bit and 8-bit registers. So this
problem was quite easy to see. But I was able to re-produce this issue on x86
too with long long variable and compiling woth -m32. It resulted in following
location list.
00000014 08048496 080484b5 (DW_OP_reg6 (esi); DW_OP_piece: 4; DW_OP_reg7 (edi); DW_OP_piece: 4)

and lldb was only showing the contents of first register when I evaluated the
variable as it does not process the 2nd piece due to this check.

Reviewers: clayborg, aprantl

Subscribers: lldb-commits

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

llvm-svn: 247124
2015-09-09 09:06:05 +00:00
Jason Molenda 21586c8385 When lldb gets the register definitions from the response of a
qXfer:features:read:target.xml packet, or via the
plugin.process.gdb-remote.target-definition-file setting, if the
register definition doesn't give us eh_frame or DWARF register
numbers for that register, try to get that information from the ABI
plugin.

The DWARF/eh_frame register numbers are defined in the ABI
standardization documents - so getting this from the ABI plugin is
reasonable.  There's little value in having the remote stub inform
us of this generic information, as long as we can all agree on the
names of the registers.

There's some additional information we could get from the ABI.  For
instance, on ABIs where function arguments are passed in registers,
lldb defines alternate names like "arg1", "arg2", "arg3" for these
registers so they can be referred to that way by the user.  We could
get this from the ABI if the remote stub doesn't provide that.  That
may be something worth doing in the future - but for now, I'm keeping
this a little more minimal.

Thinking about this, what we want/need from the remote stub at a
minimum are:

 1. The names of the register
 2. The number that the stub will use to refer to the register with
    the p/P packets and in the ? response packets (T/S) where 
    expedited register values are provided
 3. The size of the register in bytes
   
(nice to have, to remove any doubt)
 4. The offset of the register in the g/G packet if we're going to
    use that for reading/writing registers.

debugserver traditionally provides a lot more information in
addition to this via the qRegisterInfo packet, and debugserver 
augments its response to the qXfer:features:read:target.xml
query to include this information.  Including:

DWARF regnum, eh_frame regnum, stabs regnum, encoding (ieee754,
Uint, Vector, Sint), format (hex, unsigned, pointer, vectorof*,
float), registers that should be marked as invalid if this 
register is modified, and registers that contain this register.

We might want to get all of this from the ABI - I'm not convinced
that it makes sense for the remote stub to provide any of these 
details, as long as the ABI and remote stub can agree on register
names.

Anyway, start with eh_frame and DWARF coming from the ABI if 
they're not provided by the remote stub.  We can look at doing
more in the future.

<rdar://problem/22566585> 

llvm-svn: 247121
2015-09-09 03:36:24 +00:00
Jason Molenda 0ace3f5c73 A change I'm open to reverting if there is disagreement:
When lldb receives a gdb-remote protocol packet that has
nonprintable characters, it will print the packet in
gdb-remote logging with binary-hex encoding so we don't 
dump random 8-bit characters into the packet log.

I'm changing this check to allow whitespace characters
(newlines, linefeeds, tabs) to be printed if those are
the only non-printable characters in the packet. 

This is primarily to get the response to the 
qXfer:features:read:target.xml packet to show up in the
packet logs in human readable form.  Right now we just
get a dozen kilobytes of hex-ascii and it's hard to 
figure out what register number scheme is being used.

llvm-svn: 247120
2015-09-09 03:24:52 +00:00
Stephane Sezer 9c99115367 Teach utilsOsType about NetBSD
Summary: NetBSD is a free, fast, secure, and highly portable Unix-like Open Source operating system.

Reviewers: joerg, sas

Subscribers: sas, emaste, lldb-commits

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

Change by Kamil Rytarowski <n54@gmx.com>

llvm-svn: 247116
2015-09-09 01:22:05 +00:00
Stephane Sezer 851f23db94 NetBSD doesn't provide struct statfs, make use of struct statvfs
Reviewers: joerg, sas

Subscribers: labath, lldb-commits

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

Change by Kamil Rytarowski <n54@gmx.com>

llvm-svn: 247115
2015-09-09 01:19:05 +00:00
Stephane Sezer 4d640f2e3b Prevent from a redefinition of _GLIBCXX_USE_NANOSLEEP
Summary: Build warning caught on NetBSD.

Reviewers: joerg, sas

Subscribers: lldb-commits

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

Change by Kamil Rytarowski <n54@gmx.com>

llvm-svn: 247114
2015-09-09 01:17:24 +00:00
Enrico Granata d3233c1ed7 Data formatter candidate matches can be generated in a number of ways; language-based dynamic type discovery being one of them (for instance, this is what takes an 'id' and discovers that it truly is an __NSArrayI, so it should probably use the NSArray formatter)
This used to be hardcoded in the FormatManager, but in a pluginized world that is not the right way to go

So, move this step to the Language plugin such that appropriate language plugins for a type get a say about adding candidates to the formatters lookup tables

llvm-svn: 247112
2015-09-09 01:10:46 +00:00
Bruce Mitchener 1ef6e4c870 Fix log message warning in SBThread.
Summary:
The format string was not set up correctly as it was missing the %.
This resulted in a warning (correctly) that the data arguments were
not all used.

Reviewers: clayborg, jingham

Subscribers: lldb-commits

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

llvm-svn: 247111
2015-09-09 00:56:25 +00:00
Todd Fiala a195adde00 Fix regressions in dotest.py when passing filters or directories.
See https://llvm.org/bugs/show_bug.cgi?id=24708 for details.
Using '-f FILTER' or unnamed arguments (directories) to dotest.py
will now force no-multiprocessing mode.  This stops a bombardment
of test output spam when following the instructions we provide
in a test session trace for rerunning the test.

llvm-svn: 247101
2015-09-08 23:22:19 +00:00
Oleksiy Vyalov c57b482fc2 Reverting r247000 since it's causing TestRegisters.test_fp_special_purpose_register_read to fail on OSX.
llvm-svn: 247090
2015-09-08 22:41:13 +00:00
Sean Callanan 3820e9cd17 ExpressionVariable now uses llvm::cast() instead of As...() for RTTI.
As part of our overall switch from hand-rolling RTTI to using LLVM-compatible
methods, I've done the same for ExpressionVariable.  The main documentation for
how to do this is in TypeSystem.h, so I've simply referred to that.

llvm-svn: 247085
2015-09-08 22:23:39 +00:00
Todd Fiala 8cbeed3248 dotest.py ctrl-c support, addition of --test-runner-name option.
See http://reviews.llvm.org/D12651 for more details.

For the parallel test runner, -v now also implies --output-on-success.

llvm-svn: 247084
2015-09-08 22:22:33 +00:00
Enrico Granata b5be2ffae5 Implement a Target::GetTypeSystemForLanguage API, as well as provide helpers on the TypeSystem to get numeric types of specific sizes and signedness
llvm-svn: 247082
2015-09-08 22:09:19 +00:00
Jim Ingham 989a7558b8 SBThread::StepOutOfFrame should check that the SBStackFrame it gets passed
is valid, and that its thread is the same as this SBThread.

llvm-svn: 247046
2015-09-08 18:40:59 +00:00
Greg Clayton f73034f99a Use LLVM casting for TypeSystem so you can cast it to subclasses.
This will keep our code cleaner and it removes the need for intrusive additions to TypeSystem like:

class TypeSystem
{
    virtual ClangASTContext *
    AsClangASTContext() = 0;
}

As you can now just use the llvm::dyn_cast and other casts.

llvm-svn: 247041
2015-09-08 18:15:05 +00:00
Stephane Sezer 77ba0e1f35 Add missing include for va_list in MIUtilString.h
Summary: Problem was caught on NetBSD.

Reviewers: joerg, sas

Subscribers: lldb-commits

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

Change by Kamil Rytarowski <n54@gmx.com>

llvm-svn: 247034
2015-09-08 17:47:17 +00:00
Ed Maste fa84aa3fa1 Revert "Enable StopHookForMultipleThreadsTestCase::test_stop_hook_multiple_threads_with_dwarf on FreeBSD"
And update the comment describing the reason this test is skipped.
Unlike the issue described llvm.org/pr22784 this test sometimes causes
a hang on my local machine and is not just a problem on the retired
buildbot.

This reverts commit r247013.

llvm-svn: 247024
2015-09-08 16:35:28 +00:00
Oleksiy Vyalov f3cd18192f Fix debugger shutdown when Python interpreter is loaded.
http://reviews.llvm.org/D12683

llvm-svn: 247023
2015-09-08 16:26:32 +00:00
Tamas Berghammer e6408bb064 Fix assertion failure caused by a bug in 128bit register handling in RegisterValue
llvm-svn: 247022
2015-09-08 16:22:23 +00:00
Ed Maste 109dba05b1 Enable StopHookForMultipleThreadsTestCase::test_stop_hook_multiple_threads_with_dwarf on FreeBSD
This test passes locally but was disabled due to pexpect issues on the
FreeBSD buildbot. That buildbot has been retired as it was overloaded,
and we will investigate again if this fails once a new buildbot is in
place. Noted by John Wolfe.

llvm.org/pr22784

llvm-svn: 247013
2015-09-08 13:33:21 +00:00
Ed Maste bd2a41a656 Remove expectedFailureFreeBSD from passing PluginCommandTestCase::test_load_plugin
This test was failing due to a libc++ vs libsdc++ conflict which should
be fixed by r200646.

llvm.org/pr17430

llvm-svn: 247012
2015-09-08 13:27:27 +00:00
Ed Maste 75a5de99d9 Exception registers aren't supported outside of Darwin
Apply test update from r234992 to FreeBSD

llvm-svn: 247009
2015-09-08 13:05:15 +00:00
Abhishek Aggarwal 139a096dce Bug 24733: TestRegisters.py for Clang inferiors
Summary:
  - Bug 24457 can now be tested for inferiors compiled
    by clang compiler also.
    
  - A generic test case for GCC and Clang inferiors:
    -- Works even when Clang and GCC produce different
       assembly for the same inferior.
  
  - Refer Differential Revision: http://reviews.llvm.org/D12677

Signed-off-by: Abhishek Aggarwal <abhishek.a.aggarwal@intel.com>
llvm-svn: 247000
2015-09-08 10:19:37 +00:00
Bruce Mitchener 2f9aa57927 [cmake] Remove LLDB_ENABLE_PYTHON_SCRIPTS_SWIG_API_GENERATION.
Summary:
This should be a mandatory build process going forward, if Python
is enabled. The longer term desire is to remove the old shell
scripts entirely.

Reviewers: zturner, clayborg, labath

Subscribers: lldb-commits

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

llvm-svn: 246979
2015-09-08 05:00:22 +00:00
Tamas Berghammer 25d41fa148 XFAIL single_step_only_steps_one_instruction related tests on arm/aarch64
llvm-svn: 246972
2015-09-07 16:01:26 +00:00
Tamas Berghammer cf6f92a870 XFAIL TestBuiltinTrap on android-arm (gcc bug)
llvm-svn: 246971
2015-09-07 15:50:19 +00:00
Tamas Berghammer 72eea4e644 XFAIL test_fp_special_purpose_register_read on android i386
llvm-svn: 246970
2015-09-07 15:18:24 +00:00
Bruce Mitchener b61f89ee52 [www] Typo fixes.
Reviewers: clayborg, ki.stfu

Subscribers: tberghammer, danalbert, srhines, lldb-commits

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

llvm-svn: 246969
2015-09-07 13:03:07 +00:00
Pavel Labath 63a579c752 Mark TestCreateDuringInstructionStep as flaky on android arm
llvm-svn: 246966
2015-09-07 12:15:27 +00:00
Hafiz Abid Qadeer 8647f4381f Fix -data-evaluate-expression for array.
Summary:
For an array declared like "blk[2][3]", this command was showing:
-data-evaluate-expression blk
^done,value="{[0] = [3], [1] = [3]}"

After this fix, it shows:
-data-evaluate-expression blk
^done,value="{[0] = {[0] = 1, [1] = 2, [2] = 3}, [1] = {[0] = 4, [1] = 5, [2] = 6}}"

The code to do the right thing was already available and used by other commands.
So I have just used that and removed the half-baked previous implementation.

Reviewers: ki.stfu

Subscribers: lldb-commits

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

llvm-svn: 246965
2015-09-07 12:00:51 +00:00
Pavel Labath 058faef6ce Skip RegisterCommandsTestCase.test_fp_register_write on Android i386
it appears a kernel bug is preventing us from writing into the register.

llvm-svn: 246964
2015-09-07 11:59:01 +00:00
Tamas Berghammer c40e7b1769 Fix the handling of FPR offsets in Linux arm/aarch64 register contexts
Differential revision: http://reviews.llvm.org/D12636

llvm-svn: 246959
2015-09-07 10:11:23 +00:00
Tamas Berghammer 25b9f7ebd3 Use eAddressClassCode for address lookup for opcodes for stack frames
It is required because of the following edge case on arm:

bx <addr>   Non-tail call in a no return function
[data-pool] Marked with $d mapping symbol

The return address of the function call will point to the data pool but
we have to treat it as code so the StackFrame can calculate the symbols
correctly.

Differential revision: http://reviews.llvm.org/D12556

llvm-svn: 246958
2015-09-07 09:58:09 +00:00
Pavel Labath b5d5ead8c9 Fixup TestRegisters after r246955
- clang is picky about inline assembly: add the correct instruction size suffix
- mark the new test as expectedFailureClang: the test fails as the breakpoint is set in the wrong
  place

llvm-svn: 246957
2015-09-07 08:54:34 +00:00
Pavel Labath 53159c9b78 Extend the XFAIL for TestMiBreak
the test is occasionally failing on linux for all tested scenarios.

llvm-svn: 246956
2015-09-07 07:58:29 +00:00
Abhishek Aggarwal 7f658edd61 Bug 24457 - X87 FPU Special Purpose Registers
Summary:
  - For 'register read --all' command on x86_64-Linux Platform:

      -- Provide correct values of X87 FPU Special Purpose Registers
      -- Both 32-bit & 64-bit inferiors give correct values on this
         Platform

  - Added a Test Vector:
      -- To verify the expected behaviour of the command

Signed-off-by: Abhishek Aggarwal <abhishek.a.aggarwal@intel.com>

Reviewers: ashok.thirumurthi, granata.enrico, tfiala, clayborg

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

llvm-svn: 246955
2015-09-07 07:40:16 +00:00
Keno Fischer 311435dbb6 Fix Makefile build
llvm-svn: 246932
2015-09-05 20:01:56 +00:00
Siva Chandra fdc11d5895 [TestMiBreak] Replace expectedFlakeyLinux with an appropriate expectedFailureAll
Reviewers: chaoren

Subscribers: lldb-commits

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

llvm-svn: 246894
2015-09-04 23:11:38 +00:00
Greg Clayton ea4a5bb8bb Check for null compile unit so we don't crash.
llvm-svn: 246887
2015-09-04 22:29:46 +00:00
Siva Chandra 2becc987ef Convert "long" input to "long long" in typemap for lldb::tid_t.
Summary: lldb::tid_t is 64 bit, but "long" need not always be 64 bit.

Reviewers: chying, clayborg

Subscribers: lldb-commits

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

llvm-svn: 246885
2015-09-04 22:26:52 +00:00
Enrico Granata 964211f25f Add a --language (-l) option to type category {enable|disable} to allow people to turn on and off formatters for a given language
llvm-svn: 246884
2015-09-04 22:07:48 +00:00
Enrico Granata c6bbb8b69a Never mind, I see what the problem is on the Windows build. Attempt a fix
llvm-svn: 246876
2015-09-04 21:22:54 +00:00
Enrico Granata 33e97e63a5 Move the C++ data formatters to the C++ language plugin
llvm-svn: 246873
2015-09-04 21:01:18 +00:00
Sean Callanan 7a518c3dab I accidentally committed some project-file changes. Undid those.
llvm-svn: 246872
2015-09-04 20:54:25 +00:00
Sean Callanan bc8ac34e61 This patch separates the generic portion of ClangExpressionVariable, which
stores information about a variable that different parts of LLDB use, from the
compiler-specific portion that only the expression parser cares about.

http://reviews.llvm.org/D12602

llvm-svn: 246871
2015-09-04 20:49:51 +00:00
Adrian McCarthy a729204103 Sleep-and-retry after a failure to delete a log file, which may be because antimalware is holding the handle to the just-created file.
Differential Revision: http://reviews.llvm.org/D12641

llvm-svn: 246870
2015-09-04 20:48:48 +00:00
Hafiz Abid Qadeer 23a4df27ab Use correct #ifdef check for ProcessWindowsLog::Terminate() call.
The call to ProcessWindowsLog::Initialize() is protected by #if defined(_MSC_VER).
But the call to ProcessWindowsLog::Terminate() was using __WIN32__. This commit
makes it use _MSC_VER too.

Committing as it seems obvious change.

llvm-svn: 246859
2015-09-04 16:34:19 +00:00
Hafiz Abid Qadeer e7a71480b0 Fix CMICmdArgValConsume to correctly handle "--".
CMICmdArgValConsume::Validate was not removing it from the input stream.

llvm-svn: 246858
2015-09-04 16:10:48 +00:00
Tamas Berghammer 980662ee9d Fix TestLoadUnload.test_load_unload for android API > 21
* Change Module::MatchesModuleSpec to return true in case the file spec
  in the specified module spec matches with the platform file spec, but
  not with the local file spec
* Change the module_resolver used when resolving a remote shared module
  to always set the platform file spec to the file spec requested

Differential revision: http://reviews.llvm.org/D12601

llvm-svn: 246852
2015-09-04 12:42:41 +00:00
Hafiz Abid Qadeer 3c3466529b Fix multiple problems in -break-condition command.
1. To handle the expression with spaces, this command uses 2 arguments. For a case
   like -break-condition 1 i == 5, the first will pick the 'i' and second will
   pick the '== 5'. But the second argument was made mandatory which failed in
   cases when there was no space in the expression like i==5.
2. The function GetRestOfExpressionNotSurroundedInQuotes has 2 locals with the
   same names. It resulted in one hiding the other and this function always
   returned empty string.

No regression on Linux. Committed as obvious.

llvm-svn: 246847
2015-09-04 11:26:53 +00:00
Pavel Labath cb405bf311 Add a repro case for bug llvm.org/pr24702
llvm-svn: 246845
2015-09-04 10:21:15 +00:00
Pavel Labath a04668ff34 Move GetOptInc to the common namespace
Summary:
GetOptInc provides getopt(), getopt_long() and getopt_long_only().

Windows (for defined(_MSC_VER)) doesn't ship with all of the getopt(3) family members and needs all of them. NetBSD requires only getopt_long_only(3).

While there fix the code for clang diagnostics.

Author: Kamil Rytarowski

Reviewers: joerg

Subscribers: labath, zturner, lldb-commits

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

llvm-svn: 246843
2015-09-04 09:06:15 +00:00
Ewan Crawford 9815658332 RenderScript pending kernel breakpoints.
Currently the RS breakpoint command can only find a kernel if it's in an already loaded RS module.
This patch allows users to set pending breakpoints on RenderScript kernels which will be loaded in the future.
Implemented by creating a RS breakpoint resolver, to limit search scope to only RS modules.

Reviewed by: clayborg, jingham
Subscribers: lldb-commits, ADodds, domipheus
Differential Revision: http://reviews.llvm.org/D12360

llvm-svn: 246842
2015-09-04 08:56:52 +00:00
Abhishek Aggarwal 2cf87a895d SysV ABI for i386 Architecture
Summary:
  - Capability to force return user specified values
    from inside of a function on lldb command terminal

  - Support for Integral, Pointer and Floating Point values

Signed-off-by: Abhishek Aggarwal <abhishek.a.aggarwal@intel.com>

Reviewers: jingham, clayborg

Subscribers: tberghammer

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

llvm-svn: 246841
2015-09-04 07:44:05 +00:00
Jason Molenda 125adcf0aa Change the (internal to this file only) enum names from gcc_ to
ehframe_ & from gdb_ to stabs_ for clarity.

Also document the fact that i386 eh_frame on Darwin has the register
numbers swapped for ebp/esp from the DWARF register numbers so no one
copies these defines for other i386 ABI plugins.  This bug only ever
existed on Darwin.

No code changes, just renaming variables.

llvm-svn: 246834
2015-09-04 03:40:29 +00:00
Dawn Perchik 009d110de4 Set the default language to use when evaluating to that of the frame's CU.
* Use the frame's context (instead of just the target's) when evaluating,
  so that the language of the frame's CU can be used to select the
  compiler and/or compiler options to use when parsing the expression.
  This allows for modules built with mixed languages to be parsed in
  the context of their frame. 
* Add all C and C++ language variants when determining the language options
  to set.
* Enable C++ language options when language is C or ObjC as a workaround since
  the expression parser uses features of C++ to capture values.
* Enable ObjC language options when language is C++ as a workaround for ObjC
  requirements.
* Disable C++11 language options when language is C++03.
* Add test TestMixedLanguages.py to check that the language being used
  for evaluation is that of the frame.
* Fix test TestExprOptions.py to check for C++11 instead of C++ since C++ has
  to be enabled for C, and remove redundant expr --language test for ObjC.
* Fix TestPersistentPtrUpdate.py to not require C++11 in C.

Reviewed by: clayborg, spyffe, jingham
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D11102

llvm-svn: 246829
2015-09-04 01:02:30 +00:00
Enrico Granata 419d79189f Nuke CXXFormatterFunctions.cpp - split the contents of it across different files, so that things are better organized along the C++/ObjC line
This is preparatory work for moving these formatters into language categories

llvm-svn: 246827
2015-09-04 00:33:51 +00:00
Bruce Mitchener 3921fc7de7 Only export public symbols with the cmake build.
Summary:
This also moves the xcode support files to be near or the same
as the ones used for cmake.

The source/API/liblldb.xcodes.exports differs from the
source/API/liblldb.exports in that one contains the actual
symbol names (_ prefixed) while the other contains the symbol
names as they are in the code. The liblldb.exports file is
preprocessed by the cmake scripts into the correct per-platform
file needed (like a linker script on Linux).

This is not enabled on Windows as Windows doesn't use the same
name mangling and so it won't be valid there. Also, this is handled
already in a different way on Windows (via dll exports).

Reviewers: emaste, clayborg, labath, chaoren

Subscribers: lldb-commits

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

llvm-svn: 246822
2015-09-04 00:00:41 +00:00
Bruce Mitchener cfe7d6c486 SystemRuntime/MacOSX no longer need ObjCRuntime header.
Summary:
The AppleGetQueuesHandler code no longer needs to include a header
from the AppleObjCRuntime, so we can remove workarounds that were
present in the build systems.

Reviewers: clayborg, jasonmolenda

Subscribers: lldb-commits

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

llvm-svn: 246821
2015-09-03 23:57:09 +00:00
Siva Chandra 0f4873d7d0 Lookup function using full name if one with mangled name is not found.
Summary:
Remove expected failure decorators from tests which now should start
passing.

Reviewers: clayborg, spyffe

Subscribers: lldb-commits

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

llvm-svn: 246820
2015-09-03 23:27:10 +00:00
Zachary Turner b8dec76f26 Protect dotest.py with an if __name__ == "__main__"
llvm-svn: 246816
2015-09-03 23:03:16 +00:00
Todd Fiala fed95660f3 Roll dosep.py parallel test runner into dotest.py command line
See the following for details:
http://reviews.llvm.org/D12587

llvm-svn: 246794
2015-09-03 18:58:44 +00:00
Ying Chen e14653d9f0 Fix TestCompletion.py failure on Darwin after r246639
Summary: - send empty line for multiple commands to complete

Reviewers: tberghammer

Subscribers: lldb-commits

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

llvm-svn: 246791
2015-09-03 18:29:27 +00:00
Stephane Sezer 5506a1d96e NetBSD ships with paccept(2), a superset of accept4(2)
Summary: accept4(2) and paccept(2) are nonstandard extensions.

Reviewers: joerg, sas

Subscribers: emaste, sas, lldb-commits

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

Change by Kamil Rytarowski <n54@gmx.com>

llvm-svn: 246787
2015-09-03 17:11:31 +00:00
Zachary Turner c7a52d594a i386 and i686 are equivalent, update the test accordingly.
llvm-svn: 246783
2015-09-03 16:41:31 +00:00
Pavel Labath 01c4a45c51 Mark TestAttachResume as flaky on linux
There is a more race condition regarding process detach, which this test exposes, marking as
flaky until it is fixed.

llvm-svn: 246777
2015-09-03 15:44:16 +00:00
Pavel Labath ea3fb8e378 Fix logging message
llvm-svn: 246776
2015-09-03 15:44:14 +00:00
Pavel Labath 4bff4d0182 XFAIL TestFormatters on android (llvm.org/pr24691)
the test is hitting an assertion in clang.

llvm-svn: 246766
2015-09-03 13:52:29 +00:00
Pavel Labath b18469f5d7 Enable TestFdLeak on linux
it has been consistently passing at least the last 100 builds on the bot.

llvm-svn: 246761
2015-09-03 12:00:15 +00:00
Pavel Labath 5055685cda Fix deadlock while attaching to inferiors
Summary:
There was a race condition in the AsyncThread, where we would end up sending a vAttach
notification to the thread before it got a chance set up its listener (this can be reproduced by
adding a sleep() at the very beginning of ProcessGDBRemote::AsyncThread()). This event would then
get lost and we LLDB would deadlock. I fix this by setting up the listener early on, in the
ProcessGDBRemote constructor.

This should improve the stability of all attach tests. For now, I am removing XTIMEOUT from
TestAttachResume, and will watch the buildbots for signs of trouble.

Reviewers: clayborg, ovyalov

Subscribers: lldb-commits

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

llvm-svn: 246756
2015-09-03 09:36:22 +00:00
Pavel Labath a9a43373e1 Fix rare failure in TestProcessIO
Summary:
There was a race condition in Process class, where we would not wait for process stdout to
propagate fully before we would shut down the connection (repro case: slow down the stdio thread
by placing a sleep right at the end of the while loop in Communication::ReadThread). The Process
class already tried to solve this problem by synchronizing with the read thread in
Process::ShouldBroadcastEvent, but unfortunately the connection got closed before that in
Process::SetExitStatus. I solve this issue by delaying the connection shutdown until we get a
chance to process the event and synchronize. Alternatively, I could have moved the
synchronization point to an earlier point in SetExitStatus, but it seems safer to delay the
shutdown until other things get a chance to notice the process has exited.

Reviewers: clayborg, ovyalov

Subscribers: lldb-commits

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

llvm-svn: 246753
2015-09-03 09:30:17 +00:00
Bruce Mitchener db25a7a245 [cmake] Remove LLVM_NO_RTTI.
Summary:
This doesn't exist in other LLVM projects any longer and doesn't
do anything.

Reviewers: chaoren, labath

Subscribers: emaste, tberghammer, lldb-commits, danalbert

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

llvm-svn: 246749
2015-09-03 08:46:55 +00:00
Bruce Mitchener 49948af9cd Fix cmake build.
llvm-svn: 246746
2015-09-03 04:17:57 +00:00
Sagar Thakur 66089382d9 [MIPS64] Emulate MSA branch instructions
This patch adds MSA branch instruction emulation for MIPS64.

Reviewers: tberghammer, jaydeep
Subscribers: tberghammer, lldb-commits, nitesh.jain, mohit.bhakkad (Mohit Bhakkad), bhushan (Bhushan Attarde)
Differential: http://reviews.llvm.org/D12356
llvm-svn: 246745
2015-09-03 03:57:44 +00:00
Jim Ingham 0d5a2bd6f7 Purge a few places where *LanguageRuntime.h was being used when it
wasn't needed.

llvm-svn: 246744
2015-09-03 01:40:51 +00:00
Enrico Granata d87cc31960 CXXFormatterFunctions.{h|cpp} is not a good thing to have around, so start splitting stuff in different files in preparation for removing it and factoring formatters to the plugins where they belong
llvm-svn: 246743
2015-09-03 01:29:42 +00:00
Jim Ingham 59365b0ba6 Remove the list of all languages in the help for "help language" since
almost all the elements on the list can't actually be passed to the language
command and all the ones that can have already been listed in the subcommands 
list.

<rdar://problem/22551082>

llvm-svn: 246740
2015-09-03 01:13:26 +00:00
Sean Callanan 30e339749f Jim told me about a cleaner way to include headers from plug-ins.
This is still something I need to fix, but at least it's not so ugly, and it's
consistent with the other code that does that so we will catch it when we purge
all such code.

llvm-svn: 246738
2015-09-03 00:48:23 +00:00
Sean Callanan e33724f371 In preparation for factoring persistent variables into a generic part and a
Clang-specific part, create the ExpressionVariable source/header file and
move ClangExpressionVariable into the Clang expression parser plugin.

It is expected that there are some ugly #include paths... these will be resolved
by either (1) making that code use generic expression variables (once they're
separated appropriately) or (2) moving that code into a plug-in, often
the expression parser plug-in.

llvm-svn: 246737
2015-09-03 00:35:46 +00:00
Jim Ingham e90dc827e0 Fix ObjCLanguage::MethodName::GetCategory after r246616; I was just moving things around too fast...
llvm-svn: 246736
2015-09-03 00:03:13 +00:00
Zachary Turner a5bebcc5ea Skip the rest of the Objective C tests on Windows.
llvm-svn: 246726
2015-09-02 22:41:28 +00:00
Zachary Turner 77377408f8 XFAIL more watchpoint tests on Windows.
llvm.org/pr24446

llvm-svn: 246725
2015-09-02 22:41:15 +00:00
Zachary Turner 11ac206f67 XFAIL more bugs that depend on dynamic value resolution.
llvm.org/pr24663

llvm-svn: 246724
2015-09-02 22:40:59 +00:00
Zachary Turner 428ffcfa8d XFAIL tests that rely on exact thread counts.
On Windows we have to deal with OS created threads, so we can never
know the exact number of threads.

llvm.org/pr24681

llvm-svn: 246723
2015-09-02 22:40:40 +00:00
Enrico Granata 17168384cd We want Python int or long to both be usable as-a tid_t for API purposes. Introduce a typemap to this effect
llvm-svn: 246709
2015-09-02 20:53:43 +00:00
Zachary Turner 022c3c85df When redirecting stdio, use FILE_SHARE_DELETE.
Some tests were failing because the test would try to delete the
file before inferior had exited, but on Windows this will fail by
default unless you specify FILE_SHARE_DELETE when opening the file.

Can't think of a good reason not to do this, so here it is.

llvm-svn: 246682
2015-09-02 17:59:19 +00:00
Sean Callanan 7ddb35e996 Added a skeleton plugin for the Clang expression parser, so I can start factoring stuff into it.
llvm-svn: 246677
2015-09-02 16:59:02 +00:00
Sean Callanan 873a78e76c Added an ExpressionParser plugin skeleton with nothing in it (yet).
llvm-svn: 246674
2015-09-02 16:49:14 +00:00
Zachary Turner 12004ebe2f Try to fix FreeBSD build.
llvm-svn: 246672
2015-09-02 16:47:47 +00:00
Zachary Turner 853037101f Change Windows XFAIL comment for TestCompletion.py
Instead of fixing these tests by finding a pexpect replacement,
this set of tests can be fixed by re-writing the test to not use
pexpect.

llvm.org/pr24679

llvm-svn: 246671
2015-09-02 16:47:37 +00:00
Zachary Turner 656ef0b277 XFAIL tests on Windows that are failing to resolve breakpoints.
llvm.org/pr24668

llvm-svn: 246670
2015-09-02 16:47:29 +00:00
Zachary Turner 991dae85d9 [Windows] XFAIL test that depend on dynamic value types.
llvm-svn: 246669
2015-09-02 16:47:13 +00:00
Zachary Turner fbb79bb789 XFAIL test_thread_state_after_continue on Windows.
https://llvm.org/pr24660

llvm-svn: 246668
2015-09-02 16:47:01 +00:00
Sean Callanan ecb17985c5 Removed comments that suggested that asserts in the ClangASTImporter should be
debug-only.  This is not the case; when they fire we are about to crash or do
something horrible anyway, so they should stay in.

llvm-svn: 246667
2015-09-02 16:40:59 +00:00
Sean Callanan 4a2a71fbe4 Improved logging for deported types in the ClangASTImporter.
llvm-svn: 246666
2015-09-02 16:39:23 +00:00
Tamas Berghammer c17469bb88 Only create alternative thumb disassembler if the main one is arm
This fixes a regression caused by r245645 where creating alternative
thumb disassembler was enabled even when the main disassembler is
already thumb.

llvm-svn: 246649
2015-09-02 13:31:18 +00:00
Tamas Berghammer ff417efa1d Fix arm disassambler with specifying armv8.1a architecture
If no architecture is defined for the disassambler command then it uses
the architecture of the target. In case of arm it will be "arm" what is
treated as the oldest arm version by the LLVM disassambler causing a lot
of invalid opcode in the output.

This change forces the use of "armv8.1a" (the newest arm architecture) if
no sub architecure was specified (either by the user or by the target) to
disassamble all instruction.

Differential revision: http://reviews.llvm.org/D12553

llvm-svn: 246648
2015-09-02 13:24:50 +00:00
Pavel Labath e457c8862d Enable a couple of tests in TestExitDuringStep on linux
tests have been reliably passing at least the last 100 runs of the build bot.

llvm-svn: 246647
2015-09-02 13:01:21 +00:00
Pavel Labath 54d43990bb Fix test.html webpage alignment
llvm-svn: 246645
2015-09-02 12:20:41 +00:00
Pavel Labath 8a58af3398 XFAIL new tests in TestCompletion on windows due to missing pexpect
llvm-svn: 246644
2015-09-02 12:09:31 +00:00
Tamas Berghammer 89d3f090b2 Fix tab completion for command arguments containing spaces
If a command argument contains a space then it have to be escaped with
backslash signs so the argument parsing logic can parse it properly.
This CL fixes the tab completion code for the arguments to create
complitions with correctly escaped strings.

Differential revision: http://reviews.llvm.org/D12531

llvm-svn: 246639
2015-09-02 10:35:27 +00:00
Pavel Labath 1fb7e202d9 Fix Clang-tidy misc-use-override warnings in source/Commands headers, unify closing inclusion guards
patch by Eugene Zelenko.

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

llvm-svn: 246628
2015-09-02 09:33:09 +00:00
Pavel Labath 4407b8eba1 Fix Clang-tidy misc-use-override warnings in some files in include/lldb/Interpreter, unify closing inclusion guards
patch by Eugene Zelenko.

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

llvm-svn: 246627
2015-09-02 09:28:35 +00:00
Pavel Labath 6ac50bf19e Fix Clang-tidy misc-use-override warnings in some files in include/lldb/Target, unify closing inclusion guards
patch by Eugene Zelenko.

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

llvm-svn: 246626
2015-09-02 09:24:21 +00:00
Pavel Labath 3a3354eb03 Fix Clang-tidy misc-use-override warnings in include/lldb/API, Breakpoint and Symbol, unify closing inclusion guards
patch by Eugene Zelenko.

llvm-svn: 246624
2015-09-02 09:19:24 +00:00
Pavel Labath 5dcb02501f Address flakyness in TestAttachResume
Summary:
The test (among other things) attempts to verify that detaching works while the inferior is
running. However, this was racy since the inferior could end up stopping again before we got a
chance to detach from it (the test could be made to fail reliably by inserting a sleep just after
the last "continue" command). The reason for the stop was that we had a breakpoint set in a place
that can be hit by multiple threads, and we stop because another thread hit a breakpoint.

I fix this by moving the breakpoint to a place that is reachable from only one thread. I also
make sure that the same thread cannot hit the breakpoint if we are exceptionaly slow by flipping
a flag which makes the breakpoint unreachable (I cannot just disable or delete the breakpoint as
the test makes it a point to try detaching while breakpoints are still set).

Another source or racyness was that the test verified that the process resumes and
stops after a "continue". However, if these two events happened too fast, the initial start event
would be lost, and the test would end up confused. I have implemented this in a safer manner and
made a utility function out of it, as I know of a couple of other tests which need the same
functionality.

Reviewers: zturner, clayborg

Subscribers: lldb-commits

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

llvm-svn: 246623
2015-09-02 09:12:28 +00:00
Jim Ingham aa816b8f3b Move more functionality from the LanguageRuntimes to the Languages.
llvm-svn: 246616
2015-09-02 01:59:14 +00:00
Enrico Granata 28b3831e39 Add a Language::ForAllLanguages helper function
llvm-svn: 246614
2015-09-02 01:31:10 +00:00
Enrico Granata 578c8a7841 Use Language::LanguageIsCPlusPlus instead of doing the same switch over language
llvm-svn: 246613
2015-09-02 01:28:24 +00:00
Enrico Granata df7e79e646 Move the functions that FormatManager uses to actually load formatters into their own file
These are useful helpers over the low-level API of the FormattersContainer, and since we're actually going to start moving formatters into plugins, it makes sense to simplify things

llvm-svn: 246612
2015-09-02 01:21:31 +00:00
Jim Ingham 0e0984eebb Move things from the LanguageRuntime that obviously belong in the new Language plugin instead.
llvm-svn: 246611
2015-09-02 01:06:46 +00:00
Bruce Mitchener e8433cc179 Simplify find_first_of & find_last_of on single char.
Summary:
When calling find_first_of and find_last_of on a single character,
we can instead just call find / rfind and make our intent more
clear.

Reviewers: clayborg

Subscribers: lldb-commits

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

llvm-svn: 246609
2015-09-01 23:57:17 +00:00
Bruce Mitchener 11deaae8a1 Remove ABIMacOSX_i386::PrepareNormalCall().
Summary:
This was removed from the other ABI plugins long ago. This removes
a warning that was happening in this unused code as a result of
adding 2 new types to Scalar.h (e_uint128 and e_sint128).

Reviewers: clayborg

Subscribers: llvm-commits

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

llvm-svn: 246608
2015-09-01 23:51:30 +00:00
Bruce Mitchener dcad05b4eb [debugserver] Fix sign comparison warning.
Summary:
Comparing m_page_size against kInvalidPageSize was resulting in
a warning about comparing integers with different signs. Since
kInvalidPageSize isn't used anywhere outside of MachVMMemory.cpp,
we can readily transform it into a static const vm_size_t with
the correct value to avoid the sign comparison warnings.

Reviewers: clayborg

Subscribers: lldb-commits

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

llvm-svn: 246606
2015-09-01 23:45:14 +00:00
Bruce Mitchener 4aed72571a Use -Wno-vla-extension globally.
Summary:
This was previously only established within debugserver, but
there is a use of the VLA extension in source/Host/macosx/Symbols.cpp,
so ignore this warning globally.

Reviewers: clayborg

Subscribers: lldb-commits

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

llvm-svn: 246605
2015-09-01 23:43:51 +00:00
Jim Ingham 5a3bb64fca Fix ProcessKDP.cpp for the change in r246578.
llvm-svn: 246601
2015-09-01 22:56:59 +00:00
Enrico Granata b6f8ca152a std::initializer_list is not safe to return from a function, as copies are not guaranteed to extend the lifetime of the underlying storage
llvm-svn: 246597
2015-09-01 22:24:35 +00:00
Enrico Granata 45a98fffa5 Add logging to a couple of regions of code
llvm-svn: 246580
2015-09-01 20:11:13 +00:00
Zachary Turner 1d397bfe40 Make ProcessWindows not create a strong reference to itself.
llvm-svn: 246579
2015-09-01 20:02:44 +00:00
Zachary Turner 7529df9abd Have the Process hold a weak_ptr to the Target.
llvm-svn: 246578
2015-09-01 20:02:29 +00:00
Oleksiy Vyalov e7eabbb550 Make remote-android platform to use dynamic local tcp ports when forwarding device ports.
http://reviews.llvm.org/D12510

llvm-svn: 246574
2015-09-01 19:02:14 +00:00
Zachary Turner 81ab77d424 Un-XFAIL a couple tests that are now passing.
llvm-svn: 246570
2015-09-01 18:25:05 +00:00
Zachary Turner bc556d382b XFAIL TestHelloWorld on Windows.
https://llvm.org/pr24600

llvm-svn: 246569
2015-09-01 18:24:49 +00:00
Enrico Granata 980c0484c5 Add support for language plugins to provide data formatters (second attempt)
Historically, data formatters all exist in a global repository (the category map)
On top of that, some formatters can be "hardcoded" when the conditions under which they apply are not expressible as a typename (or typename regex)

This change paves the way to move formatters into per-language buckets such that the C++ plugin is responsible for ownership of the C++ formatters, and so on
The advantages of this are:
a) language formatters only get created when they might apply
b) formatters for a language are clearly owned by the matching language plugin

The current model is one of static instantiation, that is a language knows the full set of formatters it vends and that is only asked-for once, and then handed off to the FormatManager
In a future revision it might be interesting to add similar ability to the language runtimes, and monitor for certain shared library events to add even more library-specific formatters

No formatters are moved as part of this change, so practically speaking this is NFC

llvm-svn: 246568
2015-09-01 18:22:39 +00:00
Sean Callanan 761844be66 When looking up types, find the first type we can import rather than just taking
the first type we find and failing if it can't be imported.

llvm-svn: 246563
2015-09-01 18:00:35 +00:00
Sean Callanan 77bc4d12c7 Add a predicate to allow a ClangASTContext to identify Clang types.
llvm-svn: 246562
2015-09-01 17:58:03 +00:00
Adrian McCarthy 6c3d03c468 Implement DoReadMemory for Windows mini dumps.
Differential Revision: http://reviews.llvm.org/D12507

llvm-svn: 246558
2015-09-01 16:59:31 +00:00
Chaoren Lin c963a222f1 Make ProcessGDBRemote get a //copy// of platform Unix signals.
Summary: Update to http://reviews.llvm.org/rL243618.

Reviewers: jaydeep, clayborg

Subscribers: labath, tberghammer, lldb-commits

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

llvm-svn: 246557
2015-09-01 16:58:45 +00:00
Pavel Labath 7a9495bcd5 [NativeProcessLinux] Fix detach of multithreaded inferiors
When detaching, we need to detach from all threads of the inferior and not just the main one.
Without this, a multi-threaded inferior would usually crash once the server exits.

llvm-svn: 246549
2015-09-01 15:00:51 +00:00
Pavel Labath 86852d3676 [NativeProcessLinux] Fix assertion failure when killing a process
Linux sometimes sends us a PTRACE_EVENT_EXIT when an inferior process gets a SIGKILL. This can be
confusing, since normally we don't expect any events when the inferior is stopped. This commit
adds code to handle this situation (resume the thread and let it exit normally) and avoid an
assertion failure in ResumeThread().

llvm-svn: 246539
2015-09-01 10:59:36 +00:00
Pavel Labath f15a16704b Revert "Add support for language plugins to provide data formatters"
This reverts r246515 (and related cmake fixes) as it breaks all libcxx tests.

llvm-svn: 246536
2015-09-01 09:02:54 +00:00
Jason Molenda bf67a30bdd A few small comment fixups with terminology "gcc" -> "eh_frame", "gdb" -> "stabs".
Just noticed these while reading through some code.

llvm-svn: 246530
2015-09-01 05:17:01 +00:00
Bruce Mitchener ee188ba20e [lldb-mi] Use find, not find_first_of, for "--".
Summary:
find_first_of will look for any of the characters, not the full
string passed in. When looking for "--" then, we must use find
and not find_first_of.

Reviewers: ki.stfu, abidh

Subscribers: lldb-commits

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

llvm-svn: 246529
2015-09-01 04:36:54 +00:00
Enrico Granata d1216d6b12 And of course, typos
llvm-svn: 246519
2015-09-01 01:23:22 +00:00
Enrico Granata fcc353d952 Attempt at fixing the CMake build
llvm-svn: 246518
2015-09-01 01:23:02 +00:00
Enrico Granata 2233895a3b Add support for language plugins to provide data formatters
Historically, data formatters all exist in a global repository (the category map)
On top of that, some formatters can be "hardcoded" when the conditions under which they apply are not expressible as a typename (or typename regex)

This change paves the way to move formatters into per-language buckets such that the C++ plugin is responsible for ownership of the C++ formatters, and so on
The advantages of this are:
a) language formatters only get created when they might apply
b) formatters for a language are clearly owned by the matching language plugin

The current model is one of static instantiation, that is a language knows the full set of formatters it vends and that is only asked-for once, and then handed off to the FormatManager
In a future revision it might be interesting to add similar ability to the language runtimes, and monitor for certain shared library events to add even more library-specific formatters

No formatters are moved as part of this change, so practically speaking this is NFC

llvm-svn: 246515
2015-09-01 01:01:48 +00:00
Enrico Granata ad91c7cee2 Make FormatEntity be a little bit smarter when printing function arguments
llvm-svn: 246512
2015-09-01 00:19:35 +00:00
Ed Maste 8bb3d04adc Remove expectedFailureFreeBSD for passing pexpect tests
These tests work when run locally. They had been occasionally failing
on the FreeBSD buildbot due to pexpect issues. That buildbot is
currently down, and I expect the replacement will not have this issue.

llvm.org/pr22784

llvm-svn: 246490
2015-08-31 21:37:15 +00:00
Greg Clayton 915272ff54 Stop objects from keeping a strong reference to the process when they should have a weak reference.
llvm-svn: 246488
2015-08-31 21:25:45 +00:00
Adrian McCarthy 23d14b6ade Differential Review: http://reviews.llvm.org/D12363
llvm-svn: 246302
2015-08-28 14:42:03 +00:00
Sylvestre Ledru 79cb0090ff Avoid usage of F_DUPFD_CLOEXEC where not available (e.g. kfreebsd*)
Summary:
kfreebsd doesn't have F_DUPFD_CLOEXEC, so use it conditionally.

Author: Emilio Pozuelo Monfort <pochu@debian.org>
Author: Petr Salinger <Petr.Salinger@seznam.cz>
Author: Gianfranco Costamagna

Reviewers: emaste

Subscribers: emaste

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

llvm-svn: 246294
2015-08-28 12:24:07 +00:00
Mohit K. Bhakkad 16ad032183 [LLDB][MIPS] Aligning code with rL245831
Reviewers: jaydeep
Subscribers: lldb-commits.
Differential Revision: http://reviews.llvm.org/D12427

llvm-svn: 246293
2015-08-28 12:08:26 +00:00
Greg Clayton 261ac3f4b5 Made a new abstract class named "DWARFASTParser" which lives in "source/Plugins/SymbolFile/DWARF":
class DWARFASTParser
{
public:
    virtual ~DWARFASTParser() {}

    virtual lldb::TypeSP
    ParseTypeFromDWARF (const lldb_private::SymbolContext& sc,
                        const DWARFDIE &die,
                        lldb_private::Log *log,
                        bool *type_is_new_ptr) = 0;


    virtual lldb_private::Function *
    ParseFunctionFromDWARF (const lldb_private::SymbolContext& sc,
                            const DWARFDIE &die) = 0;

    virtual bool
    CompleteTypeFromDWARF (const DWARFDIE &die,
                           lldb_private::Type *type,
                           lldb_private::CompilerType &clang_type) = 0;

    virtual lldb_private::CompilerDeclContext
    GetDeclContextForUIDFromDWARF (const DWARFDIE &die) = 0;

    virtual lldb_private::CompilerDeclContext
    GetDeclContextContainingUIDFromDWARF (const DWARFDIE &die) = 0;

};

We have one subclass named DWARFASTParserClang that implements all of the clang specific AST type parsing. This keeps all DWARF parsing in the DWARF plug-in. Moved all of the DWARF parsing code that was in ClangASTContext over into DWARFASTParserClang.

lldb_private::TypeSystem classes no longer have any DWARF parsing functions in them, but they can hand out a DWARFASTParser:

virtual DWARFASTParser *
GetDWARFParser ()
{
    return nullptr;
}

This keeps things clean and makes for easy merging when we have different AST's for different languages.

llvm-svn: 246242
2015-08-28 01:01:03 +00:00
Enrico Granata 2996d8236c Include <mutex>
llvm-svn: 246222
2015-08-27 22:14:06 +00:00
Enrico Granata 0f72c8ee4e Fixup one of the CMakeLists
llvm-svn: 246220
2015-08-27 21:55:55 +00:00
Enrico Granata 8f5e331dc2 Added a missing file to the CMakeLists
llvm-svn: 246216
2015-08-27 21:45:59 +00:00
Enrico Granata 5f9d310640 Add a new type of plugin: Language plugin
The Language plugin is menat to answer language-specific questions that are not bound to the existence of a process. Those are still the domain of the LanguageRuntime plugin

The Language plugin will, instead, answer questions such as providing language-specific data formatters or expression evaluation

At the moment, the interface is hollowed out, and empty do-nothing plugins have been setup for ObjC, C++ and ObjC++

llvm-svn: 246212
2015-08-27 21:33:50 +00:00
Enrico Granata db3d58b94a Remove class Language - the only thing it was actually being used for is provided by LanguageRuntime already
llvm-svn: 246177
2015-08-27 18:18:49 +00:00
Greg Clayton 5ce1a84f9a More cleanup to make sure no one plays with DWARFDebugInfoEntry. Clients outside of DWARFDebugInfoEntry of DWARFCompileUnit should use DWARFDIE only.
llvm-svn: 246172
2015-08-27 18:09:44 +00:00
Dawn Perchik f71e8370d1 Fix lldb build on older OSX versions after svn commit r244716
Older OSX versions don't define NSOperatingSystemVersion, so building
lldb gets: error: unknown type name 'NSOperatingSystemVersion'
This patch fixes the build by having GetOSVersionNumbers return false if
__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 101000, causing lldb to
behave the same as it did before the commit.

Reviewed by: jasonmolenda
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D12396

llvm-svn: 246138
2015-08-27 03:42:56 +00:00
Enrico Granata 6e25aeea96 Add functionality to the platforms to figure out the proper name for a dynamic library on the system given a basename
This will do things like,
given mylibrary,
return

libmylibrary.dylib on OSX
mylibrary.dll on Windows

and so on for other platforms
It is currently implemented for Windows, Darwin, and Linux. Other platforms should fill in accordingly

llvm-svn: 246131
2015-08-27 00:53:57 +00:00
Enrico Granata c0499c9848 Switch data formatters over to using std::function for their callbacks instead of raw function pointers. NFC
llvm-svn: 246130
2015-08-27 00:45:33 +00:00
Stephane Sezer 03439a87cf Silence some MSVC warnings.
Summary:
Just `assert("string" && false)` instead of `assert("string" == NULL)`.

This avoid errors like

    [...]\Core\SourceManager.cpp(647): warning C4130: '==' : logical operation on address of string constant

Reviewers: zturner

Subscribers: lldb-commits

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

llvm-svn: 246123
2015-08-26 23:55:14 +00:00
Greg Clayton 6071e6fc94 Major DWARF cleanup.
Added a new class called DWARFDIE that contains a DWARFCompileUnit and DWARFDebugInfoEntry so that these items always stay together.

There were many places where we just handed out DWARFDebugInfoEntry pointers and then use them with a compile unit that may or may not be the correct one. Clients outside of DWARFCompileUnit and DWARFDebugInfoEntry should all be dealing with DWARFDIE instances instead of playing with DWARFCompileUnit/DWARFDebugInfoEntry pairs manually.

This paves to the way for some modifications that are coming for DWO.

llvm-svn: 246100
2015-08-26 22:57:51 +00:00
Todd Fiala f50b20d819 http://reviews.llvm.org/D12380: remove DWARFCompileUnit printf spam.
llvm-svn: 246091
2015-08-26 22:08:26 +00:00
Enrico Granata 7539b02803 Fix missing override warnings
llvm-svn: 246084
2015-08-26 21:39:52 +00:00