Commit Graph

10125 Commits

Author SHA1 Message Date
Andy Gibbs 3acfe1a3d9 Fix trivial signed/unsigned comparison warnings
llvm-svn: 224932
2014-12-29 13:03:19 +00:00
Chandler Carruth 875d3bb538 [cmake/multilib] Teach LLDB to respect the multlib LLVM_LIBDIR_SUFFIX
variable (now provided both by the normal parent LLVM CMake files and by
the LLVMConfig.cmake file used by the standalone build).

This allows LLDB to build into and install into correctly suffixed
libdirs. This is especially significant for LLDB because the python
extension building done by CMake directly uses multilib suffixes when
the host OS does, and the host OS will not always look back and forth
between them. As a consequence, before LLVM, Clang, and LLDB (and every
other subproject) had support for using LLVM_LIBDIR_SUFFIX, you couldn't
build or install LLDB on a multilib system with its python extensions
enabled. With this patch (on top of all the others I have submitted
throughout the project), I'm finally able to build and install LLDB on
my system with Python support enabled. I'm also able to actually run the
LLDB test suite, etc. Now, a *huge* number of the tests still fail on my
Linux system, but hey, actually running them and them testing the
debugger is a huge step forward. =D

llvm-svn: 224930
2014-12-29 12:42:33 +00:00
Chandler Carruth e471e1363e [cmake] Teach the standalone CMake build to find the Python interpreter
the same way the LLVM CMake build does, notably using the proper CMake
module and specifically requesting an older Python version. LLDB relies
pretty heavily on not using Python 3 at this point, and without this
patch it ends up trying to use Python 3 which ends quite badly. =] With
this, I'm able to build LLDB in its standalone mode successfully on
Linux when I have both Python 2.7 and Python 3.3 installed.

llvm-svn: 224929
2014-12-29 12:32:27 +00:00
Jason Molenda 19ba9fbf27 Add support for frameless function compact unwind encodings on x86_64/i386.
This completes the compact unwind support for x86 targets.  

I'm still skipping the UNWIND_X86_64_MODE_STACK_IND encodings for
x86_64 right now because clang was emitting bad data for this form
until it was fixed in r217020 circa Sep 2014.

arm64 parsing still needs to be added.

llvm-svn: 224698
2014-12-22 11:02:02 +00:00
Jason Molenda 5c45c541a2 Various unwinder work.
Most of the changes are to the FuncUnwinders class -- as we've added
more types of unwind information, the way this class was written was
making it a mess to maintain.  Instead of trying to keep one
"non-call site" unwind plan and one "call site" unwind plan, track
all the different types of unwind plans we can possibly retrieve for
each function and have the call-site/non-call-site accessor methods
retrieve those.

Add a real "fast unwind plan" for x86_64 / i386 -- when doing an
unwind through a function, this only has to read the first 4 bytes 
to tell if the function has a standard prologue sequence.  If so, 
we can use the architecture default unwind plan to backtrace 
through this function.  If we try to retrieve the save location for
other registers later on, a real unwind plan will be used.  This
one is just for doing fast backtraces.

Change the compact unwind plan importer to fill in the valid address
range it is valid for. 

Compact unwind, in theory, may have multiple entries for a single
function.  The FuncUnwinders rewrite includes the start of supporting
this correctly.  In practice compact unwind encodings are used for
the entire range of the function today -- in fact, sometimes the same
encoding is used for multiple functions that have the same unwind
rules.  But I want to handle a single function that has multiple
different compact unwind UnwindPlans eventually.

llvm-svn: 224689
2014-12-21 10:44:54 +00:00
Jason Molenda b12a136cdd Re-enable compact unwind use on Mac platforms.
When lldb has a binary with protected section contents,
don't use the on-disk representation of that compact 
uwnind -- read it only out of live memory where it has
been decrypted.

llvm-svn: 224670
2014-12-20 03:12:51 +00:00
Enrico Granata 7863991945 Cleanup some redundant code
llvm-svn: 224659
2014-12-20 01:41:27 +00:00
Oleksiy Vyalov ec8f582aec No need to call SetErrorToErrno when pipe2 succeeds.
http://reviews.llvm.org/D6743

llvm-svn: 224652
2014-12-19 23:52:46 +00:00
Siva Chandra aaa3d47863 [TestEvents] Replace expectedFailureLinux with skipIfLinux
Summary:
If we do not mark them as skip, they are still executed, which in
turn is leading to an assertion failure. The change also adds
skipIfLinux to a testlet which was not previously marked with
skipIfLinux. This is because running even that test let leads to an
assertion failure.

