Commit Graph

14949 Commits

Author SHA1 Message Date
Jim Ingham fb1bdc4922 This test now succeeds.
llvm-svn: 279897
2016-08-27 00:35:48 +00:00
Sean Callanan 3a878af29c Fixed the location of a conditional to make the following code clearer.
llvm-svn: 279896
2016-08-27 00:35:37 +00:00
Sean Callanan 8a33f6124c The error stream in IRForTarget is never null, so use it instead of the log.
llvm-svn: 279894
2016-08-27 00:20:38 +00:00
Sean Callanan 950e4ce8fc Fixed a bad lldbassert() condition.
llvm-svn: 279884
2016-08-26 23:48:03 +00:00
Kate Stone ac9c3a62a1 Tables of command options in LLDB benefit from hand-formatting to make it
easier to scan a set of options with a relatively large number of positional
arguments. This commit standardizes their formatting throughout LLDB and
applies surrounding directives to exempt them from being formatted by
clang-format.

These kinds of exemptions should be rare cases that benefit significantly
from alternative formatting. They also imply a long-term obligation to
maintain their format since the automated tools will not do so.

llvm-svn: 279882
2016-08-26 23:28:47 +00:00
Sean Callanan fc670cf6d0 Don't crash when trying to capture persistent variables in a block.
Reports an error instead.  We can fix this later to make persistent variables
work, but right now we hit an LLVM assertion if we get this wrong.

<rdar://problem/27770298>

llvm-svn: 279850
2016-08-26 18:12:39 +00:00
Pavel Labath 5e02fe6275 Switch linux and android CODE_OWNERS
Summary:
Oleksiy is no longer active in LLDB, I'd like to formally assume ownership of the linux and
android parts.

Reviewers: ovyalov, clayborg

Subscribers: tberghammer, danalbert, lldb-commits

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