Test Plan: dotest.py -C clang -p TestEvents.py

Reviewers: vharron

Reviewed By: vharron

Subscribers: lldb-commits

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

llvm-svn: 224644
2014-12-19 22:41:43 +00:00
Siva Chandra 5ab2e07231 [TestStaticVariables] Mark the one unmarked test let also expectedFailure.
Summary:
The test is question here is already annotated
with @expectedFailureDarwin(9980907).

This change also removes an uneccessary (and probably wrong) logic of
byssing few asserts if the compiler is not clang or llvm-gcc.

Both GCC and Clang emit incomplete debug info. Clang emits this:

< 1><0x00000026>    DW_TAG_class_type
                      DW_AT_name                  "A"
                      DW_AT_byte_size             0x00000001
                      DW_AT_decl_file             0x00000001
                      DW_AT_decl_line             0x0000001b
< 2><0x0000002e>      DW_TAG_member
                        DW_AT_name                  "g_points"
                        DW_AT_type                  <0x0000003b>
                        DW_AT_decl_file             0x00000001
                        DW_AT_decl_line             0x0000001e
                        DW_AT_external              yes(1)
                        DW_AT_declaration           yes(1)
                        DW_AT_accessibility         DW_ACCESS_public
< 1><0x0000003b>    DW_TAG_array_type
                      DW_AT_type                  <0x00000046>
< 2><0x00000040>      DW_TAG_subrange_type
                        DW_AT_type                  <0x0000007b>

Notice that the DIE at 0x40 does not specify an upperbound. This is with
Clang-3.5 and Clang ToT.

GCC emits this:

< 1><0x000000aa>    DW_TAG_class_type
                      DW_AT_name                  "A"
                      DW_AT_byte_size             0x00000001
                      DW_AT_decl_file             0x00000001
                      DW_AT_decl_line             0x0000001b
                      DW_AT_sibling               <0x000000c1>
< 2><0x000000b4>      DW_TAG_member
                        DW_AT_name                  "g_points"
                        DW_AT_decl_file             0x00000001
                        DW_AT_decl_line             0x0000001e
                        DW_AT_type                  <0x000000c1>
                        DW_AT_external              yes(1)
                        DW_AT_accessibility         DW_ACCESS_public
                        DW_AT_declaration           yes(1)
< 1><0x000000c1>    DW_TAG_array_type
                      DW_AT_type                  <0x0000007e>
                      DW_AT_sibling               <0x000000cc>
< 2><0x000000ca>      DW_TAG_subrange_type

The DIE at 0xca is missing attributes. This is with gcc-4.8.2.

Test Plan: dotest.py -C clang -P TestStaticVariables.py

Reviewers: clayborg

Reviewed By: clayborg

Subscribers: lldb-commits

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

llvm-svn: 224643
2014-12-19 22:40:05 +00:00
Siva Chandra f010d23497 [TestCompletion] Spawn LLDB with '--no-use-colors'.
Summary:
TestCompletion was broken for Ubuntu (and probably for Debian also).
The issue was that the lldb prompt in color (which is the default
behavior) was confusing pexpect.

Test Plan: "http://199.223.233.39:8011/lldb-try-clang-build-clang-test/"

Reviewers: zturner, clayborg

Reviewed By: clayborg

Subscribers: lldb-commits

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

llvm-svn: 224642
2014-12-19 22:37:23 +00:00
Jim Ingham 4aeb19893b Don't emit the "WARNING: no locations" message when breakpoints are set in
the dummy target.  Say they were set in the dummy target instead.

llvm-svn: 224606
2014-12-19 19:45:31 +00:00
Jim Ingham 4af5961caa Audit uses of ConstString::AsCString() to make sure they weren't assuming
they would always get a non-NULL string back.

<rdar://problem/19298575>

llvm-svn: 224602
2014-12-19 19:20:44 +00:00
Zachary Turner 54fa73afed Don't generate lldb inline test Makefiles if Makefile already exists.
Differential Revision: http://reviews.llvm.org/D6664
Reviewed by: Sean Callanan

llvm-svn: 224593
2014-12-19 18:26:33 +00:00
Greg Clayton 3a95b5bce2 Fixed an issue that could cause GetPointeeData() to fail when passing in a non-zero index.
The issue was we had a global variable that was a pointer, and the address type of the children wasn't "load address" when it needed to be. Full details are in the comments of the changes.

<rdar://problem/15107937>

llvm-svn: 224559
2014-12-19 01:28:42 +00:00
Zachary Turner f27ae73617 Always use python-based SWIG generation script for CMake.
As a first step in addressing Bug #21921 this patch prefers
the python-based SWIG generation by default rather than the
shell-based SWIG generation any time python is enabled
(e.g. LLDB_DISABLE_PYTHON is 0).

Additionally, this patch changes the default value of
LLDB_DISABLE_PYTHON from 1 to 0 on Windows.

Anyone not using the CMake build is unaffected by this patch.

llvm-svn: 224543
2014-12-18 21:25:53 +00:00
Stephane Sezer b743a8034f Display local kernel version only when non-remote in PlatformLinux.
Summary:
This is part of the Linux remote platform work. Displaying the local
kernel information when remote debugging doesn't make sense, so we
should verify if we are in host mode before doing so.

Test Plan:
Connect to a remote linux platform mode daemon with `platform select
remote-linux` followed by `platform connect ...`, and look at the output
of `platform status`.

Reviewers: tfiala, clayborg, vharron, compnerd

Subscribers: lldb-commits

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

llvm-svn: 224540
2014-12-18 20:24:32 +00:00
Enrico Granata da04fbb535 We don't really handle printing embedded NULs in strings, but if we were to, we would need to have this logic inside the StringPrinter. So, add it.. For, you know, one day in the future where we might want to handle embedded NULs in strings...
llvm-svn: 224537
2014-12-18 19:43:29 +00:00
Zachary Turner 7ae4b6de1d Only compile RegisterContextWindows_x86.cpp for x86 host architecture.
This fixes compilation failures in the 64-bit build of LLDB on Windows.

Patch by Aidan Dodds

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

llvm-svn: 224528
2014-12-18 18:21:33 +00:00
Eric Christopher c9d1c27d48 Fix a format string warning by noting that StringIsBreakpointName
will set the error accordingly and so there's no need to set it
again.

llvm-svn: 224468
2014-12-17 22:26:32 +00:00
Eric Christopher f70824428e Fix initialization order to match that of the source.
llvm-svn: 224467
2014-12-17 22:25:37 +00:00
Enrico Granata 972be53f02 Provide CreateValueFromData,Expression at the SBTarget level as well as the SBValue level; and also make all the implenentations agree on using the matching ValueObject::Create instead of doing code copypastas
llvm-svn: 224460
2014-12-17 21:18:43 +00:00
Zachary Turner ac94b5b14c Work around an internal compiler error in MSVC.
For some reason MSVC ICEs when trying to index into a map using
a temporary object.  Work around this by separating out the call
into multiple lines.

Patch by Aidan Dodds
Differential Revision: http://reviews.llvm.org/D6702
Reviewed by: Zachary Turner, Greg Clayton

llvm-svn: 224443
2014-12-17 18:02:36 +00:00
Zachary Turner 0b9d3eefdb Enhance the Pipe interface for better portability.
This patch makes a number of improvements to the Pipe interface.

1) An interface (PipeBase) is provided which exposes pure virtual
   methods for any implementation of Pipe to override.  While not
   strictly necessary, this helps catch errors where the interfaces
   are out of sync.

2) All methods return lldb_private::Error instead of returning bool
   or void.  This allows richer error information to be propagated
   up to LLDB.

3) A new ReadWithTimeout() method is exposed in the base class and
   implemented on Windows.

4) Support for both named and anonymous pipes is exposed through the
   base interface and implemented on Windows.  For creating a new
   pipe, both named and anonymous pipes are supported, and for
   opening an existing pipe, only named pipes are supported.

New methods described in points #3 and #4 are stubbed out on posix,
but fully implemented on Windows.  These should be implemented by
someone on the linux / mac / bsd side.

Reviewed by: Greg Clayton, Oleksiy Vyalov
Differential Revision: http://reviews.llvm.org/D6686

llvm-svn: 224442
2014-12-17 18:02:19 +00:00
Jim Ingham 5e09c8c32c Add the ability to tag one or more breakpoints with a name. These
names can then be used in place of breakpoint id's or breakpoint id 
ranges in all the commands that operate on breakpoints.

<rdar://problem/10103959>