llvm-svn: 279812
2016-08-26 10:06:13 +00:00
Pavel Labath 0e947eb636 Add cmake option to choose whether to use the builtin demangler
Summary:
Previously the builting demangler was on for platforms that explicitly set a flag by modifying
Mangled.cpp (windows, freebsd). The Xcode build always used builtin demangler by passing a
compiler flag. This adds a cmake flag (defaulting to ON) to configure the demangling library used
at build time. The flag is only available on non-windows platforms as there the system demangler
is not present (in the form we're trying to use it, at least).
The impact of this change is:
- linux: switches to the builtin demangler
- freebsd, windows: NFC (I hope)
- netbsd: switches to the builtin demangler
- osx cmake build: switches to the builtin demangler (matching the XCode build)

The main motivation for this is the cross-platform case, where it should bring more consistency
by removing the dependency on the host demangler (which can be completely unrelated to the debug
target).

Reviewers: zturner, emaste, krytarowski

Subscribers: emaste, clayborg, lldb-commits

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

llvm-svn: 279808
2016-08-26 09:47:58 +00:00
Jim Ingham 1bf7d30469 Make all the Function implementations different so the compiler won't share them.
Clang on ARM64 was making the three Function methods with identical bodies have
one implementation that was shared.  That threw off the count of breakpoints, since
we don't count as separate locations three functions with the same address.

I also cleaned up the test case while I was at it.

<rdar://problem/27001915>

llvm-svn: 279800
2016-08-26 01:27:50 +00:00
Enrico Granata ce8b743d59 Add a notification message in 'type lookup' when the current language doesn't yield results and one has to go across multiple languages to scan for types
Fixes rdar://22422313

llvm-svn: 279784
2016-08-25 22:11:01 +00:00
Pavel Labath 0faf37333c gdb-remote: Make the sequence mutex non-recursive
Summary:
This is a preparatory commit for D22914, where I'd like to replace this mutex by an R/W lock
(which is also not recursive). This required a couple of changes:
- The only caller of Read/WriteRegister, GDBRemoteRegisterContext class, was already acquiring
  the mutex, so these functions do not need to. All functions which now do not take a lock, take
  an lock argument instead, to remind the caller of this fact.
- GetThreadSuffixSupported() was being called from locked and unlocked contexts (including
  contexts where the process was running, and the call would fail if it did not have the result
  cached). I have split this into two functions, one which computes the thread suffix support and
  caches it (this one always takes the lock), and another, which returns the cached value (and
  never needs to take the lock). This feels quite natural as ProcessGdbRemote was already
  pre-caching this value at the start.

Reviewers: clayborg

Subscribers: lldb-commits

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

llvm-svn: 279725
2016-08-25 08:34:57 +00:00
Pavel Labath c1566308aa Fix warnings preventing copy elision.
Summary:
Moving a temporary object prevents copy elision, which is exactly
what clang points out by warning about this pattern.

The fix is simply removal of std::move applied to temporary objects.

Reviewers: clayborg

Subscribers: lldb-commits

Differential Revision: https://reviews.llvm.org/D23825
Author: Taras Tsugrii <ttsugrii@fb.com>

llvm-svn: 279724
2016-08-25 08:22:14 +00:00
Jason Molenda 30c18ecb3d If the user has specified target.memory-module-load-level 'minimal'
and we couldn't find a dyld binary on the debug system, override
that setting and read dyld out of memory - we need to put an
internal breakpoint on dyld to register binaries being loaded or
unloaded; the debugger won't work right without dyld symbols.

<rdar://problem/27857025> 

llvm-svn: 279704
2016-08-25 02:33:09 +00:00
Jason Molenda 541ec9bde8 Rewrite the GetFileInSDK methods in PlatformRemoteiOS,
PlatformRemoteAppleWatch, PlatformRemoteAppleTV and remove the 
GetFileInSDKRoot method from those classes.

The rewrite uses the more modern FileSpec etc API to simplify,
and handles the case where an SDK Root is given to lldb with
the "/Symbols" directory name already appended.  The new version
will try appending "/Symbols" and "/Symbols.Internal" to the 
sdk root directories, and will also try appending nothing to
the sdk root directory in case it's handed such an sdkroot.

<rdar://problem/28000054> 

llvm-svn: 279688
2016-08-24 23:46:48 +00:00
Todd Fiala b17ac35f20 fix darwin_log test errors on macOS < 10.12
The newer event-based tests I added neglected to do the
macOS 10.12 check in the setup.  This caused earlier macOS
test suite runs to attempt to compile code that doesn't exist.

llvm-svn: 279672
2016-08-24 21:40:29 +00:00
Pavel Labath c22e32deac Fix mismatched new/free in Process:RunPrivateStateThread
NFC

llvm-svn: 279627
2016-08-24 14:03:10 +00:00
Jason Molenda e1cf274bff Add api logging for SBDebugger::SetCurrentPlatformSDKRoot.
<rdar://problem/27857025> 

llvm-svn: 279611
2016-08-24 05:25:32 +00:00
Jim Ingham b612ac3775 Implementation "step out" plans shouldn't gather the return value.
When, for instance, "step-in" steps into a function that it doesn't want
to stop in (e.g. has no debug info) it will push a step-out plan to implement
the step out so it can then continue stepping.  These step out's don't use
the result of the function stepped out of, so they shouldn't spend the time 
to compute it.

llvm-svn: 279540
2016-08-23 17:55:21 +00:00
Jim Ingham 291fd35044 Change the PathMappingList::FindFile to use FileSpec API's
Also, when appending path components, collapse multiple "/" into one at the join.

llvm-svn: 279533
2016-08-23 17:13:33 +00:00
Pavel Labath 849cc1ae57 Fix a crash in GDBRemoteCommunicationClient::GetSupportedStructuredDataPlugins
The function was attempting to write the reply to the log even if the reply was empty.

llvm-svn: 279513
2016-08-23 12:10:09 +00:00
Pavel Labath e92050f044 Fix API usage in TestMultithreaded.test_sb_api_listener_event_process_state
The test was attempting to backtrace a process after every state change event (including the
"running", and "restarted" ones), which is not a good idea.

llvm-svn: 279512
2016-08-23 12:10:03 +00:00
Enrico Granata 2094e44f9b Add a non-code-running data formatter for __NSCFBoolean
llvm-svn: 279446
2016-08-22 18:07:52 +00:00
Todd Fiala be1d3a0b0e added Xcode lldb-gtest-for-debugging target
The lldb-gtest target is for CI and runs the tests as
part of the build phase.  It does not support debugging
the gtests from Xcode, though, due to the run happening
during the build phase.

This change adds a lldb-gtest-for-debugging target that
can be used to debug gtests.

llvm-svn: 279354
2016-08-20 00:54:03 +00:00
Enrico Granata 3630a287a6 Add logic to the ObjC runtime in LLDB to extract the pointer values of the two singleton (pairtons?) instances of __NSCFBoolean that represent true and false
This is useful because that knowledge will in turn allow no-code-running formatting of boolean NSNumbers; but that's a commit that will have to wait Monday..

llvm-svn: 279353
2016-08-20 00:48:11 +00:00
Jim Ingham 27f4a94e0a Remove a test that depends on knowing all compiler's register allocation schemes.
This test was using a condition that would compare a variable against the register that would hold
it.  It was failing with clang on arm64 because clang put the variable on the stack.

This is not a supportable way to write tests.

llvm-svn: 279345
2016-08-19 22:58:26 +00:00
Lang Hames 6377aa1cb1 [lldb] Use OrcMCJITReplacement rather than MCJIT as the underlying JIT for LLDB
expression evaluation.

OrcMCJITReplacement is a reimplementation of MCJIT using ORC components, and
provides an easy upgrade path to ORC for existing MCJIT clients. There should be
no functional changes resulting from this switch.

llvm-svn: 279327
2016-08-19 21:27:16 +00:00
Vedant Kumar e62b54ed2a Revert "[lldb][cmake] Remove libclang as an lldbBase dependency (NFCI)"
This reverts commit r279296. Including LLDBDependencies breaks the
netbsd lldb bot because it exposes LLDB_USED_LIBS, which causes
lldb_link_common_libs to run to completion in unintended sites, which
results in a malformed call to target_link_libraries.

  http://lab.llvm.org:8011/builders/lldb-amd64-ninja-netbsd7/builds/5989

Thanks to Chris Bieneman for figuring this out!

llvm-svn: 279322
2016-08-19 21:00:40 +00:00
Kate Stone b03a71eea8 Reverted premature changes to .clang-format
llvm-svn: 279316
2016-08-19 20:46:37 +00:00
Kate Stone 41de9a9791 Moved #include for lldb-python.h to a distinct group with a reminder comment
declaring that it must be first.  Failure to do so results in build failures
on macOS due to subtle header conflicts.

llvm-svn: 279315
2016-08-19 20:44:07 +00:00
Vedant Kumar 181f924beb [lldb][cmake] Remove libclang as an lldbBase dependency (NFCI)
It's pulling in all kinds of things it doesn't need (e.g, clang-tidy!).

Eliminating this dependency removes 1056 dependencies from the
'CommandObjectFrame.cpp.o' target and 454 dependencies from the 'lldb'
target. On my machine, this shaves 7 minutes off of a clean build of
lldb.

Thanks to Zachary Turner for pointing out some issues with an earlier
version of this patch!

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

llvm-svn: 279296
2016-08-19 18:41:50 +00:00
Pavel Labath 69dac575d3 Fix 32-bit builds after r279232
GetByteSize() of a DataBuffer returns a uint64_t (it probably shouldn't), which isn't implicitly
convertible to size_t.

llvm-svn: 279238
2016-08-19 13:14:13 +00:00
Dimitar Vlahovski d909f9551c Fixing a Darwing test thats failing on windows
The pexpect import should be make after the skip-if-not-darwin part
because pexpect is not available on Windows

llvm-svn: 279234
2016-08-19 12:44:53 +00:00
Pavel Labath b42b48e051 Remove the last manually constructed packet from gdb-remote register context + small refactor
Summary:
The tricky part here was that the exisiting implementation of WriteAllRegisters was expecting
hex-encoded data (as that was what the first implementation I replaced was using, but here we had
binary data to begin with. I thought the read/write register functions would be more useful if
they handled the hex-encoding themselves (all the other client functions provide the responses in
a more-or-less digested form). The read functions return a DataBuffer, so they can allocate as
much memory as they need to, while the write functions functions take an llvm::ArrayRef, as that
can be constructed from pretty much anything.

Reviewers: clayborg

Subscribers: lldb-commits

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

llvm-svn: 279232
2016-08-19 12:31:49 +00:00
Todd Fiala 1bdbebed1c add all missing gtest tests to the Xcode lldb-gtest target
Exclusions:
ModuleCacheTest: https://llvm.org/bugs/show_bug.cgi?id=29045
SymbolFilePDBTests: https://llvm.org/bugs/show_bug.cgi?id=29046

llvm-svn: 279208
2016-08-19 05:26:40 +00:00
Todd Fiala d6c7036e42 fixup macOS gtest running
Needed to explicitly turn off RTTI (since lldb-core builds
with -fno-rtti) and specify -DGTEST_HAVE_RTTI=0.

llvm-svn: 279205
2016-08-19 04:55:12 +00:00
Todd Fiala 49178e5efe fix broken gdb-remote gtest
This change adds the Process/gdb-remote gtests to the Xcode
build.  It also adds a virtual method impl to the continuation
delegate that I added with the StructuredDataPlugin change.

llvm-svn: 279203
2016-08-19 04:38:44 +00:00
Todd Fiala 759300192a Add StructuredData plugin type; showcase with new DarwinLog feature
Take 2, with missing cmake line fixed.  Build tested on
Ubuntu 14.04 with clang-3.6.

See docs/structured_data/StructuredDataPlugins.md for details.

differential review: https://reviews.llvm.org/D22976

reviewers: clayborg, jingham
llvm-svn: 279202
2016-08-19 04:21:48 +00:00
Todd Fiala a07e4a8352 Revert "Add StructuredData plugin type; showcase with new DarwinLog feature"
This reverts commit 1d885845d1451e7b232f53fba2e36be67aadabd8.

llvm-svn: 279200
2016-08-19 03:03:58 +00:00
Todd Fiala aef7de8492 Add StructuredData plugin type; showcase with new DarwinLog feature
See docs/structured_data/StructuredDataPlugins.md for details.

differential review: https://reviews.llvm.org/D22976

reviewers: clayborg, jingham
llvm-svn: 279198
2016-08-19 02:52:07 +00:00
Sean Callanan 799a3fc60b Fixed a problem where we failed to get the size of an Objective-C type.
<rdar://problem/27897056>

llvm-svn: 279098
2016-08-18 17:45:50 +00:00
Pavel Labath 83082a0337 gdb-remote: Remove manual locking from GetShlibInfoAddr
The function can simply call the non-NoLock version of the SendPacket function and let it do the
locking.

llvm-svn: 279070
2016-08-18 14:33:55 +00:00
Pavel Labath 27402d2a12 Move QSyncThreadState packet generation to the gdb-remote client
llvm-svn: 279057
2016-08-18 12:32:41 +00:00
Pavel Labath 4b6f9591d3 gdb-remote: Centralize thread specific packet handling
Summary:
Before this, each function had a copy of the code which handled appending of the thread suffix to
the packet (or using $Hg instead). I have moved that code into a single function and made
everyone else use that. The function takes the partial packet as a StreamString rvalue reference,
to avoid a copy and to remind the users that the packet will have undeterminate contents after
the call.

This also fixes the incorrect formatting of the QRestoreRegisterState packet in case thread
suffix is not supported.

Reviewers: clayborg

Subscribers: lldb-commits

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

llvm-svn: 279040
2016-08-18 08:30:03 +00:00
Pavel Labath c233995b1e Fix tests for the gdb-remote memory read packets
Part of TestGDBRemoteMemoryRead has been disabled since r259379 because it was incompatible with
python3. This changes the test to use the lldb-server test framework, which is a more appropriate
method of testing raw stub behaviour anyway (and should avoid the whole python 3 issue).

llvm-svn: 279039
2016-08-18 08:21:42 +00:00
Pavel Labath 9361c439e8 Fix parsing of complicated C++ names
Summary:
CPlusPlusLanguage::MethodName was not correctly parsing templated functions whose demangled name
included the return type -- the space before the function name was included in the "context" and
the context itself was not terminated correctly due to a misuse of the substr function (second
argument is length, not the end position). Fix that and add a regression test.

Reviewers: clayborg

Subscribers: lldb-commits

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

llvm-svn: 279038
2016-08-18 08:21:38 +00:00
Omair Javaid a6583c5d89 Correct makefile.rules to use arm/aarch64 target specific AR and OBJCOPY
Differential revision: https://reviews.llvm.org/D20386

llvm-svn: 278947
2016-08-17 16:45:34 +00:00
Pavel Labath 8e8e5061b8 Fix unittests on windows after r278915
Apparently clang will happily capture a const variable in a lambda without it being specified in
the capture clause. MSVC does not like that.

llvm-svn: 278925
2016-08-17 12:00:19 +00:00
Pavel Labath 2f430a1938 Remove cmake legacy code
Summary: Cmake 2.8 support is gone and not coming back. We can remove a bit of legacy code now.

Reviewers: zturner

Subscribers: lldb-commits

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

llvm-svn: 278924
2016-08-17 11:55:50 +00:00
Pavel Labath 3cc2f11f90 Fix unittest compilation error in r278915
llvm-svn: 278918
2016-08-17 09:17:08 +00:00
Pavel Labath d43ae376d4 Remove manual packet construction from GDBRemoteRegisterContext::SetPrimordialRegister
llvm-svn: 278916
2016-08-17 09:12:21 +00:00