llvm-svn: 224392
2014-12-16 23:40:14 +00:00
Enrico Granata 395939a483 Improve the performance of the libc++ std::map formatter. This is not the full solution to the slowness of this formatter, but it's a 5% improvement in our testcase performance, which I am not going to complain too hard about.
llvm-svn: 224373
2014-12-16 21:28:16 +00:00
Enrico Granata b476743726 In C++, it's #include not #import
llvm-svn: 224352
2014-12-16 19:10:37 +00:00
Zachary Turner 3e9ca3a625 Delete MSVC intermediate files on "make clean" from tests.
lld-link shells out to MSVC for certain types of work, and this
results in some MSVC output files being generated even though
clang / lld are the compiler / linker.  This is expected, so we
make sure to clean these output files on make clean.

llvm-svn: 224345
2014-12-16 16:48:19 +00:00
Hafiz Abid Qadeer 547cb78774 Fixed 2 typos in help.
llvm-svn: 224331
2014-12-16 10:20:35 +00:00
Jason Molenda 0f479da711 Temporarily disable CompactUnwindInfo::GetCompactUnwindInfoForFunction.
The compact unwind importer is getting the wrong unwind info for one
case that I found.  I haven't been able to fix the problem tonight 
and I don't want to leave TOT behaving incorrectly, so just ignore
compact unwind until I can get to the bottom of this.

llvm-svn: 224321
2014-12-16 06:20:30 +00:00
Enrico Granata 3cfc49f5e9 Instead of rolling our own, use the C++11 sanctioned solution
llvm-svn: 224310
2014-12-16 02:34:13 +00:00
Greg Clayton a2162b3166 If a binary was stripped we sometimes didn't show the ivars of an Objective C class correctly. Now we do as we consult the runtime data for the class so we don't have to have a symbol in the symbol table.
Fixed:
1 - try the symbol table symbol for an ObjC ivar and use it if available
2 - fall back to using the runtime data since it is slower to gather via memory read
3 - Fixed our hidden ivars test case to test this to ensure we don't regress
4 - split out a test case in the hidden ivars to cover only the part that was failing so we don't have an expected failure for all of the other content in the test.

<rdar://problem/18882687>

llvm-svn: 224306
2014-12-16 01:33:17 +00:00
Enrico Granata cf87ab9390 Now that AddressOf() does sane things with const results, this check is wrong. Since this is actually quite orthogonal to what this test is all about, actually get rid of the assertions
llvm-svn: 224290
2014-12-15 23:36:23 +00:00
Enrico Granata a6a1d5a623 Provide a SBFrame.register/.reg helper on the Python side of SBFrame to vend a flattened view of registers
Our actual view of registers is a set of register sets, each one of which contains a subset of the actual registers
This makes trivial scripting operations tedious ("I just want to read r7!")

This helper allows things like: print lldb.frame.reg["r7"]

Fixes rdar://19185662

llvm-svn: 224275
2014-12-15 21:30:36 +00:00
Hafiz Abid Qadeer fcbc3cdf3c Replace ioctl with select to reduce processor usage by lldb-mi on OSX.
This saga started with a hang on OSX. 2 solutions were proposed.
1) 'select' based solution works ok on OSX but slows down test completion time
on Linux many times.
2) 'ioctl' base solution also works but it causes heavy processor usage on OSX
as reported by Ilia K.

But as the original hang did not occur on Linux so this commit re-introduces the
'select' in conditional code so that it only runs for OSX. There is no need for
this 'fix' to run on Linux.

Initial patch by Ilia K <ki.stfu@gmail.com>. A few changes were made by me. 

llvm-svn: 224258
2014-12-15 19:09:40 +00:00
Stephane Sezer f2ef94e770 Make the platform process connect path less chatty.
Summary:
If a stream contains an empty string, no need to append it to the output
(otherwise we end up with a blank line). Also, no need to print a status
message when the state changes to connected, as this string brings no
information -- "Process 0" does not mean anything to the user, and the
process being connected has no meaning either.

Test Plan:
Connect to a remote linux platform mode daemon with `platform select
remote-linux` followed by `platform connect ...`, create a target and
run it, observe the output. Also, run the full test suite (dosep.py).

Before:
    (lldb) [...] connect, etc.
    (lldb) r
    Process 0 connected

    Process 5635 launched: '/Users/sas/Source/test' (x86_64)
    Process 5635 stopped

After:
    (lldb) [...] connect, etc.
    (lldb) r
    Process 5635 launched: '/Users/sas/Source/test' (x86_64)
    Process 5635 stopped

Reviewers: tfiala, vharron, clayborg

Subscribers: lldb-commits

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

llvm-svn: 224188
2014-12-13 05:23:51 +00:00
Enrico Granata dd6d24b253 Move a bunch of method implementations over to the C++ file; remove the need for a few includes. All in all, good stuff
llvm-svn: 224174
2014-12-13 02:07:50 +00:00
Vince Harron 17f429f462 Tests will timeout if they exceed time limit.
Default time limit is 5 minutes.

Override the default timeout of 5 minutes with LLDB_TEST_TIMEOUT.
LLDB_TEST_TIMEOUT=10m

Override the timeout for individual tests with LLDB_[TESTNAME]_TIMEOUT.
E.g., LLDB_TESTCONCURRENTEVENTS_TIMEOUT=2m

Set to "0" to run without timeout.

Submitted for Chaoren Lin

llvm-svn: 224171
2014-12-13 00:08:19 +00:00
Keno Fischer f4b170d0da SyntheticChildrenFrontEnd::* should also be built when python is disabled
Summary:
This moves
- SyntheticChildrenFrontEnd::CreateValueObjectFromExpression
- SyntheticChildrenFrontEnd::CreateValueObjectFromAddress
- SyntheticChildrenFrontEnd::CreateValueObjectFromData
outside the `#ifndef LLDB_DISABLE_PYTHON` since it doesn't seem to depend on python being available and indeed breaks the build when python is disabled.

Reviewers: granata.enrico

Subscribers: lldb-commits

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

llvm-svn: 224170
2014-12-13 00:05:58 +00:00
Enrico Granata fea9039511 Some more cleanup of the ValueObjectConstResultImpl code. NFC.
llvm-svn: 224160
2014-12-12 22:37:44 +00:00
Enrico Granata 53d498bc66 Fix up this test case
llvm-svn: 224157
2014-12-12 22:11:32 +00:00
Enrico Granata 15ee703045 Add a test case to validate that AddressOf() and GetLoadAddress() work on a ValueObjectConstResult. This test passing is the baseline of functionality we want to ensure for our const results
llvm-svn: 224151
2014-12-12 21:23:55 +00:00
Enrico Granata 0d484e9eec The so-called "trivial implementation" has been with us for a few years now. It's probably safe to assume it works.. so remove the #if stuff
llvm-svn: 224147
2014-12-12 19:26:08 +00:00
Enrico Granata 987ed3ce7c Do attempt to ask the impl_backend for the live address of a const result if none is stored in the object itself; this is for symmetry with GetAddressOf()
llvm-svn: 224143
2014-12-12 19:05:44 +00:00
Enrico Granata 6ded39093e Do not set the live address of a const result child if its parent has an invalid live address
llvm-svn: 224142
2014-12-12 18:59:49 +00:00
Zachary Turner 555a7a6ad2 Add a method to disable the Windows crash / assert dialogs.
When running the test suite on Windows, we can't have Windows popping
up dialogs when LLDB crashes in native code because it will hang
the test suite.  This patch silences those dialogs by checking an
environment variable at startup and configuring Windows based on
its value.

This patch also adds an environment variable to force inferiors to
never spawn in their own console window.  This is useful to prevent
new window spawm when running the test suite.

Reviewed by: Scott Graham

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

llvm-svn: 224137
2014-12-12 18:10:52 +00:00
Greg Clayton 482f9be175 Make sure if a thread specifies a 'register_data_addr' in a python operating system plug-in, that is is used to fetch the register values.
llvm-svn: 224083
2014-12-11 23:53:52 +00:00
Greg Clayton cd255b3111 Make sure we print errors for python OperatingSystem plug-ins for when things go wrong. We also dump the dictionary or collection that had errors so the user can see which info was wrong.
llvm-svn: 224082
2014-12-11 23:52:05 +00:00
Sean Callanan d919698caa Removed the assertion that we can find any named
Objective-C type in the runtime.  This is not actually
true, it's entirely possible to say

@class DoesntExist;

@interface DoesExist {
  DoesntExist *whyyyyy;
}
@end

and this code will not only compile but also run.  So
this assertion will fire in situations users might
encounter.

I left the assertion enabled in debug mode, because we
could still catch a case we're not aware of (i.e., a
class that we *ought* to have found but where somehow
we mis-parsed the name).

<rdar://problem/19151914>

llvm-svn: 224038
2014-12-11 19:33:57 +00:00
Zachary Turner 29278a6ac4 Disable the remaining ProcessIO test on Windows.
This still relies on PutSTDIN, just indirectly.  So it was hanging
due to not being able to get stdin from the test.

llvm-svn: 223983
2014-12-10 23:25:28 +00:00